Skip to content

Commit 2c7d47a

Browse files
matjonalexandrebelloni
authored andcommitted
rtc: mc146818-lib: refactor mc146818_does_rtc_work
Refactor mc146818_does_rtc_work() so that it uses mc146818_avoid_UIP(). It is enough to call mc146818_avoid_UIP() with no callback. Signed-off-by: Mateusz Jończyk <[email protected]> Cc: Alessandro Zummo <[email protected]> Cc: Alexandre Belloni <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 2a61b0a commit 2c7d47a

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

drivers/rtc/rtc-mc146818-lib.c

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,22 +84,7 @@ EXPORT_SYMBOL_GPL(mc146818_avoid_UIP);
8484
*/
8585
bool mc146818_does_rtc_work(void)
8686
{
87-
int i;
88-
unsigned char val;
89-
unsigned long flags;
90-
91-
for (i = 0; i < 10; i++) {
92-
spin_lock_irqsave(&rtc_lock, flags);
93-
val = CMOS_READ(RTC_FREQ_SELECT);
94-
spin_unlock_irqrestore(&rtc_lock, flags);
95-
96-
if ((val & RTC_UIP) == 0)
97-
return true;
98-
99-
mdelay(1);
100-
}
101-
102-
return false;
87+
return mc146818_avoid_UIP(NULL, NULL);
10388
}
10489
EXPORT_SYMBOL_GPL(mc146818_does_rtc_work);
10590

0 commit comments

Comments
 (0)