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

mmc: omap_hsmmc: 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-14-jszhang@kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Jisheng Zhang and committed by
Ulf Hansson
8e8214d9 79565d5b

+4 -9
+4 -9
drivers/mmc/host/omap_hsmmc.c
··· 620 620 OMAP_HSMMC_WRITE(host->base, CON, con & ~OD); 621 621 } 622 622 623 - #ifdef CONFIG_PM 624 - 625 623 /* 626 624 * Restore the MMC host context, if it was lost as result of a 627 625 * power state change. ··· 687 689 return 0; 688 690 } 689 691 692 + #ifdef CONFIG_PM 690 693 /* 691 694 * Save the MMC host context (store the number of power state changes so far). 692 695 */ ··· 1989 1990 clk_disable_unprepare(host->dbclk); 1990 1991 } 1991 1992 1992 - #ifdef CONFIG_PM_SLEEP 1993 1993 static int omap_hsmmc_suspend(struct device *dev) 1994 1994 { 1995 1995 struct omap_hsmmc_host *host = dev_get_drvdata(dev); ··· 2030 2032 pm_runtime_put_autosuspend(host->dev); 2031 2033 return 0; 2032 2034 } 2033 - #endif 2034 2035 2035 - #ifdef CONFIG_PM 2036 2036 static int omap_hsmmc_runtime_suspend(struct device *dev) 2037 2037 { 2038 2038 struct omap_hsmmc_host *host; ··· 2098 2102 spin_unlock_irqrestore(&host->irq_lock, flags); 2099 2103 return 0; 2100 2104 } 2101 - #endif 2102 2105 2103 2106 static const struct dev_pm_ops omap_hsmmc_dev_pm_ops = { 2104 - SET_SYSTEM_SLEEP_PM_OPS(omap_hsmmc_suspend, omap_hsmmc_resume) 2105 - SET_RUNTIME_PM_OPS(omap_hsmmc_runtime_suspend, omap_hsmmc_runtime_resume, NULL) 2107 + SYSTEM_SLEEP_PM_OPS(omap_hsmmc_suspend, omap_hsmmc_resume) 2108 + RUNTIME_PM_OPS(omap_hsmmc_runtime_suspend, omap_hsmmc_runtime_resume, NULL) 2106 2109 }; 2107 2110 2108 2111 static struct platform_driver omap_hsmmc_driver = { ··· 2110 2115 .driver = { 2111 2116 .name = DRIVER_NAME, 2112 2117 .probe_type = PROBE_PREFER_ASYNCHRONOUS, 2113 - .pm = &omap_hsmmc_dev_pm_ops, 2118 + .pm = pm_ptr(&omap_hsmmc_dev_pm_ops), 2114 2119 .of_match_table = of_match_ptr(omap_mmc_of_match), 2115 2120 }, 2116 2121 };