rtc: mpfs: switch to devm_device_init_wakeup
[email protected]
maintainerPATCH 1/3 rtc: mpfs: switch to devm_device_init_wakeup
From: Alexandre Belloni <[email protected]>
Switch to devm_device_init_wakeup to avoid a possible memory leak as wakeup is never disabled.
Signed-off-by Alexandre Belloni <[email protected]>
--- drivers/rtc/rtc-mpfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-mpfs.c +1 -1
@@ -266,7 +266,7 @@ static int mpfs_rtc_probe(struct platform_device *pdev)writel (prescaler, rtcdev->base +PRESCALER_REG );dev_info (&pdev->dev,"prescaler set to: %lu\n" , prescaler); -device_init_wakeup (&pdev->dev, true); +devm_device_init_wakeup (&pdev->dev); ret =devm_pm_set_wake_irq (&pdev->dev, wakeup_irq);if (ret)dev_err (&pdev->dev,"failed to enable irq wake\n" );
Signature · 1 line
2.48.1
[email protected]
maintainerPATCH 2/3 rtc: pm8xxx: fix possible race condition
From: Alexandre Belloni <[email protected]>
probe must not fail after devm_rtc_register_device is successful because the character device will be seen by userspace and may be opened right away. Call it last to avoid opening the race window.
Signed-off-by Alexandre Belloni <[email protected]>
--- drivers/rtc/rtc-pm8xxx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/rtc/rtc-pm8xxx.c +2 -2
@@ -519,11 +519,11 @@ static int pm8xxx_rtc_probe(struct platform_device *pdev)if (rc <0 )return rc; - rc =devm_rtc_register_device (rtc_dd->rtc); + rc =devm_pm_set_wake_irq (&pdev->dev, rtc_dd->alarm_irq);if (rc)return rc; -return devm_pm_set_wake_irq (&pdev->dev, rtc_dd->alarm_irq); +return devm_rtc_register_device (rtc_dd->rtc); }static struct platform_driver pm8xxx_rtc_driver = {
Signature · 1 line
2.48.1
[email protected]
maintainerPATCH 3/3 rtc: pm8xxx: switch to devm_device_init_wakeup
In reply to [email protected]From: Alexandre Belloni <[email protected]>
Switch to devm_device_init_wakeup to avoid a possible memory leak as wakeup is never disabled.
Signed-off-by Alexandre Belloni <[email protected]>
--- drivers/rtc/rtc-pm8xxx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-pm8xxx.c +1 -1
@@ -503,7 +503,7 @@ static int pm8xxx_rtc_probe(struct platform_device *pdev)platform_set_drvdata (pdev, rtc_dd); -device_init_wakeup (&pdev->dev, true); +devm_device_init_wakeup (&pdev->dev); rtc_dd->rtc =devm_rtc_allocate_device (&pdev->dev);if (IS_ERR (rtc_dd->rtc))
Signature · 1 line
2.48.1