]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: Timeouts reach -1
authorRoel Kluin <roel.kluin@gmail.com>
Tue, 24 Feb 2009 18:19:48 +0000 (19:19 +0100)
committerJean Delvare <khali@linux-fr.org>
Tue, 24 Feb 2009 18:19:48 +0000 (19:19 +0100)
commit016db5a85fd17147d7a6cc1c634d2add64e12084
treece79fc247342fa9fde8ad184a4ec39d70ce0012a
parent606b79bffca78fb60c28777bed73d8f62d749d36
i2c: Timeouts reach -1

With a postfix decrement these timeouts reach -1 rather than 0, but
after the loop it is tested whether they have become 0.

As pointed out by Jean Delvare, the condition we are waiting for should
also be tested before the timeout. With the current order, you could
exit with a timeout error while the job is actually done.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
drivers/i2c/busses/i2c-amd8111.c
drivers/i2c/busses/i2c-pxa.c