Martin L Roth has submitted this change. ( https://review.coreboot.org/c/coreboot/+/69372 )
Change subject: ec/google/chromeec: Simplify error handling for GET_VERSION ......................................................................
ec/google/chromeec: Simplify error handling for GET_VERSION
We don't need to check the lower level error code to determine if an EC call succeeded. Simply check the return value of the call.
BUG=b:258126464 BRANCH=none TEST=none
Change-Id: Iaf0795b0c1a2df0d3f44e6098ad02b82e33c5710 Signed-off-by: Caveh Jalali caveh@chromium.org Reviewed-on: https://review.coreboot.org/c/coreboot/+/69372 Reviewed-by: Boris Mittelberg bmbm@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Eric Lai eric_lai@quanta.corp-partner.google.com --- M src/ec/google/chromeec/ec.c 1 file changed, 24 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Boris Mittelberg: Looks good to me, but someone else must approve Eric Lai: Looks good to me, approved
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c index 906b5f8..9c78404 100644 --- a/src/ec/google/chromeec/ec.c +++ b/src/ec/google/chromeec/ec.c @@ -1356,10 +1356,11 @@ .cmd_size_out = sizeof(resp), .cmd_dev_index = 0, }; + int rv;
- google_chromeec_command(&cmd); + rv = google_chromeec_command(&cmd);
- if (cmd.cmd_code) { + if (rv != 0) { printk(BIOS_DEBUG, "Google Chrome EC: version command failed!\n"); } else {