[PATCH 08/12] rtc: jz4740: clear the wake IRQ on unbind

Paul Cercueil paul at crapouillou.net
Wed Nov 25 06:38:45 PST 2026


Hi Prasanth,

Le mercredi 25 novembre 2026 à 16:20 +0900, Prasanth R a écrit :
> 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: 3b2dc19ff9a1 ("rtc: jz4740: use dev_pm_set_wake_irq() to simplify
> code")

Should probably Cc: stable at vger.kernel.org then.

> Signed-off-by: Prasanth R <prasanth.r at lineo.co.jp>

(Your family name is R?)

> ---
>  drivers/rtc/rtc-jz4740.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-jz4740.c b/drivers/rtc/rtc-jz4740.c
> index 32c331f3f..41501c9ed 100644
> --- a/drivers/rtc/rtc-jz4740.c
> +++ b/drivers/rtc/rtc-jz4740.c
> @@ -367,9 +367,9 @@ static int jz4740_rtc_probe(struct platform_device *pdev)
>  
>  	platform_set_drvdata(pdev, rtc);
>  
> -	device_init_wakeup(dev, true);
> +	devm_device_init_wakeup(dev);

I see devm_device_init_wakeup() can return an error, which should be handled.

Cheers,
-Paul

>  
> -	ret = dev_pm_set_wake_irq(dev, irq);
> +	ret = devm_pm_set_wake_irq(dev, irq);
>  	if (ret)
>  		return dev_err_probe(dev, ret, "Failed to set wake irq\n");
>  



More information about the linux-arm-kernel mailing list