summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlie Mooney <charliemooney@chromium.org>2012-08-23 07:59:37 -0700
committerGerrit <chrome-bot@google.com>2012-08-23 09:31:41 -0700
commit89be1be31a32d3c0517af27e248b28db57cdac39 (patch)
treea3d87e6c588762620dd867ed644be1f5151e4e14
parent2f70b36ad0623c2c2719fe39c71e80acbeb23aae (diff)
downloadchrome-ec-89be1be31a32d3c0517af27e248b28db57cdac39.tar.gz
Snow: Fixing invalid i2c error codes
The i2c driver was returning the result from task_wait_event() as an error code when it failed. However, this function returns an event mask, not a valid error code. It has been replaced to return EC_ERROR_TIMEOUT instead when the even times out. BUG=chrome-os-partner:13057 TEST=Booting the machine, and normal use works fine. Running i2c stress tests also work without error. No functional changes were made, only the error codes for debugging. BRANCH=snow Change-Id: I3e48f97c08c82fd50b811e8289f3bd378ecb3171 Signed-off-by: Charlie Mooney <charliemooney@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/31214 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--chip/stm32/i2c.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/chip/stm32/i2c.c b/chip/stm32/i2c.c
index 5205abbda6..2d98d37e1e 100644
--- a/chip/stm32/i2c.c
+++ b/chip/stm32/i2c.c
@@ -666,7 +666,7 @@ static int i2c_master_transmit(int port, int slave_addr, uint8_t *data,
if (rv_start)
return rv_start;
if (!(rv & TASK_EVENT_WAKE))
- return rv;
+ return EC_ERROR_TIMEOUT;
rv = wait_status(port, SR1_BTF, WAIT_XMIT_BTF);
if (rv)
@@ -711,7 +711,7 @@ static int i2c_master_receive(int port, int slave_addr, uint8_t *data,
if (rv_start)
return rv_start;
if (!(rv & TASK_EVENT_WAKE))
- return rv;
+ return EC_ERROR_TIMEOUT;
master_stop(port);
} else {