From: Roel Kluin Date: Wed, 10 Mar 2010 23:23:49 +0000 (-0800) Subject: w1: fix test in ds2482_wait_1wire_idle() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6786073927c3ff3eb7fc3d2192e761e86fa0d352;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git 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 Cc: Evgeniy Polyakov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/w1/masters/ds2482.c b/drivers/w1/masters/ds2482.c index 406caa6a71cb..e5f74416d4b7 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);