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

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

authored by

Jisheng Zhang and committed by
Ulf Hansson
f98ad5c3 4129dbbb

+3 -8
+3 -8
drivers/mmc/host/sunxi-mmc.c
··· 1495 1495 dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_dma); 1496 1496 } 1497 1497 1498 - #ifdef CONFIG_PM 1499 1498 static int sunxi_mmc_runtime_resume(struct device *dev) 1500 1499 { 1501 1500 struct mmc_host *mmc = dev_get_drvdata(dev); ··· 1529 1530 1530 1531 return 0; 1531 1532 } 1532 - #endif 1533 1533 1534 1534 static const struct dev_pm_ops sunxi_mmc_pm_ops = { 1535 - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, 1536 - pm_runtime_force_resume) 1537 - SET_RUNTIME_PM_OPS(sunxi_mmc_runtime_suspend, 1538 - sunxi_mmc_runtime_resume, 1539 - NULL) 1535 + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) 1536 + RUNTIME_PM_OPS(sunxi_mmc_runtime_suspend, sunxi_mmc_runtime_resume, NULL) 1540 1537 }; 1541 1538 1542 1539 static struct platform_driver sunxi_mmc_driver = { ··· 1540 1545 .name = "sunxi-mmc", 1541 1546 .probe_type = PROBE_PREFER_ASYNCHRONOUS, 1542 1547 .of_match_table = sunxi_mmc_of_match, 1543 - .pm = &sunxi_mmc_pm_ops, 1548 + .pm = pm_ptr(&sunxi_mmc_pm_ops), 1544 1549 }, 1545 1550 .probe = sunxi_mmc_probe, 1546 1551 .remove = sunxi_mmc_remove,