]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
rtc: sh: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 9 Jul 2025 18:47:52 +0000 (20:47 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 22 Jul 2025 10:59:22 +0000 (12:59 +0200)
Convert the Renesas SuperH On-Chip RTC driver from SIMPLE_DEV_PM_OPS()
to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr().  This lets us drop the
__maybe_unused annotations from its suspend and resume callbacks, and
reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/396d4a769b8d3c6fec43c65022cdfd8a6854524a.1752086758.git.geert+renesas@glider.be
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-sh.c

index f15ef3aa82a02d5d7a219edca0c6e4762c01f0ab..619800a004799cc26708f29857c920e3eb918870 100644 (file)
@@ -455,7 +455,7 @@ static void __exit sh_rtc_remove(struct platform_device *pdev)
        clk_disable(rtc->clk);
 }
 
-static int __maybe_unused sh_rtc_suspend(struct device *dev)
+static int sh_rtc_suspend(struct device *dev)
 {
        struct sh_rtc *rtc = dev_get_drvdata(dev);
 
@@ -465,7 +465,7 @@ static int __maybe_unused sh_rtc_suspend(struct device *dev)
        return 0;
 }
 
-static int __maybe_unused sh_rtc_resume(struct device *dev)
+static int sh_rtc_resume(struct device *dev)
 {
        struct sh_rtc *rtc = dev_get_drvdata(dev);
 
@@ -475,7 +475,7 @@ static int __maybe_unused sh_rtc_resume(struct device *dev)
        return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(sh_rtc_pm_ops, sh_rtc_suspend, sh_rtc_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(sh_rtc_pm_ops, sh_rtc_suspend, sh_rtc_resume);
 
 static const struct of_device_id sh_rtc_of_match[] = {
        { .compatible = "renesas,sh-rtc", },
@@ -492,7 +492,7 @@ MODULE_DEVICE_TABLE(of, sh_rtc_of_match);
 static struct platform_driver sh_rtc_platform_driver __refdata = {
        .driver         = {
                .name   = DRV_NAME,
-               .pm     = &sh_rtc_pm_ops,
+               .pm     = pm_sleep_ptr(&sh_rtc_pm_ops),
                .of_match_table = sh_rtc_of_match,
        },
        .remove         = __exit_p(sh_rtc_remove),