* [PATCH] rtc: pm8xxx: switch to devm_device_init_wakeup
@ 2025-03-17 11:13 alexandre.belloni
2025-03-17 11:58 ` Johan Hovold
0 siblings, 1 reply; 3+ messages in thread
From: alexandre.belloni @ 2025-03-17 11:13 UTC (permalink / raw)
To: Johan Hovold, Alexandre Belloni; +Cc: linux-arm-msm, linux-rtc, linux-kernel
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
Switch to devm_device_init_wakeup to avoid a possible memory leak as wakeup
is never disabled.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
drivers/rtc/rtc-pm8xxx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-pm8xxx.c b/drivers/rtc/rtc-pm8xxx.c
index c6241a0c26e9..70cbac76147b 100644
--- a/drivers/rtc/rtc-pm8xxx.c
+++ b/drivers/rtc/rtc-pm8xxx.c
@@ -647,7 +647,7 @@ static int pm8xxx_rtc_probe(struct platform_device *pdev)
if (rc)
return rc;
- device_init_wakeup(&pdev->dev, true);
+ devm_device_init_wakeup(&pdev->dev);
} else {
clear_bit(RTC_FEATURE_ALARM, rtc_dd->rtc->features);
}
--
2.48.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] rtc: pm8xxx: switch to devm_device_init_wakeup
2025-03-17 11:13 [PATCH] rtc: pm8xxx: switch to devm_device_init_wakeup alexandre.belloni
@ 2025-03-17 11:58 ` Johan Hovold
2025-03-17 13:34 ` Alexandre Belloni
0 siblings, 1 reply; 3+ messages in thread
From: Johan Hovold @ 2025-03-17 11:58 UTC (permalink / raw)
To: alexandre.belloni; +Cc: Johan Hovold, linux-arm-msm, linux-rtc, linux-kernel
On Mon, Mar 17, 2025 at 12:13:11PM +0100, alexandre.belloni@bootlin.com wrote:
> From: Alexandre Belloni <alexandre.belloni@bootlin.com>
>
> Switch to devm_device_init_wakeup to avoid a possible memory leak as wakeup
> is never disabled.
You should probably mention that this was due to a bad merge. The
no-alarm patch moved the previous call to device_init_wakeup() into the
conditional, but you had switched it to use devres so we ended up with
two calls when you applied the patch.
Unless you want to and can rebase your tree.
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> ---
> drivers/rtc/rtc-pm8xxx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/rtc/rtc-pm8xxx.c b/drivers/rtc/rtc-pm8xxx.c
> index c6241a0c26e9..70cbac76147b 100644
> --- a/drivers/rtc/rtc-pm8xxx.c
> +++ b/drivers/rtc/rtc-pm8xxx.c
> @@ -647,7 +647,7 @@ static int pm8xxx_rtc_probe(struct platform_device *pdev)
> if (rc)
> return rc;
>
> - device_init_wakeup(&pdev->dev, true);
> + devm_device_init_wakeup(&pdev->dev);
So you need to remove the call to devm_device_init_wakeup() above as
well (after platform_set_drvdata()) which the no-alarm patch moved here.
With that fixed:
Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
> } else {
> clear_bit(RTC_FEATURE_ALARM, rtc_dd->rtc->features);
> }
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] rtc: pm8xxx: switch to devm_device_init_wakeup
2025-03-17 11:58 ` Johan Hovold
@ 2025-03-17 13:34 ` Alexandre Belloni
0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2025-03-17 13:34 UTC (permalink / raw)
To: Johan Hovold; +Cc: Johan Hovold, linux-arm-msm, linux-rtc, linux-kernel
On 17/03/2025 12:58:07+0100, Johan Hovold wrote:
> On Mon, Mar 17, 2025 at 12:13:11PM +0100, alexandre.belloni@bootlin.com wrote:
> > From: Alexandre Belloni <alexandre.belloni@bootlin.com>
> >
> > Switch to devm_device_init_wakeup to avoid a possible memory leak as wakeup
> > is never disabled.
>
> You should probably mention that this was due to a bad merge. The
> no-alarm patch moved the previous call to device_init_wakeup() into the
> conditional, but you had switched it to use devres so we ended up with
> two calls when you applied the patch.
>
> Unless you want to and can rebase your tree.
>
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> > ---
> > drivers/rtc/rtc-pm8xxx.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/rtc/rtc-pm8xxx.c b/drivers/rtc/rtc-pm8xxx.c
> > index c6241a0c26e9..70cbac76147b 100644
> > --- a/drivers/rtc/rtc-pm8xxx.c
> > +++ b/drivers/rtc/rtc-pm8xxx.c
> > @@ -647,7 +647,7 @@ static int pm8xxx_rtc_probe(struct platform_device *pdev)
> > if (rc)
> > return rc;
> >
> > - device_init_wakeup(&pdev->dev, true);
> > + devm_device_init_wakeup(&pdev->dev);
>
> So you need to remove the call to devm_device_init_wakeup() above as
> well (after platform_set_drvdata()) which the no-alarm patch moved here.
>
> With that fixed:
>
> Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
Right, I fixed my merge instead, thanks!
>
> > } else {
> > clear_bit(RTC_FEATURE_ALARM, rtc_dd->rtc->features);
> > }
>
> Johan
>
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-17 13:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-17 11:13 [PATCH] rtc: pm8xxx: switch to devm_device_init_wakeup alexandre.belloni
2025-03-17 11:58 ` Johan Hovold
2025-03-17 13:34 ` Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox