Skip to contentSkip to conversation

rtc: rtc-nuc900: fix loop timeout test

PATCH Applied Dan Carpenter 2 participants 2 messages Jun 23, 2017 – Jul 5, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
drivers/rtc/rtc-nuc900.c +1 -1
index b1b6b3041bfb..4ed81117cf5f 100644
@@ -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)
#1 lore raw
Quoted 6 lines · Dan Carpenter

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")

Applied, thanks.

Signature · 3 lines
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com