Commit 5fb733d7 authored by Gaosheng Cui's avatar Gaosheng Cui Committed by Alexandre Belloni

rtc: st-lpc: Add missing clk_disable_unprepare in st_rtc_probe()

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

Fixes: b5b2bdfc ("rtc: st: Add new driver for ST's LPC RTC")
Signed-off-by: default avatarGaosheng Cui <cuigaosheng1@huawei.com>
Link: https://lore.kernel.org/r/20221123014805.1993052-1-cuigaosheng1@huawei.comSigned-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent a6ceee26
...@@ -238,6 +238,7 @@ static int st_rtc_probe(struct platform_device *pdev) ...@@ -238,6 +238,7 @@ static int st_rtc_probe(struct platform_device *pdev)
rtc->clkrate = clk_get_rate(rtc->clk); rtc->clkrate = clk_get_rate(rtc->clk);
if (!rtc->clkrate) { if (!rtc->clkrate) {
clk_disable_unprepare(rtc->clk);
dev_err(&pdev->dev, "Unable to fetch clock rate\n"); dev_err(&pdev->dev, "Unable to fetch clock rate\n");
return -EINVAL; return -EINVAL;
} }
......
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