usb_mux: Simplify logging to reduce code size

BUG=none
BRANCH=none
TEST=make buildall

Change-Id: Ib2d9476e4740527ad2e1f73eeecb0306140b3f38
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1025118
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
This commit is contained in:
Philip Chen
2018-04-23 19:56:26 -07:00
committed by chrome-bot
parent 6b57b4b390
commit c4778cb4c4

View File

@@ -24,7 +24,7 @@ void usb_mux_init(int port)
ASSERT(port >= 0 && port < CONFIG_USB_PD_PORT_COUNT);
res = mux->driver->init(mux->port_addr);
if (res)
CPRINTS("Error initializing mux port(%d): %d", port, res);
CPRINTS("Err: init mux port(%d): %d", port, res);
/* Apply board specific initialization */
if (mux->board_init)
@@ -51,7 +51,7 @@ void usb_mux_set(int port, enum typec_mux mux_mode,
mux_state = polarity ? mux_mode | MUX_POLARITY_INVERTED : mux_mode;
res = mux->driver->set(mux->port_addr, mux_state);
if (res) {
CPRINTS("Error setting mux port(%d): %d", port, res);
CPRINTS("Err: set mux port(%d): %d", port, res);
return;
}
@@ -70,7 +70,7 @@ int usb_mux_get(int port, const char **dp_str, const char **usb_str)
res = mux->driver->get(mux->port_addr, &mux_state);
if (res) {
CPRINTS("Error getting mux port(%d): %d", port, res);
CPRINTS("Err: get mux port(%d): %d", port, res);
return 0;
}
@@ -91,7 +91,7 @@ void usb_mux_flip(int port)
res = mux->driver->get(mux->port_addr, &mux_state);
if (res) {
CPRINTS("Error getting mux port(%d): %d", port, res);
CPRINTS("Err: get mux port(%d): %d", port, res);
return;
}
@@ -102,7 +102,7 @@ void usb_mux_flip(int port)
res = mux->driver->set(mux->port_addr, mux_state);
if (res)
CPRINTS("Error setting mux port(%d): %d", port, res);
CPRINTS("Err: set mux port(%d): %d", port, res);
}
#ifdef CONFIG_CMD_TYPEC