diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-05-05 02:39:24 -0400 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2009-05-05 02:39:24 -0400 |
commit | 4ccc28f725bc2b7b0a3bc27e9c15f4eaf63fb812 (patch) | |
tree | f1a3a3424713340aabb5722fc1accad149fc5052 /drivers/i2c/busses/i2c-sis630.c | |
parent | b4348f32dae3cb6eb4bc21c7ed8f76c0b11e9d6a (diff) |
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-sis630.c')
-rw-r--r-- | drivers/i2c/busses/i2c-sis630.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-sis630.c b/drivers/i2c/busses/i2c-sis630.c index 50c3610e6028..70ca41e90e58 100644 --- a/drivers/i2c/busses/i2c-sis630.c +++ b/drivers/i2c/busses/i2c-sis630.c | |||
@@ -173,7 +173,7 @@ static int sis630_transaction_wait(struct i2c_adapter *adap, int size) | |||
173 | } while (!(temp & 0x0e) && (timeout++ < MAX_TIMEOUT)); | 173 | } while (!(temp & 0x0e) && (timeout++ < MAX_TIMEOUT)); |
174 | 174 | ||
175 | /* If the SMBus is still busy, we give up */ | 175 | /* If the SMBus is still busy, we give up */ |
176 | if (timeout >= MAX_TIMEOUT) { | 176 | if (timeout > MAX_TIMEOUT) { |
177 | dev_dbg(&adap->dev, "SMBus Timeout!\n"); | 177 | dev_dbg(&adap->dev, "SMBus Timeout!\n"); |
178 | result = -ETIMEDOUT; | 178 | result = -ETIMEDOUT; |
179 | } | 179 | } |