From e2305b6af9d48da6d01c4bb371ddd52d26cedff1 Mon Sep 17 00:00:00 2001 From: Scott Date: Mon, 31 Oct 2016 15:16:54 -0700 Subject: [PATCH] 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 Reviewed-on: https://chromium-review.googlesource.com/405747 Commit-Ready: Scott Collyer Tested-by: Scott Collyer Reviewed-by: Vijay P Hiremath Reviewed-by: Aseda Aboagye --- driver/charger/bd9995x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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