[PATCH 04/12] rtc: mxc_v2: clear the wake IRQ on unbind

Frank Li Frank.li at oss.nxp.com
Wed Nov 25 13:52:10 PST 2026


On Wed, Nov 25, 2026 at 04:20:18PM +0900, Prasanth R wrote:
> [You don't often get email from ragaprasanth at gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> From: Prasanth R <ragaprasanth at gmail.com>
>
> mxc_rtc_remove() and the probe error paths do not release the wake IRQ
> set with dev_pm_set_wake_irq() or the wakeup source enabled with
> device_init_wakeup().
>
> 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.

Needn't it at commit message, you can move it after --- to tell maintainer
you use AI help.

>
> Fixes: fbc5ee9a6955 ("rtc: mxc_v2: use dev_pm_set_wake_irq() to simplify code")
> Signed-off-by: Prasanth R <prasanth.r at lineo.co.jp>
> ---
>  drivers/rtc/rtc-mxc_v2.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/rtc/rtc-mxc_v2.c b/drivers/rtc/rtc-mxc_v2.c
> index 35a18b75c..fe3a55b00 100644
> --- a/drivers/rtc/rtc-mxc_v2.c
> +++ b/drivers/rtc/rtc-mxc_v2.c
> @@ -301,8 +301,8 @@ static int mxc_rtc_probe(struct platform_device *pdev)
>         if (pdata->irq < 0)
>                 return pdata->irq;
>
> -       device_init_wakeup(&pdev->dev, true);
> -       ret = dev_pm_set_wake_irq(&pdev->dev, pdata->irq);
> +       devm_device_init_wakeup(&pdev->dev);

all devm_*() API need check return value.

Frank

> +       ret = devm_pm_set_wake_irq(&pdev->dev, pdata->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