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

mmc: sdhci-esdhc-imx: 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>
Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
Link: https://lore.kernel.org/r/20250815013413.28641-19-jszhang@kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Jisheng Zhang and committed by
Ulf Hansson
1072eaf1 1e4f1d8c

+3 -10
+3 -10
drivers/mmc/host/sdhci-esdhc-imx.c
··· 1650 1650 } 1651 1651 } 1652 1652 1653 - #ifdef CONFIG_PM_SLEEP 1654 1653 static void sdhc_esdhc_tuning_save(struct sdhci_host *host) 1655 1654 { 1656 1655 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); ··· 1706 1707 host->ioaddr + ESDHC_TUNE_CTRL_STATUS); 1707 1708 } 1708 1709 } 1709 - #endif 1710 1710 1711 1711 static void esdhc_cqe_enable(struct mmc_host *mmc) 1712 1712 { ··· 2014 2016 cpu_latency_qos_remove_request(&imx_data->pm_qos_req); 2015 2017 } 2016 2018 2017 - #ifdef CONFIG_PM_SLEEP 2018 2019 static int sdhci_esdhc_suspend(struct device *dev) 2019 2020 { 2020 2021 struct sdhci_host *host = dev_get_drvdata(dev); ··· 2109 2112 2110 2113 return ret; 2111 2114 } 2112 - #endif 2113 2115 2114 - #ifdef CONFIG_PM 2115 2116 static int sdhci_esdhc_runtime_suspend(struct device *dev) 2116 2117 { 2117 2118 struct sdhci_host *host = dev_get_drvdata(dev); ··· 2183 2188 cpu_latency_qos_remove_request(&imx_data->pm_qos_req); 2184 2189 return err; 2185 2190 } 2186 - #endif 2187 2191 2188 2192 static const struct dev_pm_ops sdhci_esdhc_pmops = { 2189 - SET_SYSTEM_SLEEP_PM_OPS(sdhci_esdhc_suspend, sdhci_esdhc_resume) 2190 - SET_RUNTIME_PM_OPS(sdhci_esdhc_runtime_suspend, 2191 - sdhci_esdhc_runtime_resume, NULL) 2193 + SYSTEM_SLEEP_PM_OPS(sdhci_esdhc_suspend, sdhci_esdhc_resume) 2194 + RUNTIME_PM_OPS(sdhci_esdhc_runtime_suspend, sdhci_esdhc_runtime_resume, NULL) 2192 2195 }; 2193 2196 2194 2197 static struct platform_driver sdhci_esdhc_imx_driver = { ··· 2194 2201 .name = "sdhci-esdhc-imx", 2195 2202 .probe_type = PROBE_PREFER_ASYNCHRONOUS, 2196 2203 .of_match_table = imx_esdhc_dt_ids, 2197 - .pm = &sdhci_esdhc_pmops, 2204 + .pm = pm_ptr(&sdhci_esdhc_pmops), 2198 2205 }, 2199 2206 .probe = sdhci_esdhc_imx_probe, 2200 2207 .remove = sdhci_esdhc_imx_remove,