From 76bd681c8f46137953f4dc02c5de03589b0d203f Mon Sep 17 00:00:00 2001 From: Edward Hill Date: Sun, 14 Jan 2018 16:36:00 -0800 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/866214 Reviewed-by: Simon Glass Reviewed-by: Justin TerAvest --- board/grunt/board.c | 12 ++++-------- 1 file 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; } -- cgit v1.2.1