diff options
-rw-r--r-- | board/glkrvp/chg_usb_pd.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/board/glkrvp/chg_usb_pd.c b/board/glkrvp/chg_usb_pd.c index cdab48d47b..2536c051c3 100644 --- a/board/glkrvp/chg_usb_pd.c +++ b/board/glkrvp/chg_usb_pd.c @@ -199,16 +199,12 @@ DECLARE_HOOK(HOOK_INIT, board_charge_init, HOOK_PRIO_DEFAULT); int board_set_active_charge_port(int port) { - /* charge port is a realy physical port */ - int is_real_port = (port >= 0 && - port < CHARGE_PORT_COUNT); - /* check if we are source vbus on that port */ - int source = board_charger_port_is_sourcing_vbus(port); - - if (is_real_port && source) { - CPRINTS("Skip enable p%d", port); - return EC_ERROR_INVAL; - } + /* if it's a PD port and sourcing VBUS, don't enable */ + if (port >= 0 && port < CONFIG_USB_PD_PORT_COUNT) + if (board_charger_port_is_sourcing_vbus(port)) { + CPRINTS("Skip enable p%d", port); + return EC_ERROR_INVAL; + } /* * Do not enable Type-C port if the DC Jack is present. |