[PATCH 09/12] rtc: atcrtc100: clear the wake IRQ on unbind
Prasanth R
ragaprasanth at gmail.com
Tue Nov 24 23:20:23 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 probe
fails with "Failed to set wake IRQ" and the RTC cannot be bound again.
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: 7adca706fe16 ("rtc: atcrtc100: Add ATCRTC100 RTC driver")
Signed-off-by: Prasanth R <prasanth.r at lineo.co.jp>
---
drivers/rtc/rtc-atcrtc100.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/rtc/rtc-atcrtc100.c b/drivers/rtc/rtc-atcrtc100.c
index 25183331a..2c78192db 100644
--- a/drivers/rtc/rtc-atcrtc100.c
+++ b/drivers/rtc/rtc-atcrtc100.c
@@ -318,17 +318,15 @@ static int atcrtc_probe(struct platform_device *pdev)
"Failed to allocate RTC device\n");
set_bit(RTC_FEATURE_ALARM, atcrtc_dev->rtc_dev->features);
- ret = device_init_wakeup(&pdev->dev, true);
+ ret = devm_device_init_wakeup(&pdev->dev);
if (ret)
return dev_err_probe(&pdev->dev, ret,
"Failed to initialize wake capability\n");
- ret = dev_pm_set_wake_irq(&pdev->dev, atcrtc_dev->alarm_irq);
- if (ret) {
- device_init_wakeup(&pdev->dev, false);
+ ret = devm_pm_set_wake_irq(&pdev->dev, atcrtc_dev->alarm_irq);
+ if (ret)
return dev_err_probe(&pdev->dev, ret,
"Failed to set wake IRQ\n");
- }
atcrtc_dev->rtc_dev->ops = &rtc_ops;
--
2.43.0
More information about the linux-arm-kernel
mailing list