linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtc: st-lpc: Add missing clk_disable_unprepare in st_rtc_probe()
@ 2022-11-22 12:19 Gaosheng Cui
  2022-11-22 13:45 ` Alexandre Belloni
  0 siblings, 1 reply; 2+ messages in thread
From: Gaosheng Cui @ 2022-11-22 12:19 UTC (permalink / raw)
  To: patrice.chotard, a.zummo, alexandre.belloni, lee.jones,
	cuigaosheng1
  Cc: linux-arm-kernel, linux-rtc

The clk_get_rate() should be called in the error handling of
clk_get_rate(), fix it.

Fixes: b5b2bdfc2893 ("rtc: st: Add new driver for ST's LPC RTC")
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
---
 drivers/rtc/rtc-st-lpc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/rtc/rtc-st-lpc.c b/drivers/rtc/rtc-st-lpc.c
index bdb20f63254e..0f8e4231098e 100644
--- a/drivers/rtc/rtc-st-lpc.c
+++ b/drivers/rtc/rtc-st-lpc.c
@@ -238,6 +238,7 @@ static int st_rtc_probe(struct platform_device *pdev)
 
 	rtc->clkrate = clk_get_rate(rtc->clk);
 	if (!rtc->clkrate) {
+		clk_disable_unprepare(rtc->clk);
 		dev_err(&pdev->dev, "Unable to fetch clock rate\n");
 		return -EINVAL;
 	}
-- 
2.25.1


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

* Re: [PATCH] rtc: st-lpc: Add missing clk_disable_unprepare in st_rtc_probe()
  2022-11-22 12:19 [PATCH] rtc: st-lpc: Add missing clk_disable_unprepare in st_rtc_probe() Gaosheng Cui
@ 2022-11-22 13:45 ` Alexandre Belloni
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2022-11-22 13:45 UTC (permalink / raw)
  To: Gaosheng Cui
  Cc: patrice.chotard, a.zummo, lee.jones, linux-arm-kernel, linux-rtc

On 22/11/2022 20:19:07+0800, Gaosheng Cui wrote:
> The clk_get_rate() should be called in the error handling of
> clk_get_rate(), fix it.
> 

This is not what the patch does

> Fixes: b5b2bdfc2893 ("rtc: st: Add new driver for ST's LPC RTC")
> Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
> ---
>  drivers/rtc/rtc-st-lpc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/rtc/rtc-st-lpc.c b/drivers/rtc/rtc-st-lpc.c
> index bdb20f63254e..0f8e4231098e 100644
> --- a/drivers/rtc/rtc-st-lpc.c
> +++ b/drivers/rtc/rtc-st-lpc.c
> @@ -238,6 +238,7 @@ static int st_rtc_probe(struct platform_device *pdev)
>  
>  	rtc->clkrate = clk_get_rate(rtc->clk);
>  	if (!rtc->clkrate) {
> +		clk_disable_unprepare(rtc->clk);
>  		dev_err(&pdev->dev, "Unable to fetch clock rate\n");
>  		return -EINVAL;
>  	}
> -- 
> 2.25.1
> 

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2022-11-22 13:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-22 12:19 [PATCH] rtc: st-lpc: Add missing clk_disable_unprepare in st_rtc_probe() Gaosheng Cui
2022-11-22 13:45 ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).