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

mmc: sdhci-of-at91: 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-21-jszhang@kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Jisheng Zhang and committed by
Ulf Hansson
6b66e69d bb7b1709

+3 -9
+3 -9
drivers/mmc/host/sdhci-of-at91.c
··· 229 229 return 0; 230 230 } 231 231 232 - #ifdef CONFIG_PM_SLEEP 233 232 static int sdhci_at91_suspend(struct device *dev) 234 233 { 235 234 struct sdhci_host *host = dev_get_drvdata(dev); ··· 242 243 243 244 return ret; 244 245 } 245 - #endif /* CONFIG_PM_SLEEP */ 246 246 247 - #ifdef CONFIG_PM 248 247 static int sdhci_at91_runtime_suspend(struct device *dev) 249 248 { 250 249 struct sdhci_host *host = dev_get_drvdata(dev); ··· 299 302 sdhci_runtime_resume_host(host, 0); 300 303 return 0; 301 304 } 302 - #endif /* CONFIG_PM */ 303 305 304 306 static const struct dev_pm_ops sdhci_at91_dev_pm_ops = { 305 - SET_SYSTEM_SLEEP_PM_OPS(sdhci_at91_suspend, pm_runtime_force_resume) 306 - SET_RUNTIME_PM_OPS(sdhci_at91_runtime_suspend, 307 - sdhci_at91_runtime_resume, 308 - NULL) 307 + SYSTEM_SLEEP_PM_OPS(sdhci_at91_suspend, pm_runtime_force_resume) 308 + RUNTIME_PM_OPS(sdhci_at91_runtime_suspend, sdhci_at91_runtime_resume, NULL) 309 309 }; 310 310 311 311 static int sdhci_at91_probe(struct platform_device *pdev) ··· 454 460 .name = "sdhci-at91", 455 461 .probe_type = PROBE_PREFER_ASYNCHRONOUS, 456 462 .of_match_table = sdhci_at91_dt_match, 457 - .pm = &sdhci_at91_dev_pm_ops, 463 + .pm = pm_ptr(&sdhci_at91_dev_pm_ops), 458 464 }, 459 465 .probe = sdhci_at91_probe, 460 466 .remove = sdhci_at91_remove,