rtc: st-lpc: Use IRQF_NO_AUTOEN flag in request_irq()
[ Upstream commit b6cd7adec0cf03f0aefc55676e71dd721cbc71a8 ] 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: b5b2bdfc2893 ("rtc: st: Add new driver for ST's LPC RTC") Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Link: https://lore.kernel.org/r/20240912033727.3013951-1-ruanjinjie@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
bebeed876f
commit
4bf42f2715
1 changed files with 2 additions and 3 deletions
|
@ -218,15 +218,14 @@ static int st_rtc_probe(struct platform_device *pdev)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = devm_request_irq(&pdev->dev, rtc->irq, st_rtc_handler, 0,
|
ret = devm_request_irq(&pdev->dev, rtc->irq, st_rtc_handler,
|
||||||
pdev->name, rtc);
|
IRQF_NO_AUTOEN, pdev->name, rtc);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(&pdev->dev, "Failed to request irq %i\n", rtc->irq);
|
dev_err(&pdev->dev, "Failed to request irq %i\n", rtc->irq);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
enable_irq_wake(rtc->irq);
|
enable_irq_wake(rtc->irq);
|
||||||
disable_irq(rtc->irq);
|
|
||||||
|
|
||||||
rtc->clk = devm_clk_get(&pdev->dev, NULL);
|
rtc->clk = devm_clk_get(&pdev->dev, NULL);
|
||||||
if (IS_ERR(rtc->clk)) {
|
if (IS_ERR(rtc->clk)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue