DORMANTno replies

[PATCH] rtc: lpc24xx: fix clock disable order in remove

From: Jiawen Liu <hidden>
Date: 2026-08-18 12:41:41
Also in: lkml
Subsystem: arm/lpc18xx architecture, real time clock (rtc) subsystem, the rest · Maintainers: Vladimir Zapolskiy, Alexandre Belloni, Linus Torvalds

From: jiawen <redacted>

lpc24xx_rtc_probe enables clk_rtc before clk_reg, and its error path
disables clk_reg before clk_rtc. However, lpc24xx_rtc_remove disables
clk_rtc before clk_reg, which is the opposite order. This can leave a
clock prepared if probe fails after enabling both clocks, since remove
is not called on the error path.

Fix the remove function to disable clk_reg before clk_rtc, matching the
enable order and the error path cleanup order.

Signed-off-by: jiawen <redacted>
---
diff --git a/drivers/rtc/rtc-lpc24xx.c b/drivers/rtc/rtc-lpc24xx.c
--- a/drivers/rtc/rtc-lpc24xx.c
+++ b/drivers/rtc/rtc-lpc24xx.c
@@ -272,8 +272,8 @@
 
 	rtc_writel(rtc, LPC24XX_CCR, LPC178X_CCALEN);
 
+	clk_disable_unprepare(rtc->clk_reg);
 	clk_disable_unprepare(rtc->clk_rtc);
-	clk_disable_unprepare(rtc->clk_reg);
 }
 
 static const struct of_device_id lpc24xx_rtc_match[] = {

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help