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

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

authored by

Jisheng Zhang and committed by
Ulf Hansson
550c5a8d 1c6316a5

+3 -8
+3 -8
drivers/mmc/host/sdhci-s3c.c
··· 681 681 clk_disable_unprepare(sc->clk_io); 682 682 } 683 683 684 - #ifdef CONFIG_PM_SLEEP 685 684 static int sdhci_s3c_suspend(struct device *dev) 686 685 { 687 686 struct sdhci_host *host = dev_get_drvdata(dev); ··· 697 698 698 699 return sdhci_resume_host(host); 699 700 } 700 - #endif 701 701 702 - #ifdef CONFIG_PM 703 702 static int sdhci_s3c_runtime_suspend(struct device *dev) 704 703 { 705 704 struct sdhci_host *host = dev_get_drvdata(dev); ··· 727 730 sdhci_runtime_resume_host(host, 0); 728 731 return 0; 729 732 } 730 - #endif 731 733 732 734 static const struct dev_pm_ops sdhci_s3c_pmops = { 733 - SET_SYSTEM_SLEEP_PM_OPS(sdhci_s3c_suspend, sdhci_s3c_resume) 734 - SET_RUNTIME_PM_OPS(sdhci_s3c_runtime_suspend, sdhci_s3c_runtime_resume, 735 - NULL) 735 + SYSTEM_SLEEP_PM_OPS(sdhci_s3c_suspend, sdhci_s3c_resume) 736 + RUNTIME_PM_OPS(sdhci_s3c_runtime_suspend, sdhci_s3c_runtime_resume, NULL) 736 737 }; 737 738 738 739 static const struct platform_device_id sdhci_s3c_driver_ids[] = { ··· 765 770 .name = "s3c-sdhci", 766 771 .probe_type = PROBE_PREFER_ASYNCHRONOUS, 767 772 .of_match_table = of_match_ptr(sdhci_s3c_dt_match), 768 - .pm = &sdhci_s3c_pmops, 773 + .pm = pm_ptr(&sdhci_s3c_pmops), 769 774 }, 770 775 }; 771 776