[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220107124934.159878-8-mat.jonczyk@o2.pl>
Date: Fri, 7 Jan 2022 13:49:32 +0100
From: Mateusz Jończyk <mat.jonczyk@...pl>
To: linux-rtc@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Mateusz Jończyk <mat.jonczyk@...pl>,
Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>
Subject: [PATCH v5 7/9] 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@...pl>
Cc: Alessandro Zummo <a.zummo@...ertech.it>
Cc: Alexandre Belloni <alexandre.belloni@...tlin.com>
---
v4: fixed a mistake in the patch description.
drivers/rtc/rtc-mc146818-lib.c | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/drivers/rtc/rtc-mc146818-lib.c b/drivers/rtc/rtc-mc146818-lib.c
index 34a1ed61a4f9..75dfad22b31a 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 < 20; 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);
--
2.25.1
Powered by blists - more mailing lists