summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSourabh Banerjee <sbanerje@codeaurora.org>2015-02-27 19:11:19 +0530
committerPatrick Georgi <pgeorgi@google.com>2015-04-21 08:16:12 +0200
commit54cc8badc99c2f8457868cb915522bd3386be612 (patch)
treea69f71f92e0d0b1db89de362e946f95fc46ba960
parentf36cffc07a3744bd39d8874d85e59fac45af39d3 (diff)
downloadcoreboot-54cc8badc99c2f8457868cb915522bd3386be612.tar.xz
ipq806x: i2c: stop transfer as soon as an error is reported
I2c transfer may consist of multiple segments (for instance write segment to set the register address and then a read segment to read the register value). Transfer should be stopped as soon as a segment processing error has been reported. BRANCH=master BUG=chrome-os-partner:35328 TEST=transfer shall not process the read segment when the write segment fails Change-Id: I85b7b59b376ce33ba3f6d2526be86e9f6585d97b Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 50cd4d40851b3cea99183c549c47b4486a3deb4a Original-Change-Id: Id65f995d860dd670b289fbdd9eb0ca19a50d7007 Original-Signed-off-by: Sourabh Banerjee <sbanerje@codeaurora.org> Original-Reviewed-on: https://chromium-review.googlesource.com/254494 Original-Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Original-Commit-Queue: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: http://review.coreboot.org/9824 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
-rw-r--r--src/soc/qualcomm/ipq806x/i2c.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/soc/qualcomm/ipq806x/i2c.c b/src/soc/qualcomm/ipq806x/i2c.c
index 9aaa173513..e121ae8496 100644
--- a/src/soc/qualcomm/ipq806x/i2c.c
+++ b/src/soc/qualcomm/ipq806x/i2c.c
@@ -150,7 +150,7 @@ int platform_i2c_transfer(unsigned bus, struct i2c_seg *segments, int seg_count)
if (i2c_init(bus))
return 1;
- while (seg_count--) {
+ while (!ret && seg_count--) {
if (seg->read)
ret = i2c_read(bus, seg->chip, seg->buf, seg->len);
else