Linux clock framework development
 help / color / mirror / Atom feed
* [PATCH] clk: nuvoton: Manage MA35D1 mux clocks with the controller
@ 2026-11-26  8:26 Guangshuo Li
  2026-11-26  8:32 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Guangshuo Li @ 2026-11-26  8:26 UTC (permalink / raw)
  To: ychuang3, schung, sboyd, bmasney+clk, jbrunet+clk, arnd, krzk
  Cc: linux-arm-kernel, linux-clk

The MA35D1 muxes remain registered after the platform device releases
their register mapping. Use managed registration so both mux helpers
unregister their clocks before the registers are unmapped.

This issue was found by our static analysis tool under development.

Fixes: 691521a367cf ("clk: nuvoton: Add clock driver for ma35d1 clock controller")
Signed-off-by: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
---
 drivers/clk/nuvoton/clk-ma35d1.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/nuvoton/clk-ma35d1.c b/drivers/clk/nuvoton/clk-ma35d1.c
index e95f72bb8103..4428556b64ad 100644
--- a/drivers/clk/nuvoton/clk-ma35d1.c
+++ b/drivers/clk/nuvoton/clk-ma35d1.c
@@ -380,9 +380,9 @@ static struct clk_hw *ma35d1_clk_mux_parent(struct device *dev, const char *name
 					    const struct clk_parent_data *pdata,
 					    int num_pdata)
 {
-	return clk_hw_register_mux_parent_data(dev, name, pdata, num_pdata,
-					       CLK_SET_RATE_NO_REPARENT, reg, shift,
-					       width, 0, &ma35d1_lock);
+	return devm_clk_hw_register_mux_parent_data_table(dev, name, pdata, num_pdata,
+							  CLK_SET_RATE_NO_REPARENT, reg, shift,
+							  width, 0, NULL, &ma35d1_lock);
 }
 
 static struct clk_hw *ma35d1_clk_mux(struct device *dev, const char *name,
@@ -390,9 +390,9 @@ static struct clk_hw *ma35d1_clk_mux(struct device *dev, const char *name,
 				     const struct clk_parent_data *pdata,
 				     int num_pdata)
 {
-	return clk_hw_register_mux_parent_data(dev, name, pdata, num_pdata,
-					       CLK_SET_RATE_NO_REPARENT, reg, shift,
-					       width, 0, &ma35d1_lock);
+	return devm_clk_hw_register_mux_parent_data_table(dev, name, pdata, num_pdata,
+							  CLK_SET_RATE_NO_REPARENT, reg, shift,
+							  width, 0, NULL, &ma35d1_lock);
 }
 
 static struct clk_hw *ma35d1_clk_divider(struct device *dev, const char *name,

base-commit: 4dce97c6c265544342e716e62fd24bbb232590c5
-- 
2.43.0


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

end of thread, other threads:[~2026-11-26  8:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26  8:26 [PATCH] clk: nuvoton: Manage MA35D1 mux clocks with the controller Guangshuo Li
2026-11-26  8:32 ` sashiko-bot

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