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>
This commit is contained in:
Caveh Jalali 2022-11-02 20:48:51 -07:00 committed by Martin L Roth
parent 0bab8ed085
commit 675de7524c
1 changed files with 3 additions and 2 deletions

View File

@ -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 {