diff options
author | Scott <scollyer@chromium.org> | 2016-10-31 15:16:54 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-11-01 12:48:48 -0700 |
commit | e2305b6af9d48da6d01c4bb371ddd52d26cedff1 (patch) | |
tree | d54a328bad430e640dfe823917dc96b1c33bc0cf | |
parent | e8ab026bac8960280d1dd63c532ee4aa31e9246c (diff) | |
download | chrome-ec-e2305b6af9d48da6d01c4bb371ddd52d26cedff1.tar.gz |
BD9995X: Fix disable case in bd9995x_select_input_port
The 'else' was missing in the for the check of
port == BD9995X_CHARGE_PORT_BOTH. So if it wasn't this port type then
it would always hit the panic.
BUG=chrome-os-partner:59189
BRANCH=none
TEST=Manual
Verfied the failure case using a type C to type A adapter. After
applying the fix verified that it no longer panics.
Change-Id: Ia5a16c39e226d5e648c20d0c8675d6433d083f22
Signed-off-by: Scott <scollyer@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/405747
Commit-Ready: Scott Collyer <scollyer@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r-- | driver/charger/bd9995x.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/driver/charger/bd9995x.c b/driver/charger/bd9995x.c index 137cd25b6f..3b91be2425 100644 --- a/driver/charger/bd9995x.c +++ b/driver/charger/bd9995x.c @@ -827,7 +827,7 @@ int bd9995x_select_input_port(enum bd9995x_charge_port port, int select) reg &= ~BD9995X_CMD_VIN_CTRL_SET_VBUS_EN; else if (port == BD9995X_CHARGE_PORT_VCC) reg &= ~BD9995X_CMD_VIN_CTRL_SET_VCC_EN; - if (port == BD9995X_CHARGE_PORT_BOTH) + else if (port == BD9995X_CHARGE_PORT_BOTH) reg &= ~(BD9995X_CMD_VIN_CTRL_SET_VBUS_EN | BD9995X_CMD_VIN_CTRL_SET_VCC_EN); else |