summaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorGaosheng Cui <cuigaosheng1@huawei.com>2022-11-23 09:48:05 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-12-31 13:14:37 +0100
commiteea105c4e4b6887f4652d8f4936a9a431e3f4516 (patch)
tree0eaac2475dd2853b1e0b934dbbfa704c50515b94 /drivers/rtc
parent74248b556006b38727ab517d8dfdde4f3f004c97 (diff)
downloadlinux-stable-eea105c4e4b6887f4652d8f4936a9a431e3f4516.tar.gz
linux-stable-eea105c4e4b6887f4652d8f4936a9a431e3f4516.tar.bz2
linux-stable-eea105c4e4b6887f4652d8f4936a9a431e3f4516.zip
rtc: st-lpc: Add missing clk_disable_unprepare in st_rtc_probe()
[ Upstream commit 5fb733d7bd6949e90028efdce8bd528c6ab7cf1e ] 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> Link: https://lore.kernel.org/r/20221123014805.1993052-1-cuigaosheng1@huawei.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-st-lpc.c1
1 files changed, 1 insertions, 0 deletions
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;
}