Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Dan Carpenter and committed by
Alexandre Belloni
d0a67c37 1d61d259

+1 -1
+1 -1
drivers/rtc/rtc-nuc900.c
··· 93 93 __raw_writel(AERPOWERON, nuc900_rtc->rtc_reg + REG_RTC_AER); 94 94 95 95 while (!(__raw_readl(nuc900_rtc->rtc_reg + REG_RTC_AER) & AERRWENB) 96 - && timeout--) 96 + && --timeout) 97 97 mdelay(1); 98 98 99 99 if (!timeout)