w1: fix test in ds2482_wait_1wire_idle()

With `while (++retries < DS2482_WAIT_IDLE_TIMEOUT)' retries reaches
DS2482_WAIT_IDLE_TIMEOUT after the loop

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Roel Kluin 2010-03-10 15:23:49 -08:00 committed by Linus Torvalds
parent 7ed63d5eb4
commit 6786073927
1 changed files with 1 additions and 1 deletions

View File

@ -214,7 +214,7 @@ static int ds2482_wait_1wire_idle(struct ds2482_data *pdev)
(++retries < DS2482_WAIT_IDLE_TIMEOUT));
}
if (retries > DS2482_WAIT_IDLE_TIMEOUT)
if (retries >= DS2482_WAIT_IDLE_TIMEOUT)
printk(KERN_ERR "%s: timeout on channel %d\n",
__func__, pdev->channel);