Skip to content

Commit 65acd0d

Browse files
geertugregkh
authored andcommitted
serial: sh-sci: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
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 <[email protected]> Link: https://lore.kernel.org/r/a5628fe028362ae3f8729021a7864dd39f7869bf.1752086885.git.geert+renesas@glider.be Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0666e3f commit 65acd0d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/tty/serial/sh-sci.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3754,7 +3754,7 @@ static int sci_probe(struct platform_device *dev)
37543754
return 0;
37553755
}
37563756

3757-
static __maybe_unused int sci_suspend(struct device *dev)
3757+
static int sci_suspend(struct device *dev)
37583758
{
37593759
struct sci_port *sport = dev_get_drvdata(dev);
37603760

@@ -3772,7 +3772,7 @@ static __maybe_unused int sci_suspend(struct device *dev)
37723772
return 0;
37733773
}
37743774

3775-
static __maybe_unused int sci_resume(struct device *dev)
3775+
static int sci_resume(struct device *dev)
37763776
{
37773777
struct sci_port *sport = dev_get_drvdata(dev);
37783778

@@ -3793,14 +3793,14 @@ static __maybe_unused int sci_resume(struct device *dev)
37933793
return 0;
37943794
}
37953795

3796-
static SIMPLE_DEV_PM_OPS(sci_dev_pm_ops, sci_suspend, sci_resume);
3796+
static DEFINE_SIMPLE_DEV_PM_OPS(sci_dev_pm_ops, sci_suspend, sci_resume);
37973797

37983798
static struct platform_driver sci_driver = {
37993799
.probe = sci_probe,
38003800
.remove = sci_remove,
38013801
.driver = {
38023802
.name = "sh-sci",
3803-
.pm = &sci_dev_pm_ops,
3803+
.pm = pm_sleep_ptr(&sci_dev_pm_ops),
38043804
.of_match_table = of_match_ptr(of_sci_match),
38053805
},
38063806
};

0 commit comments

Comments
 (0)