summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-mc146818-lib.c
diff options
context:
space:
mode:
authorMateusz Jończyk <mat.jonczyk@o2.pl>2021-12-10 21:01:29 +0100
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2021-12-16 21:50:06 +0100
commit2c7d47a45b06be3d0a7aa21c3dea2215685a928f (patch)
tree6d70f5ff7219283772f6989258e662ff7b7e4954 /drivers/rtc/rtc-mc146818-lib.c
parent2a61b0ac5493363149f68a2fb80287f314626987 (diff)
downloadlinux-next-2c7d47a45b06be3d0a7aa21c3dea2215685a928f.tar.gz
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 <mat.jonczyk@o2.pl> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20211210200131.153887-8-mat.jonczyk@o2.pl
Diffstat (limited to 'drivers/rtc/rtc-mc146818-lib.c')
-rw-r--r--drivers/rtc/rtc-mc146818-lib.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/drivers/rtc/rtc-mc146818-lib.c b/drivers/rtc/rtc-mc146818-lib.c
index 15604b7f164d..f62e658cbe23 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);