提交 67860739 编写于 作者: R Roel Kluin 提交者: Linus Torvalds

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: NRoel Kluin <roel.kluin@gmail.com>
Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 7ed63d5e
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册