w1: fix test in ds2482_wait_1wire_idle()
authorRoel Kluin <roel.kluin@gmail.com>
Wed, 10 Mar 2010 23:23:49 +0000 (15:23 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 12 Mar 2010 23:52:43 +0000 (15:52 -0800)
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>
drivers/w1/masters/ds2482.c

index 406caa6a71cbb1bc40d54e44f957079a1b4f1b06..e5f74416d4b766f6da15dc45ded4042440d7d64e 100644 (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);