[PATCH 07/12] rtc: fsl-ftm-alarm: clear the wake IRQ on unbind
Prasanth R
ragaprasanth at gmail.com
Tue Nov 24 23:20:21 PST 2026
From: Prasanth R <ragaprasanth at gmail.com>
The driver has no remove callback, so the wake IRQ set with
dev_pm_set_wake_irq() and the wakeup source enabled with
device_init_wakeup() are never released on unbind.
When the driver is bound again, dev_pm_set_wake_irq() finds the old wake
IRQ, warns "wake irq already initialized" and returns -EEXIST, so the
driver prints "failed to enable irq wake".
Use the device-managed variants so both are released on unbind.
Compile-tested only.
I used an AI assistant (Claude) to find this and write the change.
Fixes: 3a8ce46ce15a ("rtc: fsl-ftm-alarm: fix freeze(s2idle) failed to wake")
Signed-off-by: Prasanth R <prasanth.r at lineo.co.jp>
---
drivers/rtc/rtc-fsl-ftm-alarm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-fsl-ftm-alarm.c b/drivers/rtc/rtc-fsl-ftm-alarm.c
index 5473f697d..565fd0df6 100644
--- a/drivers/rtc/rtc-fsl-ftm-alarm.c
+++ b/drivers/rtc/rtc-fsl-ftm-alarm.c
@@ -281,8 +281,8 @@ static int ftm_rtc_probe(struct platform_device *pdev)
rtc->alarm_freq = (u32)FIXED_FREQ_CLK / (u32)MAX_FREQ_DIV;
rtc->rtc_dev->ops = &ftm_rtc_ops;
- device_init_wakeup(&pdev->dev, true);
- ret = dev_pm_set_wake_irq(&pdev->dev, irq);
+ devm_device_init_wakeup(&pdev->dev);
+ ret = devm_pm_set_wake_irq(&pdev->dev, irq);
if (ret)
dev_err(&pdev->dev, "failed to enable irq wake\n");
--
2.43.0
More information about the linux-arm-kernel
mailing list