Commit 06c6e1b0 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Alexandre Belloni
Browse files

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: b5b2bdfc ("rtc: st: Add new driver for ST's LPC RTC")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/866af6adbc7454a7b4505eb6c28fbdc86ccff39e.1686251455.git.christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 38e0689b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -228,7 +228,7 @@ static int st_rtc_probe(struct platform_device *pdev)
	enable_irq_wake(rtc->irq);
	disable_irq(rtc->irq);

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