Skip to content

Commit e92eda9

Browse files
geertualexandrebelloni
authored andcommitted
rtc: sh: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
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>
1 parent 0c6f0d7 commit e92eda9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/rtc/rtc-sh.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ static void __exit sh_rtc_remove(struct platform_device *pdev)
455455
clk_disable(rtc->clk);
456456
}
457457

458-
static int __maybe_unused sh_rtc_suspend(struct device *dev)
458+
static int sh_rtc_suspend(struct device *dev)
459459
{
460460
struct sh_rtc *rtc = dev_get_drvdata(dev);
461461

@@ -465,7 +465,7 @@ static int __maybe_unused sh_rtc_suspend(struct device *dev)
465465
return 0;
466466
}
467467

468-
static int __maybe_unused sh_rtc_resume(struct device *dev)
468+
static int sh_rtc_resume(struct device *dev)
469469
{
470470
struct sh_rtc *rtc = dev_get_drvdata(dev);
471471

@@ -475,7 +475,7 @@ static int __maybe_unused sh_rtc_resume(struct device *dev)
475475
return 0;
476476
}
477477

478-
static SIMPLE_DEV_PM_OPS(sh_rtc_pm_ops, sh_rtc_suspend, sh_rtc_resume);
478+
static DEFINE_SIMPLE_DEV_PM_OPS(sh_rtc_pm_ops, sh_rtc_suspend, sh_rtc_resume);
479479

480480
static const struct of_device_id sh_rtc_of_match[] = {
481481
{ .compatible = "renesas,sh-rtc", },
@@ -492,7 +492,7 @@ MODULE_DEVICE_TABLE(of, sh_rtc_of_match);
492492
static struct platform_driver sh_rtc_platform_driver __refdata = {
493493
.driver = {
494494
.name = DRV_NAME,
495-
.pm = &sh_rtc_pm_ops,
495+
.pm = pm_sleep_ptr(&sh_rtc_pm_ops),
496496
.of_match_table = sh_rtc_of_match,
497497
},
498498
.remove = __exit_p(sh_rtc_remove),

0 commit comments

Comments
 (0)