Skip to content

Commit 4b43f2b

Browse files
xhackerustcUlf Hansson
authored andcommitted
mmc: dw_mmc-rockchip: 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-39-jszhang@kernel.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent eddc917 commit 4b43f2b

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

drivers/mmc/host/dw_mmc-rockchip.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -568,11 +568,8 @@ static void dw_mci_rockchip_remove(struct platform_device *pdev)
568568
}
569569

570570
static const struct dev_pm_ops dw_mci_rockchip_dev_pm_ops = {
571-
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
572-
pm_runtime_force_resume)
573-
SET_RUNTIME_PM_OPS(dw_mci_runtime_suspend,
574-
dw_mci_runtime_resume,
575-
NULL)
571+
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
572+
RUNTIME_PM_OPS(dw_mci_runtime_suspend, dw_mci_runtime_resume, NULL)
576573
};
577574

578575
static struct platform_driver dw_mci_rockchip_pltfm_driver = {
@@ -582,7 +579,7 @@ static struct platform_driver dw_mci_rockchip_pltfm_driver = {
582579
.name = "dwmmc_rockchip",
583580
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
584581
.of_match_table = dw_mci_rockchip_match,
585-
.pm = &dw_mci_rockchip_dev_pm_ops,
582+
.pm = pm_ptr(&dw_mci_rockchip_dev_pm_ops),
586583
},
587584
};
588585

0 commit comments

Comments
 (0)