diff options
author | Caveh Jalali <caveh@chromium.org> | 2022-11-02 20:48:51 -0700 |
---|---|---|
committer | Martin L Roth <gaumless@gmail.com> | 2022-11-12 23:00:38 +0000 |
commit | 675de7524c495dc42f1b47d04aecc6eeabd5d0a1 (patch) | |
tree | f720a8321b7271c99fe0c004a4e22784a0314d59 /src/ec/google/chromeec | |
parent | 0bab8ed085a92b7c8119d178e1f14a4736eafd60 (diff) |
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>
Diffstat (limited to 'src/ec/google/chromeec')
-rw-r--r-- | src/ec/google/chromeec/ec.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c index 906b5f8126..9c78404ef8 100644 --- a/src/ec/google/chromeec/ec.c +++ b/src/ec/google/chromeec/ec.c @@ -1356,10 +1356,11 @@ enum ec_image google_chromeec_get_current_image(void) .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 { |