mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] rtc: rtc-pic32: handle clock enable failure
@ 2026-08-18 13:10 Jiawen Liu
  2026-08-20  9:35 ` Markus Elfring
  0 siblings, 1 reply; 4+ messages in thread
From: Jiawen Liu @ 2026-08-18 13:10 UTC (permalink / raw)
  To: linux-kernel

Return error from failed clock enable.

Pic32 RTC ignores clk_prepare_enable return before hardware access and
later disables/unprepares clock same pic32 RTC unchecked
clk_prepare_enable.

Check early clk_prepare_enable(pdata->clk) return in pic32_rtc_probe.

Signed-off-by: jiawen <1298662399@qq.com>
---
diff --git a/drivers/rtc/rtc-pic32.c b/drivers/rtc/rtc-pic32.c
--- a/drivers/rtc/rtc-pic32.c
+++ b/drivers/rtc/rtc-pic32.c
@@ -325,7 +325,9 @@
 	if (IS_ERR(pdata->rtc))
 		return PTR_ERR(pdata->rtc);
 
-	clk_prepare_enable(pdata->clk);
+	ret = clk_prepare_enable(pdata->clk);
+	if (ret)
+		return ret;
 
 	pic32_rtc_enable(pdata, 1);
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-20 10:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-18 13:10 [PATCH] rtc: rtc-pic32: handle clock enable failure Jiawen Liu
2026-08-20  9:35 ` Markus Elfring
2026-08-20  9:39   ` Robert P. J. Day
2026-08-20 10:04     ` Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®