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

mmc: sh_mmicf: use modern PM macros

Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

This has the advantage of always compiling these functions in,
independently of any Kconfig option. Thanks to that, bugs and other
regressions are subsequently easier to catch.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Link: https://lore.kernel.org/r/20250815013413.28641-30-jszhang@kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Jisheng Zhang and committed by
Ulf Hansson
b2af65ae 7aa59bfe

+2 -6
+2 -6
drivers/mmc/host/sh_mmcif.c
··· 1568 1568 pm_runtime_disable(&pdev->dev); 1569 1569 } 1570 1570 1571 - #ifdef CONFIG_PM_SLEEP 1572 1571 static int sh_mmcif_suspend(struct device *dev) 1573 1572 { 1574 1573 struct sh_mmcif_host *host = dev_get_drvdata(dev); ··· 1583 1584 { 1584 1585 return 0; 1585 1586 } 1586 - #endif 1587 1587 1588 - static const struct dev_pm_ops sh_mmcif_dev_pm_ops = { 1589 - SET_SYSTEM_SLEEP_PM_OPS(sh_mmcif_suspend, sh_mmcif_resume) 1590 - }; 1588 + static DEFINE_SIMPLE_DEV_PM_OPS(sh_mmcif_dev_pm_ops, sh_mmcif_suspend, sh_mmcif_resume); 1591 1589 1592 1590 static struct platform_driver sh_mmcif_driver = { 1593 1591 .probe = sh_mmcif_probe, ··· 1592 1596 .driver = { 1593 1597 .name = DRIVER_NAME, 1594 1598 .probe_type = PROBE_PREFER_ASYNCHRONOUS, 1595 - .pm = &sh_mmcif_dev_pm_ops, 1599 + .pm = pm_sleep_ptr(&sh_mmcif_dev_pm_ops), 1596 1600 .of_match_table = sh_mmcif_of_match, 1597 1601 }, 1598 1602 };