Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Geert Uytterhoeven and committed by
Alexandre Belloni
e92eda97 0c6f0d77

+4 -4
+4 -4
drivers/rtc/rtc-sh.c
··· 455 455 clk_disable(rtc->clk); 456 456 } 457 457 458 - static int __maybe_unused sh_rtc_suspend(struct device *dev) 458 + static int sh_rtc_suspend(struct device *dev) 459 459 { 460 460 struct sh_rtc *rtc = dev_get_drvdata(dev); 461 461 ··· 465 465 return 0; 466 466 } 467 467 468 - static int __maybe_unused sh_rtc_resume(struct device *dev) 468 + static int sh_rtc_resume(struct device *dev) 469 469 { 470 470 struct sh_rtc *rtc = dev_get_drvdata(dev); 471 471 ··· 475 475 return 0; 476 476 } 477 477 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); 479 479 480 480 static const struct of_device_id sh_rtc_of_match[] = { 481 481 { .compatible = "renesas,sh-rtc", }, ··· 492 492 static struct platform_driver sh_rtc_platform_driver __refdata = { 493 493 .driver = { 494 494 .name = DRV_NAME, 495 - .pm = &sh_rtc_pm_ops, 495 + .pm = pm_sleep_ptr(&sh_rtc_pm_ops), 496 496 .of_match_table = sh_rtc_of_match, 497 497 }, 498 498 .remove = __exit_p(sh_rtc_remove),