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

mmc: sdhci-msm: 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 __maybe_unused.

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

authored by

Jisheng Zhang and committed by
Ulf Hansson
1d955e4a 2f7c7a18

+9 -12
+9 -12
drivers/mmc/host/sdhci-msm.c
··· 1943 1943 qcom_ice_enable(msm_host->ice); 1944 1944 } 1945 1945 1946 - static __maybe_unused int sdhci_msm_ice_resume(struct sdhci_msm_host *msm_host) 1946 + static int sdhci_msm_ice_resume(struct sdhci_msm_host *msm_host) 1947 1947 { 1948 1948 if (msm_host->mmc->caps2 & MMC_CAP2_CRYPTO) 1949 1949 return qcom_ice_resume(msm_host->ice); ··· 1951 1951 return 0; 1952 1952 } 1953 1953 1954 - static __maybe_unused int sdhci_msm_ice_suspend(struct sdhci_msm_host *msm_host) 1954 + static int sdhci_msm_ice_suspend(struct sdhci_msm_host *msm_host) 1955 1955 { 1956 1956 if (msm_host->mmc->caps2 & MMC_CAP2_CRYPTO) 1957 1957 return qcom_ice_suspend(msm_host->ice); ··· 2011 2011 { 2012 2012 } 2013 2013 2014 - static inline __maybe_unused int 2014 + static inline int 2015 2015 sdhci_msm_ice_resume(struct sdhci_msm_host *msm_host) 2016 2016 { 2017 2017 return 0; 2018 2018 } 2019 2019 2020 - static inline __maybe_unused int 2020 + static inline int 2021 2021 sdhci_msm_ice_suspend(struct sdhci_msm_host *msm_host) 2022 2022 { 2023 2023 return 0; ··· 2801 2801 clk_disable_unprepare(msm_host->bus_clk); 2802 2802 } 2803 2803 2804 - static __maybe_unused int sdhci_msm_runtime_suspend(struct device *dev) 2804 + static int sdhci_msm_runtime_suspend(struct device *dev) 2805 2805 { 2806 2806 struct sdhci_host *host = dev_get_drvdata(dev); 2807 2807 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); ··· 2820 2820 return sdhci_msm_ice_suspend(msm_host); 2821 2821 } 2822 2822 2823 - static __maybe_unused int sdhci_msm_runtime_resume(struct device *dev) 2823 + static int sdhci_msm_runtime_resume(struct device *dev) 2824 2824 { 2825 2825 struct sdhci_host *host = dev_get_drvdata(dev); 2826 2826 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); ··· 2856 2856 } 2857 2857 2858 2858 static const struct dev_pm_ops sdhci_msm_pm_ops = { 2859 - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, 2860 - pm_runtime_force_resume) 2861 - SET_RUNTIME_PM_OPS(sdhci_msm_runtime_suspend, 2862 - sdhci_msm_runtime_resume, 2863 - NULL) 2859 + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) 2860 + RUNTIME_PM_OPS(sdhci_msm_runtime_suspend, sdhci_msm_runtime_resume, NULL) 2864 2861 }; 2865 2862 2866 2863 static struct platform_driver sdhci_msm_driver = { ··· 2866 2869 .driver = { 2867 2870 .name = "sdhci_msm", 2868 2871 .of_match_table = sdhci_msm_dt_match, 2869 - .pm = &sdhci_msm_pm_ops, 2872 + .pm = pm_ptr(&sdhci_msm_pm_ops), 2870 2873 .probe_type = PROBE_PREFER_ASYNCHRONOUS, 2871 2874 }, 2872 2875 };