summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarry Cutts <hcutts@chromium.org>2019-09-27 16:40:22 -0700
committerCommit Bot <commit-bot@chromium.org>2019-10-01 04:28:42 +0000
commitdb7a840856cc04c8fecf19e175f16e20df9d21bd (patch)
treecd37cc8426532fda5e11652aa2c8698848aa6b8b
parent3daa7fb8a4caec652dbe1ee02d505d7fffcab85a (diff)
downloadchrome-ec-db7a840856cc04c8fecf19e175f16e20df9d21bd.tar.gz
util/comm-i2c: return response length from `ec_command`
In my original implementation I returned the response code (possibly because I was confused by `ec_command_servo_spi` returning something like that), but `do_i2c_xfer` (used for all I2C passthrough stuff) breaks in that case. Changing it to return response length (consistent with the `ec_command` doc comment) fixes that problem. BRANCH=none BUG=chromium:1008568 TEST=Use `ectool i2cwrite ...` to write to one of the EC's I2C slaves (should report success instead of "Truncated read response"). Change-Id: I341c3907ac44c6c3d1086ae10b31e81062215f20 Signed-off-by: Harry Cutts <hcutts@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1830099 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r--util/comm-i2c.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/comm-i2c.c b/util/comm-i2c.c
index 5cc8c4a622..d01ce3d023 100644
--- a/util/comm-i2c.c
+++ b/util/comm-i2c.c
@@ -186,7 +186,7 @@ static int ec_command_i2c_3(int command, int version,
+ sizeof(struct ec_host_response)],
insize);
- ret = command_return_code;
+ ret = resp->data_len;
done:
if (req_buf)
free(req_buf);