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

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

authored by

Jisheng Zhang and committed by
Ulf Hansson
69322320 02517359

+3 -7
+3 -7
drivers/mmc/host/sdhci-sprd.c
··· 903 903 }; 904 904 MODULE_DEVICE_TABLE(of, sdhci_sprd_of_match); 905 905 906 - #ifdef CONFIG_PM 907 906 static int sdhci_sprd_runtime_suspend(struct device *dev) 908 907 { 909 908 struct sdhci_host *host = dev_get_drvdata(dev); ··· 949 950 950 951 return ret; 951 952 } 952 - #endif 953 953 954 954 static const struct dev_pm_ops sdhci_sprd_pm_ops = { 955 - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, 956 - pm_runtime_force_resume) 957 - SET_RUNTIME_PM_OPS(sdhci_sprd_runtime_suspend, 958 - sdhci_sprd_runtime_resume, NULL) 955 + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) 956 + RUNTIME_PM_OPS(sdhci_sprd_runtime_suspend, sdhci_sprd_runtime_resume, NULL) 959 957 }; 960 958 961 959 static struct platform_driver sdhci_sprd_driver = { ··· 962 966 .name = "sdhci_sprd_r11", 963 967 .probe_type = PROBE_PREFER_ASYNCHRONOUS, 964 968 .of_match_table = sdhci_sprd_of_match, 965 - .pm = &sdhci_sprd_pm_ops, 969 + .pm = pm_ptr(&sdhci_sprd_pm_ops), 966 970 }, 967 971 }; 968 972 module_platform_driver(sdhci_sprd_driver);