[PATCH 10/12] rtc: pcf8523: clear the wake IRQ on unbind

Prasanth R ragaprasanth at gmail.com
Tue Nov 24 23:20:24 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.

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: 13e37b7fb75d ("rtc: pcf8523: add alarm support")
Signed-off-by: Prasanth R <prasanth.r at lineo.co.jp>
---
 drivers/rtc/rtc-pcf8523.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-pcf8523.c b/drivers/rtc/rtc-pcf8523.c
index bbd42358a..df70a374e 100644
--- a/drivers/rtc/rtc-pcf8523.c
+++ b/drivers/rtc/rtc-pcf8523.c
@@ -484,12 +484,12 @@ static int pcf8523_probe(struct i2c_client *client)
 		if (err)
 			return err;
 
-		dev_pm_set_wake_irq(&client->dev, client->irq);
+		devm_pm_set_wake_irq(&client->dev, client->irq);
 	}
 
 	wakeup_source = of_property_read_bool(client->dev.of_node, "wakeup-source");
 	if (client->irq > 0 || wakeup_source)
-		device_init_wakeup(&client->dev, true);
+		devm_device_init_wakeup(&client->dev);
 
 	return devm_rtc_register_device(rtc);
 }
-- 
2.43.0




More information about the linux-arm-kernel mailing list