]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: sdhci-cadence: use modern PM macros
authorJisheng Zhang <jszhang@kernel.org>
Fri, 15 Aug 2025 01:33:58 +0000 (09:33 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Fri, 22 Aug 2025 10:14:04 +0000 (12:14 +0200)
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-24-jszhang@kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-cadence.c

index eaa88897a256c0e18514d8180fab4f9b2957f40f..435603c8c00b2a2f2d838b1c8932b82dabf91d18 100644 (file)
@@ -611,7 +611,6 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
        return sdhci_add_host(host);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int sdhci_cdns_resume(struct device *dev)
 {
        struct sdhci_host *host = dev_get_drvdata(dev);
@@ -638,11 +637,8 @@ disable_clk:
 
        return ret;
 }
-#endif
 
-static const struct dev_pm_ops sdhci_cdns_pm_ops = {
-       SET_SYSTEM_SLEEP_PM_OPS(sdhci_pltfm_suspend, sdhci_cdns_resume)
-};
+static DEFINE_SIMPLE_DEV_PM_OPS(sdhci_cdns_pm_ops, sdhci_pltfm_suspend, sdhci_cdns_resume);
 
 static const struct of_device_id sdhci_cdns_match[] = {
        {
@@ -666,7 +662,7 @@ static struct platform_driver sdhci_cdns_driver = {
        .driver = {
                .name = "sdhci-cdns",
                .probe_type = PROBE_PREFER_ASYNCHRONOUS,
-               .pm = &sdhci_cdns_pm_ops,
+               .pm = pm_sleep_ptr(&sdhci_cdns_pm_ops),
                .of_match_table = sdhci_cdns_match,
        },
        .probe = sdhci_cdns_probe,