diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2023-04-09 09:25:44 -0700 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2023-04-28 08:07:23 +0200 |
commit | c7a639dac8e4d7e63450bef2f3a19fb331566fb1 (patch) | |
tree | 5bb1f66c098134a7bccd68f188078c5467f46f8f /drivers/rtc | |
parent | d31d7300ebc0c43021ec48c0e6a3a427386f4617 (diff) | |
download | linux-c7a639dac8e4d7e63450bef2f3a19fb331566fb1.tar.gz linux-c7a639dac8e4d7e63450bef2f3a19fb331566fb1.tar.bz2 linux-c7a639dac8e4d7e63450bef2f3a19fb331566fb1.zip |
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: 5ddfa148de8c ("rtc: jz4740: Register clock provider for the CLK32K pin")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20230409162544.16155-1-lars@metafoo.de
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-jz4740.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-jz4740.c b/drivers/rtc/rtc-jz4740.c index 59d279e3e6f5..36453b008139 100644 --- a/drivers/rtc/rtc-jz4740.c +++ b/drivers/rtc/rtc-jz4740.c @@ -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"); |