projects/linux·commit 67860739

w1: fix test in ds2482_wait_1wire_idle()

67860739 · Roel Kluin <[email protected]> · 2010-03-10 15:23:49 -08:00

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

Signed-off-by: Roel Kluin <[email protected]>
Cc: Evgeniy Polyakov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
6786073927c3ff3eb7fc3d2192e761e86fa0d352
Parents
7ed63d5e

Changes

1 files changed · +1 −1

FileStatusAddDelContent
drivers/w1/masters/ds2482.cmodified+1−1View file

drivers/w1/masters/ds2482.c

View file
diff --git a/drivers/w1/masters/ds2482.c b/drivers/w1/masters/ds2482.c
index 406caa6..e5f7441 100644
--- a/drivers/w1/masters/ds2482.c
+++ b/drivers/w1/masters/ds2482.c
@@ -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);