diff options
author | Edward Hill <ecgh@chromium.org> | 2018-01-14 16:36:00 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-01-16 01:26:15 -0800 |
commit | 76bd681c8f46137953f4dc02c5de03589b0d203f (patch) | |
tree | 1b959a517c6e376d196fd20cd1ba40b366d9d323 | |
parent | 67ae6eb9b02d896d51da725c273d472a6fe01366 (diff) | |
download | chrome-ec-76bd681c8f46137953f4dc02c5de03589b0d203f.tar.gz |
grunt: Don't return error when disabling all charge ports
charge_manager_refresh() asserts that
board_set_active_charge_port(CHARGE_PORT_NONE) returns EC_SUCCESS,
so if port 1 on Grunt's daughter board is disconnected, the EC
gets stuck in an assert crash loop. Just printing the error and
continuing seems like a better way to handle the missing port.
BUG=b:71955904
BRANCH=none
TEST=grunt with no daughter board doesn't assert
Change-Id: I8a0f79e45c7b564794498cfc41bcc4acd8fd231f
Signed-off-by: Edward Hill <ecgh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/866214
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Justin TerAvest <teravest@chromium.org>
-rw-r--r-- | board/grunt/board.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/board/grunt/board.c b/board/grunt/board.c index fa560cb265..06b36b406e 100644 --- a/board/grunt/board.c +++ b/board/grunt/board.c @@ -308,18 +308,14 @@ void board_overcurrent_event(int port) int board_set_active_charge_port(int port) { int i; - int rv; CPRINTS("New chg p%d", port); if (port == CHARGE_PORT_NONE) { /* Disable all ports. */ for (i = 0; i < ppc_cnt; i++) { - rv = ppc_vbus_sink_enable(i, 0); - if (rv) { - CPRINTS("Disabling p%d sink path failed.", i); - return rv; - } + if (ppc_vbus_sink_enable(i, 0)) + CPRINTS("p%d: sink disable failed.", i); } return EC_SUCCESS; @@ -340,12 +336,12 @@ int board_set_active_charge_port(int port) continue; if (ppc_vbus_sink_enable(i, 0)) - CPRINTS("p%d: sink path disable failed.", i); + CPRINTS("p%d: sink disable failed.", i); } /* Enable requested charge port. */ if (ppc_vbus_sink_enable(port, 1)) { - CPRINTS("p%d: sink path enable failed."); + CPRINTS("p%d: sink enable failed."); return EC_ERROR_UNKNOWN; } |