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

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

authored by

Jisheng Zhang and committed by
Ulf Hansson
1e4f1d8c 5861ff20

+2 -6
+2 -6
drivers/mmc/host/sdhci-brcmstb.c
··· 496 496 497 497 MODULE_DEVICE_TABLE(of, sdhci_brcm_of_match); 498 498 499 - #ifdef CONFIG_PM_SLEEP 500 499 static int sdhci_brcmstb_suspend(struct device *dev) 501 500 { 502 501 struct sdhci_host *host = dev_get_drvdata(dev); ··· 539 540 540 541 return ret; 541 542 } 542 - #endif 543 543 544 - static const struct dev_pm_ops sdhci_brcmstb_pmops = { 545 - SET_SYSTEM_SLEEP_PM_OPS(sdhci_brcmstb_suspend, sdhci_brcmstb_resume) 546 - }; 544 + static DEFINE_SIMPLE_DEV_PM_OPS(sdhci_brcmstb_pmops, sdhci_brcmstb_suspend, sdhci_brcmstb_resume); 547 545 548 546 static struct platform_driver sdhci_brcmstb_driver = { 549 547 .driver = { 550 548 .name = "sdhci-brcmstb", 551 549 .probe_type = PROBE_PREFER_ASYNCHRONOUS, 552 - .pm = &sdhci_brcmstb_pmops, 550 + .pm = pm_sleep_ptr(&sdhci_brcmstb_pmops), 553 551 .of_match_table = of_match_ptr(sdhci_brcm_of_match), 554 552 }, 555 553 .probe = sdhci_brcmstb_probe,