]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
serial: sh-sci: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 9 Jul 2025 19:01:20 +0000 (21:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Jul 2025 09:05:33 +0000 (11:05 +0200)
Convert the Renesas SuperH SCI(F) serial port 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/a5628fe028362ae3f8729021a7864dd39f7869bf.1752086885.git.geert+renesas@glider.be
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sh-sci.c

index de161cfcc6787bdb95f37416b21daae303288622..538b2f991609fb93f510f38cdf05a29b88634c08 100644 (file)
@@ -3754,7 +3754,7 @@ static int sci_probe(struct platform_device *dev)
        return 0;
 }
 
-static __maybe_unused int sci_suspend(struct device *dev)
+static int sci_suspend(struct device *dev)
 {
        struct sci_port *sport = dev_get_drvdata(dev);
 
@@ -3772,7 +3772,7 @@ static __maybe_unused int sci_suspend(struct device *dev)
        return 0;
 }
 
-static __maybe_unused int sci_resume(struct device *dev)
+static int sci_resume(struct device *dev)
 {
        struct sci_port *sport = dev_get_drvdata(dev);
 
@@ -3793,14 +3793,14 @@ static __maybe_unused int sci_resume(struct device *dev)
        return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(sci_dev_pm_ops, sci_suspend, sci_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(sci_dev_pm_ops, sci_suspend, sci_resume);
 
 static struct platform_driver sci_driver = {
        .probe          = sci_probe,
        .remove         = sci_remove,
        .driver         = {
                .name   = "sh-sci",
-               .pm     = &sci_dev_pm_ops,
+               .pm     = pm_sleep_ptr(&sci_dev_pm_ops),
                .of_match_table = of_match_ptr(of_sci_match),
        },
 };