From 54cc8badc99c2f8457868cb915522bd3386be612 Mon Sep 17 00:00:00 2001 From: Sourabh Banerjee Date: Fri, 27 Feb 2015 19:11:19 +0530 Subject: 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 Original-Commit-Id: 50cd4d40851b3cea99183c549c47b4486a3deb4a Original-Change-Id: Id65f995d860dd670b289fbdd9eb0ca19a50d7007 Original-Signed-off-by: Sourabh Banerjee Original-Reviewed-on: https://chromium-review.googlesource.com/254494 Original-Reviewed-by: Vadim Bendebury Original-Commit-Queue: Vadim Bendebury Reviewed-on: http://review.coreboot.org/9824 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/soc/qualcomm/ipq806x/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/soc/qualcomm') 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 -- cgit v1.2.3