summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYH Lin <yueherngl@google.com>2019-02-26 09:56:06 -0800
committerPatrick Georgi <pgeorgi@google.com>2019-02-27 11:08:18 +0000
commit40f65425e4635de03b6e3114598a5e455fcd6ff8 (patch)
tree3f6a63dd873b64b859e495ff72f1e9125412bb25
parentb47c633c31a935a73e4d88d45437682e7b10310f (diff)
ec/google/chromeec: fix the error status passing
Various instances of google_chromeec_command() can return non-zero number (both positive and negative) to indicate error -- fixing cbi_get_uint32() and cbi_get_string() so they follow the same convention. BUG=b:123676982 BRANCH=kukui TEST=build with kukui/flapjack configurations Signed-off-by: YH Lin <yueherngl@google.com> Change-Id: I7f0a8a61d01d942cba57036a17dd527fdbbf940c Reviewed-on: https://review.coreboot.org/c/31585 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/ec/google/chromeec/ec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c
index d2a0849dc9..09357b0fb7 100644
--- a/src/ec/google/chromeec/ec.c
+++ b/src/ec/google/chromeec/ec.c
@@ -595,7 +595,7 @@ static int cbi_get_uint32(uint32_t *id, uint32_t tag)
cmd.cmd_dev_index = 0;
rv = google_chromeec_command(&cmd);
- if (rv < 0)
+ if (rv != 0)
return rv;
*id = r;
return 0;
@@ -627,7 +627,7 @@ static int cbi_get_string(char *buf, size_t bufsize, uint32_t tag)
int rv;
rv = google_chromeec_command(&cmd);
- if (rv < 0)
+ if (rv != 0)
return rv;
/* Ensure NUL termination. */