]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
rtc: rtc-nuc900: fix loop timeout test
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 23 Jun 2017 08:29:00 +0000 (11:29 +0300)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Thu, 6 Jul 2017 20:37:16 +0000 (22:37 +0200)
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>
drivers/rtc/rtc-nuc900.c

index b1b6b3041bfbc94eac0a478daabd7549bc891163..4ed81117cf5f346d663d11f0a799df4bd3801926 100644 (file)
@@ -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)