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

index ee4a65b0a22dceb8fb5c05dafd85435c21464fdb..8dbcff53a6313340ffa1094c907bb6d57d3caae3 100644 (file)
@@ -1495,7 +1495,6 @@ static void sunxi_mmc_remove(struct platform_device *pdev)
        dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_dma);
 }
 
-#ifdef CONFIG_PM
 static int sunxi_mmc_runtime_resume(struct device *dev)
 {
        struct mmc_host *mmc = dev_get_drvdata(dev);
@@ -1530,14 +1529,10 @@ static int sunxi_mmc_runtime_suspend(struct device *dev)
 
        return 0;
 }
-#endif
 
 static const struct dev_pm_ops sunxi_mmc_pm_ops = {
-       SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-                               pm_runtime_force_resume)
-       SET_RUNTIME_PM_OPS(sunxi_mmc_runtime_suspend,
-                          sunxi_mmc_runtime_resume,
-                          NULL)
+       SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
+       RUNTIME_PM_OPS(sunxi_mmc_runtime_suspend, sunxi_mmc_runtime_resume, NULL)
 };
 
 static struct platform_driver sunxi_mmc_driver = {
@@ -1545,7 +1540,7 @@ static struct platform_driver sunxi_mmc_driver = {
                .name   = "sunxi-mmc",
                .probe_type = PROBE_PREFER_ASYNCHRONOUS,
                .of_match_table = sunxi_mmc_of_match,
-               .pm = &sunxi_mmc_pm_ops,
+               .pm = pm_ptr(&sunxi_mmc_pm_ops),
        },
        .probe          = sunxi_mmc_probe,
        .remove         = sunxi_mmc_remove,