Skip to content

Commit b6cd7ad

Browse files
Jinjie Ruanalexandrebelloni
authored andcommitted
rtc: st-lpc: Use IRQF_NO_AUTOEN flag in request_irq()
If request_irq() fails in st_rtc_probe(), there is no need to enable the irq, and if it succeeds, disable_irq() after request_irq() still has a time gap in which interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will disable IRQ auto-enable when request IRQ. Fixes: b5b2bdf ("rtc: st: Add new driver for ST's LPC RTC") Signed-off-by: Jinjie Ruan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 5127135 commit b6cd7ad

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/rtc/rtc-st-lpc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,15 +218,14 @@ static int st_rtc_probe(struct platform_device *pdev)
218218
return -EINVAL;
219219
}
220220

221-
ret = devm_request_irq(&pdev->dev, rtc->irq, st_rtc_handler, 0,
222-
pdev->name, rtc);
221+
ret = devm_request_irq(&pdev->dev, rtc->irq, st_rtc_handler,
222+
IRQF_NO_AUTOEN, pdev->name, rtc);
223223
if (ret) {
224224
dev_err(&pdev->dev, "Failed to request irq %i\n", rtc->irq);
225225
return ret;
226226
}
227227

228228
enable_irq_wake(rtc->irq);
229-
disable_irq(rtc->irq);
230229

231230
rtc->clk = devm_clk_get_enabled(&pdev->dev, NULL);
232231
if (IS_ERR(rtc->clk))

0 commit comments

Comments
 (0)