]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
rtc: mpfs: Use devm_pm_set_wake_irq
authorPeng Fan <peng.fan@nxp.com>
Wed, 5 Feb 2025 00:58:24 +0000 (08:58 +0800)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 3 Mar 2025 21:52:29 +0000 (22:52 +0100)
Use devm_pm_set_wake_irq, then the 'driver.remove()' could be cleaned up.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/20250205-rtc-cleanup-v1-6-66165678e089@nxp.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-mpfs.c

index 3892b0f9917fa7bc4f732cfe2c2b2f548ba7429f..5a38649cbd43b3c6f2fec5db95c4f0013deb2a08 100644 (file)
@@ -267,18 +267,13 @@ static int mpfs_rtc_probe(struct platform_device *pdev)
        dev_info(&pdev->dev, "prescaler set to: %lu\n", prescaler);
 
        device_init_wakeup(&pdev->dev, true);
-       ret = dev_pm_set_wake_irq(&pdev->dev, wakeup_irq);
+       ret = devm_pm_set_wake_irq(&pdev->dev, wakeup_irq);
        if (ret)
                dev_err(&pdev->dev, "failed to enable irq wake\n");
 
        return devm_rtc_register_device(rtcdev->rtc);
 }
 
-static void mpfs_rtc_remove(struct platform_device *pdev)
-{
-       dev_pm_clear_wake_irq(&pdev->dev);
-}
-
 static const struct of_device_id mpfs_rtc_of_match[] = {
        { .compatible = "microchip,mpfs-rtc" },
        { }
@@ -288,7 +283,6 @@ MODULE_DEVICE_TABLE(of, mpfs_rtc_of_match);
 
 static struct platform_driver mpfs_rtc_driver = {
        .probe = mpfs_rtc_probe,
-       .remove = mpfs_rtc_remove,
        .driver = {
                .name = "mpfs_rtc",
                .of_match_table = mpfs_rtc_of_match,