mirror of https://github.com/torvalds/linux.git
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>
This commit is contained in:
parent
4129dbbb53
commit
f98ad5c31c
|
|
@ -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);
|
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)
|
static int sunxi_mmc_runtime_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct mmc_host *mmc = dev_get_drvdata(dev);
|
struct mmc_host *mmc = dev_get_drvdata(dev);
|
||||||
|
|
@ -1530,14 +1529,10 @@ static int sunxi_mmc_runtime_suspend(struct device *dev)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static const struct dev_pm_ops sunxi_mmc_pm_ops = {
|
static const struct dev_pm_ops sunxi_mmc_pm_ops = {
|
||||||
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
|
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
|
||||||
pm_runtime_force_resume)
|
RUNTIME_PM_OPS(sunxi_mmc_runtime_suspend, sunxi_mmc_runtime_resume, NULL)
|
||||||
SET_RUNTIME_PM_OPS(sunxi_mmc_runtime_suspend,
|
|
||||||
sunxi_mmc_runtime_resume,
|
|
||||||
NULL)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct platform_driver sunxi_mmc_driver = {
|
static struct platform_driver sunxi_mmc_driver = {
|
||||||
|
|
@ -1545,7 +1540,7 @@ static struct platform_driver sunxi_mmc_driver = {
|
||||||
.name = "sunxi-mmc",
|
.name = "sunxi-mmc",
|
||||||
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
|
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
|
||||||
.of_match_table = sunxi_mmc_of_match,
|
.of_match_table = sunxi_mmc_of_match,
|
||||||
.pm = &sunxi_mmc_pm_ops,
|
.pm = pm_ptr(&sunxi_mmc_pm_ops),
|
||||||
},
|
},
|
||||||
.probe = sunxi_mmc_probe,
|
.probe = sunxi_mmc_probe,
|
||||||
.remove = sunxi_mmc_remove,
|
.remove = sunxi_mmc_remove,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue