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

The clk_disable_unprepare() 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>
---
v2:
- Update the commit message, thanks!
 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2] rtc: st-lpc: Add missing clk_disable_unprepare in st_rtc_probe()
  2022-11-23  1:48 [PATCH v2] rtc: st-lpc: Add missing clk_disable_unprepare in st_rtc_probe() Gaosheng Cui
@ 2022-12-10 21:38 ` Alexandre Belloni
  2022-12-10 21:38   ` Alexandre Belloni
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Belloni @ 2022-12-10 21:38 UTC (permalink / raw)
  To: Gaosheng Cui, patrice.chotard, a.zummo, lee.jones
  Cc: linux-rtc, linux-arm-kernel

On Wed, 23 Nov 2022 09:48:05 +0800, Gaosheng Cui wrote:
> The clk_disable_unprepare() should be called in the error handling
> of clk_get_rate(), fix it.
> 
> 

Applied, thanks!

[1/1] rtc: st-lpc: Add missing clk_disable_unprepare in st_rtc_probe()
      commit: 5fb733d7bd6949e90028efdce8bd528c6ab7cf1e

Best regards,

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

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

On Wed, 23 Nov 2022 09:48:05 +0800, Gaosheng Cui wrote:
> The clk_disable_unprepare() should be called in the error handling
> of clk_get_rate(), fix it.
> 
> 

Applied, thanks!

[1/1] rtc: st-lpc: Add missing clk_disable_unprepare in st_rtc_probe()
      commit: 5fb733d7bd6949e90028efdce8bd528c6ab7cf1e

Best regards,

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-12-10 21:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-23  1:48 [PATCH v2] rtc: st-lpc: Add missing clk_disable_unprepare in st_rtc_probe() Gaosheng Cui
2022-12-10 21:38 ` Alexandre Belloni
2022-12-10 21:38   ` 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).