summaryrefslogtreecommitdiff
path: root/drivers/i2c/busses/i2c-sis96x.c
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-05-05 10:39:24 +0400
committerJean Delvare <khali@linux-fr.org>2009-05-05 10:39:24 +0400
commit4ccc28f725bc2b7b0a3bc27e9c15f4eaf63fb812 (patch)
treef1a3a3424713340aabb5722fc1accad149fc5052 /drivers/i2c/busses/i2c-sis96x.c
parentb4348f32dae3cb6eb4bc21c7ed8f76c0b11e9d6a (diff)
downloadlinux-4ccc28f725bc2b7b0a3bc27e9c15f4eaf63fb812.tar.xz
i2c: Timeouts off by 1
with while (timeout++ < MAX_TIMEOUT); timeout reaches MAX_TIMEOUT + 1 after the loop, so the tests below are off by one. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-sis96x.c')
-rw-r--r--drivers/i2c/busses/i2c-sis96x.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-sis96x.c b/drivers/i2c/busses/i2c-sis96x.c
index 7e1594b40579..8295885b2fdb 100644
--- a/drivers/i2c/busses/i2c-sis96x.c
+++ b/drivers/i2c/busses/i2c-sis96x.c
@@ -132,7 +132,7 @@ static int sis96x_transaction(int size)
} while (!(temp & 0x0e) && (timeout++ < MAX_TIMEOUT));
/* If the SMBus is still busy, we give up */
- if (timeout >= MAX_TIMEOUT) {
+ if (timeout > MAX_TIMEOUT) {
dev_dbg(&sis96x_adapter.dev, "SMBus Timeout! (0x%02x)\n", temp);
result = -ETIMEDOUT;
}