Commit c7a639da authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Alexandre Belloni

rtc: jz4740: Make sure clock provider gets removed

The jz4740 RTC driver registers a clock provider, but never removes it.
This leaves a stale clock provider behind that references freed clocks when
the device is unbound.

Use the managed `devm_of_clk_add_hw_provider()` instead of
`of_clk_add_hw_provider()` to make sure the provider gets automatically
removed on unbind.

Fixes: 5ddfa148 ("rtc: jz4740: Register clock provider for the CLK32K pin")
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20230409162544.16155-1-lars@metafoo.deSigned-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent d31d7300
......@@ -414,7 +414,8 @@ static int jz4740_rtc_probe(struct platform_device *pdev)
return dev_err_probe(dev, ret,
"Unable to register clk32k clock\n");
ret = of_clk_add_hw_provider(np, of_clk_hw_simple_get, &rtc->clk32k);
ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get,
&rtc->clk32k);
if (ret)
return dev_err_probe(dev, ret,
"Unable to register clk32k clock provider\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment