Skip to content

Commit 06c6e1b

Browse files
tititiou36alexandrebelloni
authored andcommitted
rtc: st-lpc: Release some resources in st_rtc_probe() in case of error
If an error occurs after clk_get(), the corresponding resources should be released. Use devm_clk_get() to fix it. Fixes: b5b2bdf ("rtc: st: Add new driver for ST's LPC RTC") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/866af6adbc7454a7b4505eb6c28fbdc86ccff39e.1686251455.git.christophe.jaillet@wanadoo.fr Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 38e0689 commit 06c6e1b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/rtc/rtc-st-lpc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ static int st_rtc_probe(struct platform_device *pdev)
228228
enable_irq_wake(rtc->irq);
229229
disable_irq(rtc->irq);
230230

231-
rtc->clk = clk_get(&pdev->dev, NULL);
231+
rtc->clk = devm_clk_get(&pdev->dev, NULL);
232232
if (IS_ERR(rtc->clk)) {
233233
dev_err(&pdev->dev, "Unable to request clock\n");
234234
return PTR_ERR(rtc->clk);

0 commit comments

Comments
 (0)