summaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-06-23 11:29:00 +0300
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>2017-07-06 22:37:16 +0200
commitd0a67c372df410b579197ea818596001fe20070d (patch)
tree09eb3d616ebd7c542a41fe2cd0b814f118e03f4e /drivers/rtc
parent1d61d2592c1f70d74112ed1ee8f182694dc43c48 (diff)
downloadlinux-d0a67c372df410b579197ea818596001fe20070d.tar.gz
linux-d0a67c372df410b579197ea818596001fe20070d.tar.bz2
linux-d0a67c372df410b579197ea818596001fe20070d.zip
rtc: rtc-nuc900: fix loop timeout test
We should change this post-op to a pre-op because we want the loop to exit with "timeout" set to zero. Fixes: 0a89b55364e0 ("nuc900/rtc: change the waiting for device ready implement") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-nuc900.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-nuc900.c b/drivers/rtc/rtc-nuc900.c
index b1b6b3041bfb..4ed81117cf5f 100644
--- a/drivers/rtc/rtc-nuc900.c
+++ b/drivers/rtc/rtc-nuc900.c
@@ -93,7 +93,7 @@ static int *check_rtc_access_enable(struct nuc900_rtc *nuc900_rtc)
__raw_writel(AERPOWERON, nuc900_rtc->rtc_reg + REG_RTC_AER);
while (!(__raw_readl(nuc900_rtc->rtc_reg + REG_RTC_AER) & AERRWENB)
- && timeout--)
+ && --timeout)
mdelay(1);
if (!timeout)