Skip to content

Commit 5fb733d

Browse files
gscuialexandrebelloni
authored andcommitted
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: b5b2bdf ("rtc: st: Add new driver for ST's LPC RTC") Signed-off-by: Gaosheng Cui <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent a6ceee2 commit 5fb733d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/rtc/rtc-st-lpc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ static int st_rtc_probe(struct platform_device *pdev)
238238

239239
rtc->clkrate = clk_get_rate(rtc->clk);
240240
if (!rtc->clkrate) {
241+
clk_disable_unprepare(rtc->clk);
241242
dev_err(&pdev->dev, "Unable to fetch clock rate\n");
242243
return -EINVAL;
243244
}

0 commit comments

Comments
 (0)