mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 16:49:22 +00:00
rtc: st-lpc: Add missing clk_disable_unprepare in st_rtc_probe()
[ Upstream commit5fb733d7bd
] The clk_disable_unprepare() should be called in the error handling of clk_get_rate(), fix it. Fixes:b5b2bdfc28
("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>
This commit is contained in:
parent
8e65e70764
commit
34836c5923
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue