Skip to contentSkip to conversation

w1: fix test in ds2482_wait_1wire_idle()

PATCH New Roel Kluin 1 participant 1 message Dec 27, 2009 W1 dallas's 1-wire bus

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 w1: fix test in ds2482_wait_1wire_idle()

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

---
 drivers/w1/masters/ds2482.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/w1/masters/ds2482.c +1 -1
index 406caa6..e5f7441 100644
@@ -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);