From: Mateusz Jończyk Date: Fri, 10 Dec 2021 20:01:29 +0000 (+0100) Subject: rtc: mc146818-lib: refactor mc146818_does_rtc_work X-Git-Tag: v6.6.17~8345^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c7d47a45b06be3d0a7aa21c3dea2215685a928f;p=platform%2Fkernel%2Flinux-rpi.git 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 Cc: Alessandro Zummo Cc: Alexandre Belloni Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211210200131.153887-8-mat.jonczyk@o2.pl --- diff --git a/drivers/rtc/rtc-mc146818-lib.c b/drivers/rtc/rtc-mc146818-lib.c index 15604b7..f62e658 100644 --- a/drivers/rtc/rtc-mc146818-lib.c +++ b/drivers/rtc/rtc-mc146818-lib.c @@ -84,22 +84,7 @@ EXPORT_SYMBOL_GPL(mc146818_avoid_UIP); */ bool mc146818_does_rtc_work(void) { - int i; - unsigned char val; - unsigned long flags; - - for (i = 0; i < 10; i++) { - spin_lock_irqsave(&rtc_lock, flags); - val = CMOS_READ(RTC_FREQ_SELECT); - spin_unlock_irqrestore(&rtc_lock, flags); - - if ((val & RTC_UIP) == 0) - return true; - - mdelay(1); - } - - return false; + return mc146818_avoid_UIP(NULL, NULL); } EXPORT_SYMBOL_GPL(mc146818_does_rtc_work);