]> git.baikalelectronics.ru Git - kernel.git/commit
i2c-algo-pcf: Handle timeout correctly
authorRoel Kluin <roel.kluin@gmail.com>
Sat, 28 Mar 2009 20:34:42 +0000 (21:34 +0100)
committerJean Delvare <khali@linux-fr.org>
Sat, 28 Mar 2009 20:34:42 +0000 (21:34 +0100)
commit62e0d7512534b51a85c5abc3787cd0f454221324
tree7db1c35614e593f80ee17c10915dda76d2ee2836
parentc80c5a172c3f3ca7e510f769fbe62b2b80d624d2
i2c-algo-pcf: Handle timeout correctly

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 msg_num should be tested before the timeout.
With the current order, you could exit with a timeout error while all the
messages were successfully transferred.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Eric Brower <ebrower@gmail.com>
drivers/i2c/algos/i2c-algo-pcf.c