linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/38] mmc: host: use modern PM macros
@ 2025-08-15  1:33 Jisheng Zhang
  2025-08-15  1:33 ` [PATCH 01/38] sdhci: add some simple inline functions for !CONFIG_PM Jisheng Zhang
                   ` (38 more replies)
  0 siblings, 39 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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 or
__maybe_unused.

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.

Previously, I only cleaned up the host drivers which I used, e.g
sdhci-of-dwcmshc, sdhci-pxav3 and sdhci-xenon, these are both compile
tested and functionality tested. But then I also cleaned up other
host drivers, but they are compile-tested only.

Jisheng Zhang (38):
  sdhci: add some simple inline functions for !CONFIG_PM
  mmc: sdhci-of-dwcmshc: use modern PM macros
  mmc: sdhci-xenon: use modern PM macros
  mmc: sdhci-pxav3: use modern PM macros
  mmc: sunxi: use modern PM macros
  mmc: alcor: use modern PM macros
  mmc: atmel: use modern PM macros
  mmc: au1xmmc: use modern PM macros
  mmc: cb710-mmc: use modern PM macros
  mmc: davinci_mmc: use modern PM macros
  mmc: mmci: use modern PM macros
  mmc: mxs-mmc: use modern PM macros
  mmc: omap_hsmmc: use modern PM macros
  mmc: rtsx_usb_sdmmc: use modern PM macros
  mmc: sdhci-acpi: use modern PM macros
  mmc: sdhci_am654: use modern PM macros
  mmc: sdhci-brcmstb: use modern PM macros
  mmc: sdhci-esdhc-imx: use modern PM macros
  mmc: sdhci-of-arasan: use modern PM macros
  mmc: sdhci-of-at91: use modern PM macros
  mmc: sdhci-of-esdhc: use modern PM macros
  mmc: sdhci-omap: use modern PM macros
  mmc: sdhci-cadence: use modern PM macros
  mmc: sdhci-s3c: use modern PM macros
  mmc: sdhci-spear: use modern PM macros
  mmc: sdhci-sprd: use modern PM macros
  mmc: sdhci-st: use modern PM macros
  mmc: sdhci-tegra: use modern PM macros
  mmc: sh_mmicf: use modern PM macros
  mmc: toshsd: use modern PM macros
  mmc: wmt-sdmmc: use modern PM macros
  mmc: mtk-sd: use modern PM macros
  mmc: sdhci-msm: use modern PM macros
  mmc: via-sdmmc: use modern PM macros
  mmc: dw_mmc: exynos: use modern PM macros
  mmc: dw_mmc-k3: use modern PM macros
  mmc: dw_mmc-pci: use modern PM macros
  mmc: dw_mmc-rockchip: use modern PM macros

 drivers/mmc/host/alcor.c            |  8 +++-----
 drivers/mmc/host/atmel-mci.c        |  9 +++------
 drivers/mmc/host/au1xmmc.c          | 18 +++++++-----------
 drivers/mmc/host/cb710-mmc.c        | 19 +++++++++----------
 drivers/mmc/host/davinci_mmc.c      | 14 +++-----------
 drivers/mmc/host/dw_mmc-exynos.c    | 13 +++----------
 drivers/mmc/host/dw_mmc-k3.c        |  9 +++------
 drivers/mmc/host/dw_mmc-pci.c       |  9 +++------
 drivers/mmc/host/dw_mmc-rockchip.c  |  9 +++------
 drivers/mmc/host/dw_mmc.h           |  3 +++
 drivers/mmc/host/mmci.c             |  9 +++------
 drivers/mmc/host/mtk-sd.c           | 14 +++++++-------
 drivers/mmc/host/mxs-mmc.c          |  6 ++----
 drivers/mmc/host/omap_hsmmc.c       | 13 ++++---------
 drivers/mmc/host/rtsx_usb_sdmmc.c   |  7 ++-----
 drivers/mmc/host/sdhci-acpi.c       | 18 ++++--------------
 drivers/mmc/host/sdhci-brcmstb.c    |  8 ++------
 drivers/mmc/host/sdhci-cadence.c    |  8 ++------
 drivers/mmc/host/sdhci-esdhc-imx.c  | 13 +++----------
 drivers/mmc/host/sdhci-msm.c        | 21 +++++++++------------
 drivers/mmc/host/sdhci-of-arasan.c  |  8 +++-----
 drivers/mmc/host/sdhci-of-at91.c    | 12 +++---------
 drivers/mmc/host/sdhci-of-dwcmshc.c | 13 +++----------
 drivers/mmc/host/sdhci-of-esdhc.c   |  8 ++------
 drivers/mmc/host/sdhci-omap.c       | 18 +++++++-----------
 drivers/mmc/host/sdhci-pxav3.c      | 11 +++--------
 drivers/mmc/host/sdhci-s3c.c        | 11 +++--------
 drivers/mmc/host/sdhci-spear.c      |  6 ++----
 drivers/mmc/host/sdhci-sprd.c       | 10 +++-------
 drivers/mmc/host/sdhci-st.c         |  6 ++----
 drivers/mmc/host/sdhci-tegra.c      | 13 +++++--------
 drivers/mmc/host/sdhci-xenon.c      | 13 +++----------
 drivers/mmc/host/sdhci.h            |  7 +++++++
 drivers/mmc/host/sdhci_am654.c      | 10 +++-------
 drivers/mmc/host/sh_mmcif.c         |  8 ++------
 drivers/mmc/host/sunxi-mmc.c        | 11 +++--------
 drivers/mmc/host/toshsd.c           |  8 ++------
 drivers/mmc/host/via-sdmmc.c        | 10 +++++-----
 drivers/mmc/host/wmt-sdmmc.c        | 16 ++--------------
 39 files changed, 141 insertions(+), 286 deletions(-)

-- 
2.50.0


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 01/38] sdhci: add some simple inline functions for !CONFIG_PM
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-18 11:29   ` Adrian Hunter
  2025-08-15  1:33 ` [PATCH 02/38] mmc: sdhci-of-dwcmshc: use modern PM macros Jisheng Zhang
                   ` (37 subsequent siblings)
  38 siblings, 1 reply; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

In next commits, we will switch to the modern PM macros.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/mmc/host/sdhci.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 58fcbeaf281e..5b699af04bfe 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -880,6 +880,13 @@ int sdhci_suspend_host(struct sdhci_host *host);
 int sdhci_resume_host(struct sdhci_host *host);
 void sdhci_runtime_suspend_host(struct sdhci_host *host);
 void sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset);
+#else
+static inline bool sdhci_enable_irq_wakeups(struct sdhci_host *host) { return false; }
+static inline void sdhci_disable_irq_wakeups(struct sdhci_host *host) {}
+static inline int sdhci_suspend_host(struct sdhci_host *host) { return -EOPNOTSUPP; }
+static inline int sdhci_resume_host(struct sdhci_host *host) { return -EOPNOTSUPP; }
+static inline void sdhci_runtime_suspend_host(struct sdhci_host *host) {}
+static inline void sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset) {}
 #endif
 
 void sdhci_cqe_enable(struct mmc_host *mmc);
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 02/38] mmc: sdhci-of-dwcmshc: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
  2025-08-15  1:33 ` [PATCH 01/38] sdhci: add some simple inline functions for !CONFIG_PM Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-18 18:30   ` Drew Fustini
  2025-08-15  1:33 ` [PATCH 03/38] mmc: sdhci-xenon: " Jisheng Zhang
                   ` (36 subsequent siblings)
  38 siblings, 1 reply; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/sdhci-of-dwcmshc.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c
index ee6b1096f709..eebd45389956 100644
--- a/drivers/mmc/host/sdhci-of-dwcmshc.c
+++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
@@ -1499,7 +1499,6 @@ static void dwcmshc_remove(struct platform_device *pdev)
 	clk_bulk_disable_unprepare(priv->num_other_clks, priv->other_clks);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int dwcmshc_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
@@ -1570,9 +1569,6 @@ static int dwcmshc_resume(struct device *dev)
 	clk_disable_unprepare(pltfm_host->clk);
 	return ret;
 }
-#endif
-
-#ifdef CONFIG_PM
 
 static void dwcmshc_enable_card_clk(struct sdhci_host *host)
 {
@@ -1603,12 +1599,9 @@ static int dwcmshc_runtime_resume(struct device *dev)
 	return 0;
 }
 
-#endif
-
 static const struct dev_pm_ops dwcmshc_pmops = {
-	SET_SYSTEM_SLEEP_PM_OPS(dwcmshc_suspend, dwcmshc_resume)
-	SET_RUNTIME_PM_OPS(dwcmshc_runtime_suspend,
-			   dwcmshc_runtime_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(dwcmshc_suspend, dwcmshc_resume)
+	RUNTIME_PM_OPS(dwcmshc_runtime_suspend, dwcmshc_runtime_resume, NULL)
 };
 
 static struct platform_driver sdhci_dwcmshc_driver = {
@@ -1617,7 +1610,7 @@ static struct platform_driver sdhci_dwcmshc_driver = {
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 		.of_match_table = sdhci_dwcmshc_dt_ids,
 		.acpi_match_table = ACPI_PTR(sdhci_dwcmshc_acpi_ids),
-		.pm = &dwcmshc_pmops,
+		.pm = pm_ptr(&dwcmshc_pmops),
 	},
 	.probe	= dwcmshc_probe,
 	.remove = dwcmshc_remove,
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 03/38] mmc: sdhci-xenon: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
  2025-08-15  1:33 ` [PATCH 01/38] sdhci: add some simple inline functions for !CONFIG_PM Jisheng Zhang
  2025-08-15  1:33 ` [PATCH 02/38] mmc: sdhci-of-dwcmshc: use modern PM macros Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-15  1:33 ` [PATCH 04/38] mmc: sdhci-pxav3: " Jisheng Zhang
                   ` (35 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/sdhci-xenon.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/mmc/host/sdhci-xenon.c b/drivers/mmc/host/sdhci-xenon.c
index b12bee8342bd..046e8100dd08 100644
--- a/drivers/mmc/host/sdhci-xenon.c
+++ b/drivers/mmc/host/sdhci-xenon.c
@@ -622,7 +622,6 @@ static void xenon_remove(struct platform_device *pdev)
 	clk_disable_unprepare(pltfm_host->clk);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int xenon_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
@@ -635,9 +634,7 @@ static int xenon_suspend(struct device *dev)
 	priv->restore_needed = true;
 	return ret;
 }
-#endif
 
-#ifdef CONFIG_PM
 static int xenon_runtime_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
@@ -685,14 +682,10 @@ static int xenon_runtime_resume(struct device *dev)
 	clk_disable_unprepare(pltfm_host->clk);
 	return ret;
 }
-#endif /* CONFIG_PM */
 
 static const struct dev_pm_ops sdhci_xenon_dev_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(xenon_suspend,
-				pm_runtime_force_resume)
-	SET_RUNTIME_PM_OPS(xenon_runtime_suspend,
-			   xenon_runtime_resume,
-			   NULL)
+	SYSTEM_SLEEP_PM_OPS(xenon_suspend, pm_runtime_force_resume)
+	RUNTIME_PM_OPS(xenon_runtime_suspend, xenon_runtime_resume, NULL)
 };
 
 static const struct of_device_id sdhci_xenon_dt_ids[] = {
@@ -721,7 +714,7 @@ static struct platform_driver sdhci_xenon_driver = {
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 		.of_match_table = sdhci_xenon_dt_ids,
 		.acpi_match_table = ACPI_PTR(sdhci_xenon_acpi_ids),
-		.pm = &sdhci_xenon_dev_pm_ops,
+		.pm = pm_ptr(&sdhci_xenon_dev_pm_ops),
 	},
 	.probe	= xenon_probe,
 	.remove = xenon_remove,
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 04/38] mmc: sdhci-pxav3: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (2 preceding siblings ...)
  2025-08-15  1:33 ` [PATCH 03/38] mmc: sdhci-xenon: " Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-15  1:33 ` [PATCH 05/38] mmc: sunxi: " Jisheng Zhang
                   ` (34 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/sdhci-pxav3.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index 1371960e34eb..6fb461cdd904 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -484,7 +484,6 @@ static void sdhci_pxav3_remove(struct platform_device *pdev)
 	clk_disable_unprepare(pxa->clk_core);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int sdhci_pxav3_suspend(struct device *dev)
 {
 	int ret;
@@ -510,9 +509,7 @@ static int sdhci_pxav3_resume(struct device *dev)
 
 	return ret;
 }
-#endif
 
-#ifdef CONFIG_PM
 static int sdhci_pxav3_runtime_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
@@ -544,12 +541,10 @@ static int sdhci_pxav3_runtime_resume(struct device *dev)
 	sdhci_runtime_resume_host(host, 0);
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops sdhci_pxav3_pmops = {
-	SET_SYSTEM_SLEEP_PM_OPS(sdhci_pxav3_suspend, sdhci_pxav3_resume)
-	SET_RUNTIME_PM_OPS(sdhci_pxav3_runtime_suspend,
-		sdhci_pxav3_runtime_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(sdhci_pxav3_suspend, sdhci_pxav3_resume)
+	RUNTIME_PM_OPS(sdhci_pxav3_runtime_suspend, sdhci_pxav3_runtime_resume, NULL)
 };
 
 static struct platform_driver sdhci_pxav3_driver = {
@@ -557,7 +552,7 @@ static struct platform_driver sdhci_pxav3_driver = {
 		.name	= "sdhci-pxav3",
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 		.of_match_table = of_match_ptr(sdhci_pxav3_of_match),
-		.pm	= &sdhci_pxav3_pmops,
+		.pm	= pm_ptr(&sdhci_pxav3_pmops),
 	},
 	.probe		= sdhci_pxav3_probe,
 	.remove		= sdhci_pxav3_remove,
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 05/38] mmc: sunxi: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (3 preceding siblings ...)
  2025-08-15  1:33 ` [PATCH 04/38] mmc: sdhci-pxav3: " Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-15  1:33 ` [PATCH 06/38] mmc: alcor: " Jisheng Zhang
                   ` (33 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/sunxi-mmc.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index ee4a65b0a22d..8dbcff53a631 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -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);
 }
 
-#ifdef CONFIG_PM
 static int sunxi_mmc_runtime_resume(struct device *dev)
 {
 	struct mmc_host	*mmc = dev_get_drvdata(dev);
@@ -1530,14 +1529,10 @@ static int sunxi_mmc_runtime_suspend(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops sunxi_mmc_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-				pm_runtime_force_resume)
-	SET_RUNTIME_PM_OPS(sunxi_mmc_runtime_suspend,
-			   sunxi_mmc_runtime_resume,
-			   NULL)
+	SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
+	RUNTIME_PM_OPS(sunxi_mmc_runtime_suspend, sunxi_mmc_runtime_resume, NULL)
 };
 
 static struct platform_driver sunxi_mmc_driver = {
@@ -1545,7 +1540,7 @@ static struct platform_driver sunxi_mmc_driver = {
 		.name	= "sunxi-mmc",
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 		.of_match_table = sunxi_mmc_of_match,
-		.pm = &sunxi_mmc_pm_ops,
+		.pm = pm_ptr(&sunxi_mmc_pm_ops),
 	},
 	.probe		= sunxi_mmc_probe,
 	.remove		= sunxi_mmc_remove,
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 06/38] mmc: alcor: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (4 preceding siblings ...)
  2025-08-15  1:33 ` [PATCH 05/38] mmc: sunxi: " Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-15  1:33 ` [PATCH 07/38] mmc: atmel: " Jisheng Zhang
                   ` (32 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/alcor.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/alcor.c b/drivers/mmc/host/alcor.c
index 288c3a91a0af..721db54739c1 100644
--- a/drivers/mmc/host/alcor.c
+++ b/drivers/mmc/host/alcor.c
@@ -1129,7 +1129,6 @@ static void alcor_pci_sdmmc_drv_remove(struct platform_device *pdev)
 	mmc_remove_host(mmc);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int alcor_pci_sdmmc_suspend(struct device *dev)
 {
 	struct alcor_sdmmc_host *host = dev_get_drvdata(dev);
@@ -1150,10 +1149,9 @@ static int alcor_pci_sdmmc_resume(struct device *dev)
 
 	return 0;
 }
-#endif /* CONFIG_PM_SLEEP */
 
-static SIMPLE_DEV_PM_OPS(alcor_mmc_pm_ops, alcor_pci_sdmmc_suspend,
-			 alcor_pci_sdmmc_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(alcor_mmc_pm_ops, alcor_pci_sdmmc_suspend,
+				alcor_pci_sdmmc_resume);
 
 static const struct platform_device_id alcor_pci_sdmmc_ids[] = {
 	{
@@ -1171,7 +1169,7 @@ static struct platform_driver alcor_pci_sdmmc_driver = {
 	.driver		= {
 		.name	= DRV_NAME_ALCOR_PCI_SDMMC,
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
-		.pm	= &alcor_mmc_pm_ops
+		.pm	= pm_sleep_ptr(&alcor_mmc_pm_ops),
 	},
 };
 module_platform_driver(alcor_pci_sdmmc_driver);
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 07/38] mmc: atmel: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (5 preceding siblings ...)
  2025-08-15  1:33 ` [PATCH 06/38] mmc: alcor: " Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-15  1:33 ` [PATCH 08/38] mmc: au1xmmc: " Jisheng Zhang
                   ` (31 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/atmel-mci.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 777342fb7657..d1fbc6811563 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -2622,7 +2622,6 @@ static void atmci_remove(struct platform_device *pdev)
 	pm_runtime_put_noidle(dev);
 }
 
-#ifdef CONFIG_PM
 static int atmci_runtime_suspend(struct device *dev)
 {
 	struct atmel_mci *host = dev_get_drvdata(dev);
@@ -2642,12 +2641,10 @@ static int atmci_runtime_resume(struct device *dev)
 
 	return clk_prepare_enable(host->mck);
 }
-#endif
 
 static const struct dev_pm_ops atmci_dev_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-				pm_runtime_force_resume)
-	SET_RUNTIME_PM_OPS(atmci_runtime_suspend, atmci_runtime_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
+	RUNTIME_PM_OPS(atmci_runtime_suspend, atmci_runtime_resume, NULL)
 };
 
 static struct platform_driver atmci_driver = {
@@ -2657,7 +2654,7 @@ static struct platform_driver atmci_driver = {
 		.name		= "atmel_mci",
 		.probe_type	= PROBE_PREFER_ASYNCHRONOUS,
 		.of_match_table	= atmci_dt_ids,
-		.pm		= &atmci_dev_pm_ops,
+		.pm		= pm_ptr(&atmci_dev_pm_ops),
 	},
 };
 module_platform_driver(atmci_driver);
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 08/38] mmc: au1xmmc: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (6 preceding siblings ...)
  2025-08-15  1:33 ` [PATCH 07/38] mmc: atmel: " Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-15  1:33 ` [PATCH 09/38] mmc: cb710-mmc: " Jisheng Zhang
                   ` (30 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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.

At the same time, replace the platform_driver's .suspend and .resume
usage with modern device_driver's .pm usage.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/mmc/host/au1xmmc.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c
index 85470773650d..cc6e05f9b96f 100644
--- a/drivers/mmc/host/au1xmmc.c
+++ b/drivers/mmc/host/au1xmmc.c
@@ -1150,10 +1150,9 @@ static void au1xmmc_remove(struct platform_device *pdev)
 	}
 }
 
-#ifdef CONFIG_PM
-static int au1xmmc_suspend(struct platform_device *pdev, pm_message_t state)
+static int au1xmmc_suspend(struct device *dev)
 {
-	struct au1xmmc_host *host = platform_get_drvdata(pdev);
+	struct au1xmmc_host *host = dev_get_drvdata(dev);
 
 	__raw_writel(0, HOST_CONFIG2(host));
 	__raw_writel(0, HOST_CONFIG(host));
@@ -1164,27 +1163,24 @@ static int au1xmmc_suspend(struct platform_device *pdev, pm_message_t state)
 	return 0;
 }
 
-static int au1xmmc_resume(struct platform_device *pdev)
+static int au1xmmc_resume(struct device *dev)
 {
-	struct au1xmmc_host *host = platform_get_drvdata(pdev);
+	struct au1xmmc_host *host = dev_get_drvdata(dev);
 
 	au1xmmc_reset_controller(host);
 
 	return 0;
 }
-#else
-#define au1xmmc_suspend NULL
-#define au1xmmc_resume NULL
-#endif
+
+static DEFINE_SIMPLE_DEV_PM_OPS(au1xmmc_pmops, au1xmmc_suspend, au1xmmc_resume);
 
 static struct platform_driver au1xmmc_driver = {
 	.probe         = au1xmmc_probe,
 	.remove        = au1xmmc_remove,
-	.suspend       = au1xmmc_suspend,
-	.resume        = au1xmmc_resume,
 	.driver        = {
 		.name  = DRIVER_NAME,
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
+		.pm = pm_sleep_ptr(&au1xmmc_pmops),
 	},
 };
 
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 09/38] mmc: cb710-mmc: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (7 preceding siblings ...)
  2025-08-15  1:33 ` [PATCH 08/38] mmc: au1xmmc: " Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-20 19:21   ` Michał Mirosław
  2025-08-15  1:33 ` [PATCH 10/38] mmc: davinci_mmc: " Jisheng Zhang
                   ` (29 subsequent siblings)
  38 siblings, 1 reply; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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.

At the same time, replace the platform_driver's .suspend and .resume
usage with modern device_driver's .pm usage.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/mmc/host/cb710-mmc.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/mmc/host/cb710-mmc.c b/drivers/mmc/host/cb710-mmc.c
index 448d2f9159ea..31daec787495 100644
--- a/drivers/mmc/host/cb710-mmc.c
+++ b/drivers/mmc/host/cb710-mmc.c
@@ -664,25 +664,25 @@ static const struct mmc_host_ops cb710_mmc_host = {
 	.get_cd = cb710_mmc_get_cd,
 };
 
-#ifdef CONFIG_PM
-
-static int cb710_mmc_suspend(struct platform_device *pdev, pm_message_t state)
+static int cb710_mmc_suspend(struct device *dev)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	struct cb710_slot *slot = cb710_pdev_to_slot(pdev);
 
 	cb710_mmc_enable_irq(slot, 0, ~0);
 	return 0;
 }
 
-static int cb710_mmc_resume(struct platform_device *pdev)
+static int cb710_mmc_resume(struct device *dev)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	struct cb710_slot *slot = cb710_pdev_to_slot(pdev);
 
 	cb710_mmc_enable_irq(slot, 0, ~0);
 	return 0;
 }
 
-#endif /* CONFIG_PM */
+static DEFINE_SIMPLE_DEV_PM_OPS(cb710_mmc_pmops, cb710_mmc_suspend, cb710_mmc_resume);
 
 static int cb710_mmc_init(struct platform_device *pdev)
 {
@@ -767,13 +767,12 @@ static void cb710_mmc_exit(struct platform_device *pdev)
 }
 
 static struct platform_driver cb710_mmc_driver = {
-	.driver.name = "cb710-mmc",
+	.driver = {
+		.name = "cb710-mmc",
+		.pm = pm_sleep_ptr(&cb710_mmc_pmops),
+	},
 	.probe = cb710_mmc_init,
 	.remove = cb710_mmc_exit,
-#ifdef CONFIG_PM
-	.suspend = cb710_mmc_suspend,
-	.resume = cb710_mmc_resume,
-#endif
 };
 
 module_platform_driver(cb710_mmc_driver);
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 10/38] mmc: davinci_mmc: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (8 preceding siblings ...)
  2025-08-15  1:33 ` [PATCH 09/38] mmc: cb710-mmc: " Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-15  1:33 ` [PATCH 11/38] mmc: mmci: " Jisheng Zhang
                   ` (28 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/davinci_mmc.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
index c691f1b60395..75fd00fc51ed 100644
--- a/drivers/mmc/host/davinci_mmc.c
+++ b/drivers/mmc/host/davinci_mmc.c
@@ -1347,7 +1347,6 @@ static void davinci_mmcsd_remove(struct platform_device *pdev)
 	clk_disable_unprepare(host->clk);
 }
 
-#ifdef CONFIG_PM
 static int davinci_mmcsd_suspend(struct device *dev)
 {
 	struct mmc_davinci_host *host = dev_get_drvdata(dev);
@@ -1373,21 +1372,14 @@ static int davinci_mmcsd_resume(struct device *dev)
 	return 0;
 }
 
-static const struct dev_pm_ops davinci_mmcsd_pm = {
-	.suspend        = davinci_mmcsd_suspend,
-	.resume         = davinci_mmcsd_resume,
-};
-
-#define davinci_mmcsd_pm_ops (&davinci_mmcsd_pm)
-#else
-#define davinci_mmcsd_pm_ops NULL
-#endif
+static DEFINE_SIMPLE_DEV_PM_OPS(davinci_mmcsd_pm_ops,
+				davinci_mmcsd_suspend, davinci_mmcsd_resume);
 
 static struct platform_driver davinci_mmcsd_driver = {
 	.driver		= {
 		.name	= "davinci_mmc",
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
-		.pm	= davinci_mmcsd_pm_ops,
+		.pm	= pm_sleep_ptr(&davinci_mmcsd_pm_ops),
 		.of_match_table = davinci_mmc_dt_ids,
 	},
 	.probe		= davinci_mmcsd_probe,
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 11/38] mmc: mmci: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (9 preceding siblings ...)
  2025-08-15  1:33 ` [PATCH 10/38] mmc: davinci_mmc: " Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-15  1:33 ` [PATCH 12/38] mmc: mxs-mmc: " Jisheng Zhang
                   ` (27 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/mmci.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 8367283647a9..e500051bd572 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -2516,7 +2516,6 @@ static void mmci_remove(struct amba_device *dev)
 	}
 }
 
-#ifdef CONFIG_PM
 static void mmci_save(struct mmci_host *host)
 {
 	unsigned long flags;
@@ -2581,12 +2580,10 @@ static int mmci_runtime_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops mmci_dev_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-				pm_runtime_force_resume)
-	SET_RUNTIME_PM_OPS(mmci_runtime_suspend, mmci_runtime_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
+	RUNTIME_PM_OPS(mmci_runtime_suspend, mmci_runtime_resume, NULL)
 };
 
 static const struct amba_id mmci_ids[] = {
@@ -2675,7 +2672,7 @@ MODULE_DEVICE_TABLE(amba, mmci_ids);
 static struct amba_driver mmci_driver = {
 	.drv		= {
 		.name	= DRIVER_NAME,
-		.pm	= &mmci_dev_pm_ops,
+		.pm	= pm_ptr(&mmci_dev_pm_ops),
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	},
 	.probe		= mmci_probe,
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 12/38] mmc: mxs-mmc: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (10 preceding siblings ...)
  2025-08-15  1:33 ` [PATCH 11/38] mmc: mmci: " Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-15  1:33 ` [PATCH 13/38] mmc: omap_hsmmc: " Jisheng Zhang
                   ` (26 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/mxs-mmc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index a6e44e406106..7c7c52d9e8e7 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -680,7 +680,6 @@ static void mxs_mmc_remove(struct platform_device *pdev)
 	clk_disable_unprepare(ssp->clk);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int mxs_mmc_suspend(struct device *dev)
 {
 	struct mmc_host *mmc = dev_get_drvdata(dev);
@@ -699,9 +698,8 @@ static int mxs_mmc_resume(struct device *dev)
 
 	return clk_prepare_enable(ssp->clk);
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(mxs_mmc_pm_ops, mxs_mmc_suspend, mxs_mmc_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(mxs_mmc_pm_ops, mxs_mmc_suspend, mxs_mmc_resume);
 
 static struct platform_driver mxs_mmc_driver = {
 	.probe		= mxs_mmc_probe,
@@ -709,7 +707,7 @@ static struct platform_driver mxs_mmc_driver = {
 	.driver		= {
 		.name	= DRIVER_NAME,
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
-		.pm	= &mxs_mmc_pm_ops,
+		.pm	= pm_sleep_ptr(&mxs_mmc_pm_ops),
 		.of_match_table = mxs_mmc_dt_ids,
 	},
 };
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 13/38] mmc: omap_hsmmc: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (11 preceding siblings ...)
  2025-08-15  1:33 ` [PATCH 12/38] mmc: mxs-mmc: " Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-15  1:33 ` [PATCH 14/38] mmc: rtsx_usb_sdmmc: " Jisheng Zhang
                   ` (25 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/omap_hsmmc.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index adc0d0b6ae37..09e4354d1f1d 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -620,8 +620,6 @@ static void omap_hsmmc_set_bus_mode(struct omap_hsmmc_host *host)
 		OMAP_HSMMC_WRITE(host->base, CON, con & ~OD);
 }
 
-#ifdef CONFIG_PM
-
 /*
  * Restore the MMC host context, if it was lost as result of a
  * power state change.
@@ -689,6 +687,7 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host)
 	return 0;
 }
 
+#ifdef CONFIG_PM
 /*
  * Save the MMC host context (store the number of power state changes so far).
  */
@@ -1990,7 +1989,6 @@ static void omap_hsmmc_remove(struct platform_device *pdev)
 	clk_disable_unprepare(host->dbclk);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int omap_hsmmc_suspend(struct device *dev)
 {
 	struct omap_hsmmc_host *host = dev_get_drvdata(dev);
@@ -2032,9 +2030,7 @@ static int omap_hsmmc_resume(struct device *dev)
 	pm_runtime_put_autosuspend(host->dev);
 	return 0;
 }
-#endif
 
-#ifdef CONFIG_PM
 static int omap_hsmmc_runtime_suspend(struct device *dev)
 {
 	struct omap_hsmmc_host *host;
@@ -2102,11 +2098,10 @@ static int omap_hsmmc_runtime_resume(struct device *dev)
 	spin_unlock_irqrestore(&host->irq_lock, flags);
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops omap_hsmmc_dev_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(omap_hsmmc_suspend, omap_hsmmc_resume)
-	SET_RUNTIME_PM_OPS(omap_hsmmc_runtime_suspend, omap_hsmmc_runtime_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(omap_hsmmc_suspend, omap_hsmmc_resume)
+	RUNTIME_PM_OPS(omap_hsmmc_runtime_suspend, omap_hsmmc_runtime_resume, NULL)
 };
 
 static struct platform_driver omap_hsmmc_driver = {
@@ -2115,7 +2110,7 @@ static struct platform_driver omap_hsmmc_driver = {
 	.driver		= {
 		.name = DRIVER_NAME,
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
-		.pm = &omap_hsmmc_dev_pm_ops,
+		.pm = pm_ptr(&omap_hsmmc_dev_pm_ops),
 		.of_match_table = of_match_ptr(omap_mmc_of_match),
 	},
 };
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 14/38] mmc: rtsx_usb_sdmmc: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (12 preceding siblings ...)
  2025-08-15  1:33 ` [PATCH 13/38] mmc: omap_hsmmc: " Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-15  1:33 ` [PATCH 15/38] mmc: sdhci-acpi: " Jisheng Zhang
                   ` (24 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/rtsx_usb_sdmmc.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c
index c5f6b9df066b..98184b140a41 100644
--- a/drivers/mmc/host/rtsx_usb_sdmmc.c
+++ b/drivers/mmc/host/rtsx_usb_sdmmc.c
@@ -1428,7 +1428,6 @@ static void rtsx_usb_sdmmc_drv_remove(struct platform_device *pdev)
 		": Realtek USB SD/MMC module has been removed\n");
 }
 
-#ifdef CONFIG_PM
 static int rtsx_usb_sdmmc_runtime_suspend(struct device *dev)
 {
 	struct rtsx_usb_sdmmc *host = dev_get_drvdata(dev);
@@ -1446,11 +1445,9 @@ static int rtsx_usb_sdmmc_runtime_resume(struct device *dev)
 		mmc_detect_change(host->mmc, 0);
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops rtsx_usb_sdmmc_dev_pm_ops = {
-	SET_RUNTIME_PM_OPS(rtsx_usb_sdmmc_runtime_suspend,
-			   rtsx_usb_sdmmc_runtime_resume, NULL)
+	RUNTIME_PM_OPS(rtsx_usb_sdmmc_runtime_suspend, rtsx_usb_sdmmc_runtime_resume, NULL)
 };
 
 static const struct platform_device_id rtsx_usb_sdmmc_ids[] = {
@@ -1469,7 +1466,7 @@ static struct platform_driver rtsx_usb_sdmmc_driver = {
 	.driver		= {
 		.name	= "rtsx_usb_sdmmc",
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
-		.pm	= &rtsx_usb_sdmmc_dev_pm_ops,
+		.pm	= pm_ptr(&rtsx_usb_sdmmc_dev_pm_ops),
 	},
 };
 module_platform_driver(rtsx_usb_sdmmc_driver);
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 15/38] mmc: sdhci-acpi: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (13 preceding siblings ...)
  2025-08-15  1:33 ` [PATCH 14/38] mmc: rtsx_usb_sdmmc: " Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-18 10:40   ` Adrian Hunter
  2025-08-15  1:33 ` [PATCH 16/38] mmc: sdhci_am654: " Jisheng Zhang
                   ` (23 subsequent siblings)
  38 siblings, 1 reply; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/sdhci-acpi.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index 2d46d4854fa1..84c7054607fc 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -973,8 +973,7 @@ static void sdhci_acpi_remove(struct platform_device *pdev)
 		c->slot->free_slot(pdev);
 }
 
-static void __maybe_unused sdhci_acpi_reset_signal_voltage_if_needed(
-	struct device *dev)
+static void sdhci_acpi_reset_signal_voltage_if_needed(struct device *dev)
 {
 	struct sdhci_acpi_host *c = dev_get_drvdata(dev);
 	struct sdhci_host *host = c->host;
@@ -989,8 +988,6 @@ static void __maybe_unused sdhci_acpi_reset_signal_voltage_if_needed(
 	}
 }
 
-#ifdef CONFIG_PM_SLEEP
-
 static int sdhci_acpi_suspend(struct device *dev)
 {
 	struct sdhci_acpi_host *c = dev_get_drvdata(dev);
@@ -1017,10 +1014,6 @@ static int sdhci_acpi_resume(struct device *dev)
 	return sdhci_resume_host(c->host);
 }
 
-#endif
-
-#ifdef CONFIG_PM
-
 static int sdhci_acpi_runtime_suspend(struct device *dev)
 {
 	struct sdhci_acpi_host *c = dev_get_drvdata(dev);
@@ -1045,12 +1038,9 @@ static int sdhci_acpi_runtime_resume(struct device *dev)
 	return 0;
 }
 
-#endif
-
 static const struct dev_pm_ops sdhci_acpi_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(sdhci_acpi_suspend, sdhci_acpi_resume)
-	SET_RUNTIME_PM_OPS(sdhci_acpi_runtime_suspend,
-			sdhci_acpi_runtime_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(sdhci_acpi_suspend, sdhci_acpi_resume)
+	RUNTIME_PM_OPS(sdhci_acpi_runtime_suspend, sdhci_acpi_runtime_resume, NULL)
 };
 
 static struct platform_driver sdhci_acpi_driver = {
@@ -1058,7 +1048,7 @@ static struct platform_driver sdhci_acpi_driver = {
 		.name			= "sdhci-acpi",
 		.probe_type		= PROBE_PREFER_ASYNCHRONOUS,
 		.acpi_match_table	= sdhci_acpi_ids,
-		.pm			= &sdhci_acpi_pm_ops,
+		.pm			= pm_ptr(&sdhci_acpi_pm_ops),
 	},
 	.probe	= sdhci_acpi_probe,
 	.remove = sdhci_acpi_remove,
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 16/38] mmc: sdhci_am654: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (14 preceding siblings ...)
  2025-08-15  1:33 ` [PATCH 15/38] mmc: sdhci-acpi: " Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-15  1:33 ` [PATCH 17/38] mmc: sdhci-brcmstb: " Jisheng Zhang
                   ` (22 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/sdhci_am654.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/host/sdhci_am654.c b/drivers/mmc/host/sdhci_am654.c
index e4fc345be7e5..48bf5532e571 100644
--- a/drivers/mmc/host/sdhci_am654.c
+++ b/drivers/mmc/host/sdhci_am654.c
@@ -1018,7 +1018,6 @@ static void sdhci_am654_remove(struct platform_device *pdev)
 	pm_runtime_put_noidle(dev);
 }
 
-#ifdef CONFIG_PM
 static int sdhci_am654_restore(struct sdhci_host *host)
 {
 	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -1106,20 +1105,17 @@ static int sdhci_am654_runtime_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops sdhci_am654_dev_pm_ops = {
-	SET_RUNTIME_PM_OPS(sdhci_am654_runtime_suspend,
-			   sdhci_am654_runtime_resume, NULL)
-	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-				pm_runtime_force_resume)
+	RUNTIME_PM_OPS(sdhci_am654_runtime_suspend, sdhci_am654_runtime_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
 };
 
 static struct platform_driver sdhci_am654_driver = {
 	.driver = {
 		.name = "sdhci-am654",
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
-		.pm = &sdhci_am654_dev_pm_ops,
+		.pm = pm_ptr(&sdhci_am654_dev_pm_ops),
 		.of_match_table = sdhci_am654_of_match,
 	},
 	.probe = sdhci_am654_probe,
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 17/38] mmc: sdhci-brcmstb: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (15 preceding siblings ...)
  2025-08-15  1:33 ` [PATCH 16/38] mmc: sdhci_am654: " Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-15  1:33 ` [PATCH 18/38] mmc: sdhci-esdhc-imx: " Jisheng Zhang
                   ` (21 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/sdhci-brcmstb.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/sdhci-brcmstb.c b/drivers/mmc/host/sdhci-brcmstb.c
index efc2f3bdc631..15705e85417f 100644
--- a/drivers/mmc/host/sdhci-brcmstb.c
+++ b/drivers/mmc/host/sdhci-brcmstb.c
@@ -496,7 +496,6 @@ static void sdhci_brcmstb_shutdown(struct platform_device *pdev)
 
 MODULE_DEVICE_TABLE(of, sdhci_brcm_of_match);
 
-#ifdef CONFIG_PM_SLEEP
 static int sdhci_brcmstb_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
@@ -540,17 +539,14 @@ static int sdhci_brcmstb_resume(struct device *dev)
 
 	return ret;
 }
-#endif
 
-static const struct dev_pm_ops sdhci_brcmstb_pmops = {
-	SET_SYSTEM_SLEEP_PM_OPS(sdhci_brcmstb_suspend, sdhci_brcmstb_resume)
-};
+static DEFINE_SIMPLE_DEV_PM_OPS(sdhci_brcmstb_pmops, sdhci_brcmstb_suspend, sdhci_brcmstb_resume);
 
 static struct platform_driver sdhci_brcmstb_driver = {
 	.driver		= {
 		.name	= "sdhci-brcmstb",
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
-		.pm	= &sdhci_brcmstb_pmops,
+		.pm	= pm_sleep_ptr(&sdhci_brcmstb_pmops),
 		.of_match_table = of_match_ptr(sdhci_brcm_of_match),
 	},
 	.probe		= sdhci_brcmstb_probe,
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 18/38] mmc: sdhci-esdhc-imx: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (16 preceding siblings ...)
  2025-08-15  1:33 ` [PATCH 17/38] mmc: sdhci-brcmstb: " Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-15  3:23   ` Bough Chen
  2025-08-15  1:33 ` [PATCH 19/38] mmc: sdhci-of-arasan: " Jisheng Zhang
                   ` (20 subsequent siblings)
  38 siblings, 1 reply; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/sdhci-esdhc-imx.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index a040c0896a7b..a7a5df673b0f 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -1650,7 +1650,6 @@ static void sdhci_esdhc_imx_hwinit(struct sdhci_host *host)
 	}
 }
 
-#ifdef CONFIG_PM_SLEEP
 static void sdhc_esdhc_tuning_save(struct sdhci_host *host)
 {
 	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -1707,7 +1706,6 @@ static void sdhc_esdhc_tuning_restore(struct sdhci_host *host)
 		       host->ioaddr + ESDHC_TUNE_CTRL_STATUS);
 	}
 }
-#endif
 
 static void esdhc_cqe_enable(struct mmc_host *mmc)
 {
@@ -2016,7 +2014,6 @@ static void sdhci_esdhc_imx_remove(struct platform_device *pdev)
 		cpu_latency_qos_remove_request(&imx_data->pm_qos_req);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int sdhci_esdhc_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
@@ -2112,9 +2109,7 @@ static int sdhci_esdhc_resume(struct device *dev)
 
 	return ret;
 }
-#endif
 
-#ifdef CONFIG_PM
 static int sdhci_esdhc_runtime_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
@@ -2188,12 +2183,10 @@ static int sdhci_esdhc_runtime_resume(struct device *dev)
 		cpu_latency_qos_remove_request(&imx_data->pm_qos_req);
 	return err;
 }
-#endif
 
 static const struct dev_pm_ops sdhci_esdhc_pmops = {
-	SET_SYSTEM_SLEEP_PM_OPS(sdhci_esdhc_suspend, sdhci_esdhc_resume)
-	SET_RUNTIME_PM_OPS(sdhci_esdhc_runtime_suspend,
-				sdhci_esdhc_runtime_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(sdhci_esdhc_suspend, sdhci_esdhc_resume)
+	RUNTIME_PM_OPS(sdhci_esdhc_runtime_suspend, sdhci_esdhc_runtime_resume, NULL)
 };
 
 static struct platform_driver sdhci_esdhc_imx_driver = {
@@ -2201,7 +2194,7 @@ static struct platform_driver sdhci_esdhc_imx_driver = {
 		.name	= "sdhci-esdhc-imx",
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 		.of_match_table = imx_esdhc_dt_ids,
-		.pm	= &sdhci_esdhc_pmops,
+		.pm	= pm_ptr(&sdhci_esdhc_pmops),
 	},
 	.probe		= sdhci_esdhc_imx_probe,
 	.remove		= sdhci_esdhc_imx_remove,
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 19/38] mmc: sdhci-of-arasan: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (17 preceding siblings ...)
  2025-08-15  1:33 ` [PATCH 18/38] mmc: sdhci-esdhc-imx: " Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-15  1:33 ` [PATCH 20/38] mmc: sdhci-of-at91: " Jisheng Zhang
                   ` (19 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/sdhci-of-arasan.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
index 42878474e56e..d0939b5bc1a6 100644
--- a/drivers/mmc/host/sdhci-of-arasan.c
+++ b/drivers/mmc/host/sdhci-of-arasan.c
@@ -581,7 +581,6 @@ static const struct sdhci_pltfm_data sdhci_arasan_cqe_pdata = {
 			SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN,
 };
 
-#ifdef CONFIG_PM_SLEEP
 /**
  * sdhci_arasan_suspend - Suspend method for the driver
  * @dev:	Address of the device structure
@@ -675,10 +674,9 @@ static int sdhci_arasan_resume(struct device *dev)
 
 	return 0;
 }
-#endif /* ! CONFIG_PM_SLEEP */
 
-static SIMPLE_DEV_PM_OPS(sdhci_arasan_dev_pm_ops, sdhci_arasan_suspend,
-			 sdhci_arasan_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(sdhci_arasan_dev_pm_ops, sdhci_arasan_suspend,
+				sdhci_arasan_resume);
 
 /**
  * sdhci_arasan_sdcardclk_recalc_rate - Return the card clock rate
@@ -2051,7 +2049,7 @@ static struct platform_driver sdhci_arasan_driver = {
 		.name = "sdhci-arasan",
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 		.of_match_table = sdhci_arasan_of_match,
-		.pm = &sdhci_arasan_dev_pm_ops,
+		.pm = pm_sleep_ptr(&sdhci_arasan_dev_pm_ops),
 	},
 	.probe = sdhci_arasan_probe,
 	.remove = sdhci_arasan_remove,
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 20/38] mmc: sdhci-of-at91: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (18 preceding siblings ...)
  2025-08-15  1:33 ` [PATCH 19/38] mmc: sdhci-of-arasan: " Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-15  1:33 ` [PATCH 21/38] mmc: sdhci-of-esdhc: " Jisheng Zhang
                   ` (18 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/sdhci-of-at91.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-at91.c b/drivers/mmc/host/sdhci-of-at91.c
index 1ba2effaf376..7c4ac65f247d 100644
--- a/drivers/mmc/host/sdhci-of-at91.c
+++ b/drivers/mmc/host/sdhci-of-at91.c
@@ -229,7 +229,6 @@ static int sdhci_at91_set_clks_presets(struct device *dev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int sdhci_at91_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
@@ -243,9 +242,7 @@ static int sdhci_at91_suspend(struct device *dev)
 
 	return ret;
 }
-#endif /* CONFIG_PM_SLEEP */
 
-#ifdef CONFIG_PM
 static int sdhci_at91_runtime_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
@@ -302,13 +299,10 @@ static int sdhci_at91_runtime_resume(struct device *dev)
 	sdhci_runtime_resume_host(host, 0);
 	return 0;
 }
-#endif /* CONFIG_PM */
 
 static const struct dev_pm_ops sdhci_at91_dev_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(sdhci_at91_suspend, pm_runtime_force_resume)
-	SET_RUNTIME_PM_OPS(sdhci_at91_runtime_suspend,
-			   sdhci_at91_runtime_resume,
-			   NULL)
+	SYSTEM_SLEEP_PM_OPS(sdhci_at91_suspend, pm_runtime_force_resume)
+	RUNTIME_PM_OPS(sdhci_at91_runtime_suspend, sdhci_at91_runtime_resume, NULL)
 };
 
 static int sdhci_at91_probe(struct platform_device *pdev)
@@ -460,7 +454,7 @@ static struct platform_driver sdhci_at91_driver = {
 		.name	= "sdhci-at91",
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 		.of_match_table = sdhci_at91_dt_match,
-		.pm	= &sdhci_at91_dev_pm_ops,
+		.pm	= pm_ptr(&sdhci_at91_dev_pm_ops),
 	},
 	.probe		= sdhci_at91_probe,
 	.remove		= sdhci_at91_remove,
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 21/38] mmc: sdhci-of-esdhc: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (19 preceding siblings ...)
  2025-08-15  1:33 ` [PATCH 20/38] mmc: sdhci-of-at91: " Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-15  1:33 ` [PATCH 22/38] mmc: sdhci-omap: " Jisheng Zhang
                   ` (17 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/sdhci-of-esdhc.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
index c6ee0099ead0..8345e2c5a034 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -1234,7 +1234,6 @@ static u32 esdhc_irq(struct sdhci_host *host, u32 intmask)
 	return intmask;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static u32 esdhc_proctl;
 static int esdhc_of_suspend(struct device *dev)
 {
@@ -1260,11 +1259,8 @@ static int esdhc_of_resume(struct device *dev)
 	}
 	return ret;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(esdhc_of_dev_pm_ops,
-			esdhc_of_suspend,
-			esdhc_of_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(esdhc_of_dev_pm_ops, esdhc_of_suspend, esdhc_of_resume);
 
 static const struct sdhci_ops sdhci_esdhc_be_ops = {
 	.read_l = esdhc_be_readl,
@@ -1511,7 +1507,7 @@ static struct platform_driver sdhci_esdhc_driver = {
 		.name = "sdhci-esdhc",
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 		.of_match_table = sdhci_esdhc_of_match,
-		.pm = &esdhc_of_dev_pm_ops,
+		.pm = pm_sleep_ptr(&esdhc_of_dev_pm_ops),
 	},
 	.probe = sdhci_esdhc_probe,
 	.remove = sdhci_pltfm_remove,
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 22/38] mmc: sdhci-omap: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (20 preceding siblings ...)
  2025-08-15  1:33 ` [PATCH 21/38] mmc: sdhci-of-esdhc: " Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-15  1:33 ` [PATCH 23/38] mmc: sdhci-cadence: " Jisheng Zhang
                   ` (16 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/sdhci-omap.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c
index cdb09605e009..b5d7c1a80a92 100644
--- a/drivers/mmc/host/sdhci-omap.c
+++ b/drivers/mmc/host/sdhci-omap.c
@@ -1400,8 +1400,7 @@ static void sdhci_omap_remove(struct platform_device *pdev)
 	pm_runtime_force_suspend(dev);
 }
 
-#ifdef CONFIG_PM
-static void __maybe_unused sdhci_omap_context_save(struct sdhci_omap_host *omap_host)
+static void sdhci_omap_context_save(struct sdhci_omap_host *omap_host)
 {
 	omap_host->con = sdhci_omap_readl(omap_host, SDHCI_OMAP_CON);
 	omap_host->hctl = sdhci_omap_readl(omap_host, SDHCI_OMAP_HCTL);
@@ -1412,7 +1411,7 @@ static void __maybe_unused sdhci_omap_context_save(struct sdhci_omap_host *omap_
 }
 
 /* Order matters here, HCTL must be restored in two phases */
-static void __maybe_unused sdhci_omap_context_restore(struct sdhci_omap_host *omap_host)
+static void sdhci_omap_context_restore(struct sdhci_omap_host *omap_host)
 {
 	sdhci_omap_writel(omap_host, SDHCI_OMAP_HCTL, omap_host->hctl);
 	sdhci_omap_writel(omap_host, SDHCI_OMAP_CAPA, omap_host->capa);
@@ -1424,7 +1423,7 @@ static void __maybe_unused sdhci_omap_context_restore(struct sdhci_omap_host *om
 	sdhci_omap_writel(omap_host, SDHCI_OMAP_ISE, omap_host->ise);
 }
 
-static int __maybe_unused sdhci_omap_runtime_suspend(struct device *dev)
+static int sdhci_omap_runtime_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
 	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -1443,7 +1442,7 @@ static int __maybe_unused sdhci_omap_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused sdhci_omap_runtime_resume(struct device *dev)
+static int sdhci_omap_runtime_resume(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
 	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -1458,13 +1457,10 @@ static int __maybe_unused sdhci_omap_runtime_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops sdhci_omap_dev_pm_ops = {
-	SET_RUNTIME_PM_OPS(sdhci_omap_runtime_suspend,
-			   sdhci_omap_runtime_resume, NULL)
-	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-				pm_runtime_force_resume)
+	RUNTIME_PM_OPS(sdhci_omap_runtime_suspend, sdhci_omap_runtime_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
 };
 
 static struct platform_driver sdhci_omap_driver = {
@@ -1473,7 +1469,7 @@ static struct platform_driver sdhci_omap_driver = {
 	.driver = {
 		   .name = "sdhci-omap",
 		   .probe_type = PROBE_PREFER_ASYNCHRONOUS,
-		   .pm = &sdhci_omap_dev_pm_ops,
+		   .pm = pm_ptr(&sdhci_omap_dev_pm_ops),
 		   .of_match_table = omap_sdhci_match,
 		  },
 };
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 23/38] mmc: sdhci-cadence: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (21 preceding siblings ...)
  2025-08-15  1:33 ` [PATCH 22/38] mmc: sdhci-omap: " Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-15  1:33 ` [PATCH 24/38] mmc: sdhci-s3c: " Jisheng Zhang
                   ` (15 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/sdhci-cadence.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/sdhci-cadence.c b/drivers/mmc/host/sdhci-cadence.c
index 2d823e158c59..60a297628b06 100644
--- a/drivers/mmc/host/sdhci-cadence.c
+++ b/drivers/mmc/host/sdhci-cadence.c
@@ -551,7 +551,6 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
 	return sdhci_add_host(host);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int sdhci_cdns_resume(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
@@ -578,11 +577,8 @@ static int sdhci_cdns_resume(struct device *dev)
 
 	return ret;
 }
-#endif
 
-static const struct dev_pm_ops sdhci_cdns_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(sdhci_pltfm_suspend, sdhci_cdns_resume)
-};
+static DEFINE_SIMPLE_DEV_PM_OPS(sdhci_cdns_pm_ops, sdhci_pltfm_suspend, sdhci_cdns_resume);
 
 static const struct of_device_id sdhci_cdns_match[] = {
 	{
@@ -606,7 +602,7 @@ static struct platform_driver sdhci_cdns_driver = {
 	.driver = {
 		.name = "sdhci-cdns",
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
-		.pm = &sdhci_cdns_pm_ops,
+		.pm = pm_sleep_ptr(&sdhci_cdns_pm_ops),
 		.of_match_table = sdhci_cdns_match,
 	},
 	.probe = sdhci_cdns_probe,
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 24/38] mmc: sdhci-s3c: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (22 preceding siblings ...)
  2025-08-15  1:33 ` [PATCH 23/38] mmc: sdhci-cadence: " Jisheng Zhang
@ 2025-08-15  1:33 ` Jisheng Zhang
  2025-08-15  1:34 ` [PATCH 25/38] mmc: sdhci-spear: " Jisheng Zhang
                   ` (14 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:33 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/sdhci-s3c.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 40857fc2e21b..6bf66aaa86a6 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -681,7 +681,6 @@ static void sdhci_s3c_remove(struct platform_device *pdev)
 	clk_disable_unprepare(sc->clk_io);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int sdhci_s3c_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
@@ -698,9 +697,7 @@ static int sdhci_s3c_resume(struct device *dev)
 
 	return sdhci_resume_host(host);
 }
-#endif
 
-#ifdef CONFIG_PM
 static int sdhci_s3c_runtime_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
@@ -730,12 +727,10 @@ static int sdhci_s3c_runtime_resume(struct device *dev)
 	sdhci_runtime_resume_host(host, 0);
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops sdhci_s3c_pmops = {
-	SET_SYSTEM_SLEEP_PM_OPS(sdhci_s3c_suspend, sdhci_s3c_resume)
-	SET_RUNTIME_PM_OPS(sdhci_s3c_runtime_suspend, sdhci_s3c_runtime_resume,
-			   NULL)
+	SYSTEM_SLEEP_PM_OPS(sdhci_s3c_suspend, sdhci_s3c_resume)
+	RUNTIME_PM_OPS(sdhci_s3c_runtime_suspend, sdhci_s3c_runtime_resume, NULL)
 };
 
 static const struct platform_device_id sdhci_s3c_driver_ids[] = {
@@ -770,7 +765,7 @@ static struct platform_driver sdhci_s3c_driver = {
 		.name	= "s3c-sdhci",
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 		.of_match_table = of_match_ptr(sdhci_s3c_dt_match),
-		.pm	= &sdhci_s3c_pmops,
+		.pm	= pm_ptr(&sdhci_s3c_pmops),
 	},
 };
 
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 25/38] mmc: sdhci-spear: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (23 preceding siblings ...)
  2025-08-15  1:33 ` [PATCH 24/38] mmc: sdhci-s3c: " Jisheng Zhang
@ 2025-08-15  1:34 ` Jisheng Zhang
  2025-08-18  6:38   ` Viresh Kumar
  2025-08-15  1:34 ` [PATCH 26/38] mmc: sdhci-sprd: " Jisheng Zhang
                   ` (13 subsequent siblings)
  38 siblings, 1 reply; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:34 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/sdhci-spear.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
index fa0f8aeb7ee0..72d21dc0cb69 100644
--- a/drivers/mmc/host/sdhci-spear.c
+++ b/drivers/mmc/host/sdhci-spear.c
@@ -130,7 +130,6 @@ static void sdhci_remove(struct platform_device *pdev)
 	clk_disable_unprepare(sdhci->clk);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int sdhci_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
@@ -161,9 +160,8 @@ static int sdhci_resume(struct device *dev)
 
 	return sdhci_resume_host(host);
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(sdhci_pm_ops, sdhci_suspend, sdhci_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(sdhci_pm_ops, sdhci_suspend, sdhci_resume);
 
 static const struct of_device_id sdhci_spear_id_table[] = {
 	{ .compatible = "st,spear300-sdhci" },
@@ -175,7 +173,7 @@ static struct platform_driver sdhci_driver = {
 	.driver = {
 		.name	= "sdhci",
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
-		.pm	= &sdhci_pm_ops,
+		.pm	= pm_sleep_ptr(&sdhci_pm_ops),
 		.of_match_table = sdhci_spear_id_table,
 	},
 	.probe		= sdhci_probe,
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 26/38] mmc: sdhci-sprd: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (24 preceding siblings ...)
  2025-08-15  1:34 ` [PATCH 25/38] mmc: sdhci-spear: " Jisheng Zhang
@ 2025-08-15  1:34 ` Jisheng Zhang
  2025-08-15  1:34 ` [PATCH 27/38] mmc: sdhci-st: " Jisheng Zhang
                   ` (12 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:34 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/sdhci-sprd.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
index fe2fe52b23b2..3584a2b314a9 100644
--- a/drivers/mmc/host/sdhci-sprd.c
+++ b/drivers/mmc/host/sdhci-sprd.c
@@ -903,7 +903,6 @@ static const struct of_device_id sdhci_sprd_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, sdhci_sprd_of_match);
 
-#ifdef CONFIG_PM
 static int sdhci_sprd_runtime_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
@@ -950,13 +949,10 @@ static int sdhci_sprd_runtime_resume(struct device *dev)
 
 	return ret;
 }
-#endif
 
 static const struct dev_pm_ops sdhci_sprd_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-				pm_runtime_force_resume)
-	SET_RUNTIME_PM_OPS(sdhci_sprd_runtime_suspend,
-			   sdhci_sprd_runtime_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
+	RUNTIME_PM_OPS(sdhci_sprd_runtime_suspend, sdhci_sprd_runtime_resume, NULL)
 };
 
 static struct platform_driver sdhci_sprd_driver = {
@@ -966,7 +962,7 @@ static struct platform_driver sdhci_sprd_driver = {
 		.name = "sdhci_sprd_r11",
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 		.of_match_table = sdhci_sprd_of_match,
-		.pm = &sdhci_sprd_pm_ops,
+		.pm = pm_ptr(&sdhci_sprd_pm_ops),
 	},
 };
 module_platform_driver(sdhci_sprd_driver);
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 27/38] mmc: sdhci-st: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (25 preceding siblings ...)
  2025-08-15  1:34 ` [PATCH 26/38] mmc: sdhci-sprd: " Jisheng Zhang
@ 2025-08-15  1:34 ` Jisheng Zhang
  2025-08-18  8:49   ` Patrice CHOTARD
  2025-08-15  1:34 ` [PATCH 28/38] mmc: sdhci-tegra: " Jisheng Zhang
                   ` (11 subsequent siblings)
  38 siblings, 1 reply; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:34 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/sdhci-st.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sdhci-st.c b/drivers/mmc/host/sdhci-st.c
index 9157342ff7a4..bf6685805137 100644
--- a/drivers/mmc/host/sdhci-st.c
+++ b/drivers/mmc/host/sdhci-st.c
@@ -445,7 +445,6 @@ static void sdhci_st_remove(struct platform_device *pdev)
 	reset_control_assert(rstc);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int sdhci_st_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
@@ -492,9 +491,8 @@ static int sdhci_st_resume(struct device *dev)
 
 	return sdhci_resume_host(host);
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(sdhci_st_pmops, sdhci_st_suspend, sdhci_st_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(sdhci_st_pmops, sdhci_st_suspend, sdhci_st_resume);
 
 static const struct of_device_id st_sdhci_match[] = {
 	{ .compatible = "st,sdhci" },
@@ -509,7 +507,7 @@ static struct platform_driver sdhci_st_driver = {
 	.driver = {
 		   .name = "sdhci-st",
 		   .probe_type = PROBE_PREFER_ASYNCHRONOUS,
-		   .pm = &sdhci_st_pmops,
+		   .pm = pm_sleep_ptr(&sdhci_st_pmops),
 		   .of_match_table = st_sdhci_match,
 		  },
 };
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 28/38] mmc: sdhci-tegra: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (26 preceding siblings ...)
  2025-08-15  1:34 ` [PATCH 27/38] mmc: sdhci-st: " Jisheng Zhang
@ 2025-08-15  1:34 ` Jisheng Zhang
  2025-08-15  1:34 ` [PATCH 29/38] mmc: sh_mmicf: " Jisheng Zhang
                   ` (10 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:34 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/sdhci-tegra.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index c811297185d8..820ce4dae58b 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -1831,7 +1831,7 @@ static void sdhci_tegra_remove(struct platform_device *pdev)
 	clk_disable_unprepare(tegra_host->tmclk);
 }
 
-static int __maybe_unused sdhci_tegra_runtime_suspend(struct device *dev)
+static int sdhci_tegra_runtime_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
 	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -1841,7 +1841,7 @@ static int __maybe_unused sdhci_tegra_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused sdhci_tegra_runtime_resume(struct device *dev)
+static int sdhci_tegra_runtime_resume(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
 	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -1849,7 +1849,6 @@ static int __maybe_unused sdhci_tegra_runtime_resume(struct device *dev)
 	return clk_prepare_enable(pltfm_host->clk);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int sdhci_tegra_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
@@ -1910,12 +1909,10 @@ static int sdhci_tegra_resume(struct device *dev)
 	pm_runtime_force_suspend(dev);
 	return ret;
 }
-#endif
 
 static const struct dev_pm_ops sdhci_tegra_dev_pm_ops = {
-	SET_RUNTIME_PM_OPS(sdhci_tegra_runtime_suspend, sdhci_tegra_runtime_resume,
-			   NULL)
-	SET_SYSTEM_SLEEP_PM_OPS(sdhci_tegra_suspend, sdhci_tegra_resume)
+	RUNTIME_PM_OPS(sdhci_tegra_runtime_suspend, sdhci_tegra_runtime_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(sdhci_tegra_suspend, sdhci_tegra_resume)
 };
 
 static struct platform_driver sdhci_tegra_driver = {
@@ -1923,7 +1920,7 @@ static struct platform_driver sdhci_tegra_driver = {
 		.name	= "sdhci-tegra",
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 		.of_match_table = sdhci_tegra_dt_match,
-		.pm	= &sdhci_tegra_dev_pm_ops,
+		.pm	= pm_ptr(&sdhci_tegra_dev_pm_ops),
 	},
 	.probe		= sdhci_tegra_probe,
 	.remove		= sdhci_tegra_remove,
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 29/38] mmc: sh_mmicf: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (27 preceding siblings ...)
  2025-08-15  1:34 ` [PATCH 28/38] mmc: sdhci-tegra: " Jisheng Zhang
@ 2025-08-15  1:34 ` Jisheng Zhang
  2025-08-15  1:34 ` [PATCH 30/38] mmc: toshsd: " Jisheng Zhang
                   ` (9 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:34 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/sh_mmcif.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 19f84584ecfa..413c34585c90 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -1568,7 +1568,6 @@ static void sh_mmcif_remove(struct platform_device *pdev)
 	pm_runtime_disable(&pdev->dev);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int sh_mmcif_suspend(struct device *dev)
 {
 	struct sh_mmcif_host *host = dev_get_drvdata(dev);
@@ -1584,11 +1583,8 @@ static int sh_mmcif_resume(struct device *dev)
 {
 	return 0;
 }
-#endif
 
-static const struct dev_pm_ops sh_mmcif_dev_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(sh_mmcif_suspend, sh_mmcif_resume)
-};
+static DEFINE_SIMPLE_DEV_PM_OPS(sh_mmcif_dev_pm_ops, sh_mmcif_suspend, sh_mmcif_resume);
 
 static struct platform_driver sh_mmcif_driver = {
 	.probe		= sh_mmcif_probe,
@@ -1596,7 +1592,7 @@ static struct platform_driver sh_mmcif_driver = {
 	.driver		= {
 		.name	= DRIVER_NAME,
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
-		.pm	= &sh_mmcif_dev_pm_ops,
+		.pm	= pm_sleep_ptr(&sh_mmcif_dev_pm_ops),
 		.of_match_table = sh_mmcif_of_match,
 	},
 };
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 30/38] mmc: toshsd: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (28 preceding siblings ...)
  2025-08-15  1:34 ` [PATCH 29/38] mmc: sh_mmicf: " Jisheng Zhang
@ 2025-08-15  1:34 ` Jisheng Zhang
  2025-08-15  1:34 ` [PATCH 31/38] mmc: wmt-sdmmc: " Jisheng Zhang
                   ` (8 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:34 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/toshsd.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/toshsd.c b/drivers/mmc/host/toshsd.c
index e5f7f8abafc0..aa5d2511a62b 100644
--- a/drivers/mmc/host/toshsd.c
+++ b/drivers/mmc/host/toshsd.c
@@ -567,7 +567,6 @@ static void toshsd_powerdown(struct toshsd_host *host)
 	pci_write_config_byte(host->pdev, SD_PCICFG_CLKSTOP, 0);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int toshsd_pm_suspend(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
@@ -599,7 +598,6 @@ static int toshsd_pm_resume(struct device *dev)
 
 	return 0;
 }
-#endif /* CONFIG_PM_SLEEP */
 
 static int toshsd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
@@ -688,16 +686,14 @@ static void toshsd_remove(struct pci_dev *pdev)
 	pci_disable_device(pdev);
 }
 
-static const struct dev_pm_ops toshsd_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(toshsd_pm_suspend, toshsd_pm_resume)
-};
+static DEFINE_SIMPLE_DEV_PM_OPS(toshsd_pm_ops, toshsd_pm_suspend, toshsd_pm_resume);
 
 static struct pci_driver toshsd_driver = {
 	.name = DRIVER_NAME,
 	.id_table = pci_ids,
 	.probe = toshsd_probe,
 	.remove = toshsd_remove,
-	.driver.pm = &toshsd_pm_ops,
+	.driver.pm = pm_sleep_ptr(&toshsd_pm_ops),
 };
 
 module_pci_driver(toshsd_driver);
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 31/38] mmc: wmt-sdmmc: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (29 preceding siblings ...)
  2025-08-15  1:34 ` [PATCH 30/38] mmc: toshsd: " Jisheng Zhang
@ 2025-08-15  1:34 ` Jisheng Zhang
  2025-08-15  1:34 ` [PATCH 32/38] mmc: mtk-sd: " Jisheng Zhang
                   ` (7 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:34 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/wmt-sdmmc.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/mmc/host/wmt-sdmmc.c b/drivers/mmc/host/wmt-sdmmc.c
index 0d2929cfe397..1b1d691e19fc 100644
--- a/drivers/mmc/host/wmt-sdmmc.c
+++ b/drivers/mmc/host/wmt-sdmmc.c
@@ -911,7 +911,6 @@ static void wmt_mci_remove(struct platform_device *pdev)
 	dev_info(&pdev->dev, "WMT MCI device removed\n");
 }
 
-#ifdef CONFIG_PM
 static int wmt_mci_suspend(struct device *dev)
 {
 	u32 reg_tmp;
@@ -963,18 +962,7 @@ static int wmt_mci_resume(struct device *dev)
 	return 0;
 }
 
-static const struct dev_pm_ops wmt_mci_pm = {
-	.suspend        = wmt_mci_suspend,
-	.resume         = wmt_mci_resume,
-};
-
-#define wmt_mci_pm_ops (&wmt_mci_pm)
-
-#else	/* !CONFIG_PM */
-
-#define wmt_mci_pm_ops NULL
-
-#endif
+static DEFINE_SIMPLE_DEV_PM_OPS(wmt_mci_pm_ops, wmt_mci_suspend, wmt_mci_resume);
 
 static struct platform_driver wmt_mci_driver = {
 	.probe = wmt_mci_probe,
@@ -982,7 +970,7 @@ static struct platform_driver wmt_mci_driver = {
 	.driver = {
 		.name = DRIVER_NAME,
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
-		.pm = wmt_mci_pm_ops,
+		.pm = pm_sleep_ptr(&wmt_mci_pm_ops),
 		.of_match_table = wmt_mci_dt_ids,
 	},
 };
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 32/38] mmc: mtk-sd: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (30 preceding siblings ...)
  2025-08-15  1:34 ` [PATCH 31/38] mmc: wmt-sdmmc: " Jisheng Zhang
@ 2025-08-15  1:34 ` Jisheng Zhang
  2025-08-15  1:34 ` [PATCH 33/38] mmc: sdhci-msm: " Jisheng Zhang
                   ` (6 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:34 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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 __maybe_unused.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/mmc/host/mtk-sd.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
index d7020e06dd55..79074291e9d2 100644
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -3278,7 +3278,7 @@ static void msdc_restore_reg(struct msdc_host *host)
 		__msdc_enable_sdio_irq(host, 1);
 }
 
-static int __maybe_unused msdc_runtime_suspend(struct device *dev)
+static int msdc_runtime_suspend(struct device *dev)
 {
 	struct mmc_host *mmc = dev_get_drvdata(dev);
 	struct msdc_host *host = mmc_priv(mmc);
@@ -3300,7 +3300,7 @@ static int __maybe_unused msdc_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused msdc_runtime_resume(struct device *dev)
+static int msdc_runtime_resume(struct device *dev)
 {
 	struct mmc_host *mmc = dev_get_drvdata(dev);
 	struct msdc_host *host = mmc_priv(mmc);
@@ -3323,7 +3323,7 @@ static int __maybe_unused msdc_runtime_resume(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused msdc_suspend(struct device *dev)
+static int msdc_suspend(struct device *dev)
 {
 	struct mmc_host *mmc = dev_get_drvdata(dev);
 	struct msdc_host *host = mmc_priv(mmc);
@@ -3348,7 +3348,7 @@ static int __maybe_unused msdc_suspend(struct device *dev)
 	return pm_runtime_force_suspend(dev);
 }
 
-static int __maybe_unused msdc_resume(struct device *dev)
+static int msdc_resume(struct device *dev)
 {
 	struct mmc_host *mmc = dev_get_drvdata(dev);
 	struct msdc_host *host = mmc_priv(mmc);
@@ -3360,8 +3360,8 @@ static int __maybe_unused msdc_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops msdc_dev_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(msdc_suspend, msdc_resume)
-	SET_RUNTIME_PM_OPS(msdc_runtime_suspend, msdc_runtime_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(msdc_suspend, msdc_resume)
+	RUNTIME_PM_OPS(msdc_runtime_suspend, msdc_runtime_resume, NULL)
 };
 
 static struct platform_driver mt_msdc_driver = {
@@ -3371,7 +3371,7 @@ static struct platform_driver mt_msdc_driver = {
 		.name = "mtk-msdc",
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 		.of_match_table = msdc_of_ids,
-		.pm = &msdc_dev_pm_ops,
+		.pm = pm_ptr(&msdc_dev_pm_ops),
 	},
 };
 
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 33/38] mmc: sdhci-msm: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (31 preceding siblings ...)
  2025-08-15  1:34 ` [PATCH 32/38] mmc: mtk-sd: " Jisheng Zhang
@ 2025-08-15  1:34 ` Jisheng Zhang
  2025-08-15  1:34 ` [PATCH 34/38] mmc: via-sdmmc: " Jisheng Zhang
                   ` (5 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:34 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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 __maybe_unused.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/mmc/host/sdhci-msm.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index 9d8e20dc8ca1..d2906bf6e598 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -1943,7 +1943,7 @@ static void sdhci_msm_ice_enable(struct sdhci_msm_host *msm_host)
 		qcom_ice_enable(msm_host->ice);
 }
 
-static __maybe_unused int sdhci_msm_ice_resume(struct sdhci_msm_host *msm_host)
+static int sdhci_msm_ice_resume(struct sdhci_msm_host *msm_host)
 {
 	if (msm_host->mmc->caps2 & MMC_CAP2_CRYPTO)
 		return qcom_ice_resume(msm_host->ice);
@@ -1951,7 +1951,7 @@ static __maybe_unused int sdhci_msm_ice_resume(struct sdhci_msm_host *msm_host)
 	return 0;
 }
 
-static __maybe_unused int sdhci_msm_ice_suspend(struct sdhci_msm_host *msm_host)
+static int sdhci_msm_ice_suspend(struct sdhci_msm_host *msm_host)
 {
 	if (msm_host->mmc->caps2 & MMC_CAP2_CRYPTO)
 		return qcom_ice_suspend(msm_host->ice);
@@ -2011,13 +2011,13 @@ static inline void sdhci_msm_ice_enable(struct sdhci_msm_host *msm_host)
 {
 }
 
-static inline __maybe_unused int
+static inline int
 sdhci_msm_ice_resume(struct sdhci_msm_host *msm_host)
 {
 	return 0;
 }
 
-static inline __maybe_unused int
+static inline int
 sdhci_msm_ice_suspend(struct sdhci_msm_host *msm_host)
 {
 	return 0;
@@ -2801,7 +2801,7 @@ static void sdhci_msm_remove(struct platform_device *pdev)
 		clk_disable_unprepare(msm_host->bus_clk);
 }
 
-static __maybe_unused int sdhci_msm_runtime_suspend(struct device *dev)
+static int sdhci_msm_runtime_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
 	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -2820,7 +2820,7 @@ static __maybe_unused int sdhci_msm_runtime_suspend(struct device *dev)
 	return sdhci_msm_ice_suspend(msm_host);
 }
 
-static __maybe_unused int sdhci_msm_runtime_resume(struct device *dev)
+static int sdhci_msm_runtime_resume(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
 	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -2856,11 +2856,8 @@ static __maybe_unused int sdhci_msm_runtime_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops sdhci_msm_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-				pm_runtime_force_resume)
-	SET_RUNTIME_PM_OPS(sdhci_msm_runtime_suspend,
-			   sdhci_msm_runtime_resume,
-			   NULL)
+	SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
+	RUNTIME_PM_OPS(sdhci_msm_runtime_suspend, sdhci_msm_runtime_resume, NULL)
 };
 
 static struct platform_driver sdhci_msm_driver = {
@@ -2869,7 +2866,7 @@ static struct platform_driver sdhci_msm_driver = {
 	.driver = {
 		   .name = "sdhci_msm",
 		   .of_match_table = sdhci_msm_dt_match,
-		   .pm = &sdhci_msm_pm_ops,
+		   .pm = pm_ptr(&sdhci_msm_pm_ops),
 		   .probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	},
 };
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 34/38] mmc: via-sdmmc: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (32 preceding siblings ...)
  2025-08-15  1:34 ` [PATCH 33/38] mmc: sdhci-msm: " Jisheng Zhang
@ 2025-08-15  1:34 ` Jisheng Zhang
  2025-08-15  1:34 ` [PATCH 35/38] mmc: dw_mmc: exynos: " Jisheng Zhang
                   ` (4 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:34 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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 __maybe_unused.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/mmc/host/via-sdmmc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/via-sdmmc.c b/drivers/mmc/host/via-sdmmc.c
index 3bd49f64899d..c628b3bbfd7a 100644
--- a/drivers/mmc/host/via-sdmmc.c
+++ b/drivers/mmc/host/via-sdmmc.c
@@ -1218,7 +1218,7 @@ static void via_sd_remove(struct pci_dev *pcidev)
 		pci_name(pcidev), (int)pcidev->vendor, (int)pcidev->device);
 }
 
-static void __maybe_unused via_init_sdc_pm(struct via_crdr_mmc_host *host)
+static void via_init_sdc_pm(struct via_crdr_mmc_host *host)
 {
 	struct sdhcreg *pm_sdhcreg;
 	void __iomem *addrbase;
@@ -1252,7 +1252,7 @@ static void __maybe_unused via_init_sdc_pm(struct via_crdr_mmc_host *host)
 	via_print_sdchc(host);
 }
 
-static int __maybe_unused via_sd_suspend(struct device *dev)
+static int via_sd_suspend(struct device *dev)
 {
 	struct via_crdr_mmc_host *host;
 	unsigned long flags;
@@ -1269,7 +1269,7 @@ static int __maybe_unused via_sd_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused via_sd_resume(struct device *dev)
+static int via_sd_resume(struct device *dev)
 {
 	struct via_crdr_mmc_host *sdhost;
 	u8 gatt;
@@ -1295,14 +1295,14 @@ static int __maybe_unused via_sd_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(via_sd_pm_ops, via_sd_suspend, via_sd_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(via_sd_pm_ops, via_sd_suspend, via_sd_resume);
 
 static struct pci_driver via_sd_driver = {
 	.name = DRV_NAME,
 	.id_table = via_ids,
 	.probe = via_sd_probe,
 	.remove = via_sd_remove,
-	.driver.pm = &via_sd_pm_ops,
+	.driver.pm = pm_sleep_ptr(&via_sd_pm_ops),
 };
 
 module_pci_driver(via_sd_driver);
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 35/38] mmc: dw_mmc: exynos: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (33 preceding siblings ...)
  2025-08-15  1:34 ` [PATCH 34/38] mmc: via-sdmmc: " Jisheng Zhang
@ 2025-08-15  1:34 ` Jisheng Zhang
  2025-08-15  1:34 ` [PATCH 36/38] mmc: dw_mmc-k3: " Jisheng Zhang
                   ` (3 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:34 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/dw_mmc-exynos.c | 13 +++----------
 drivers/mmc/host/dw_mmc.h        |  3 +++
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c
index e3548408ca39..384609671a9a 100644
--- a/drivers/mmc/host/dw_mmc-exynos.c
+++ b/drivers/mmc/host/dw_mmc-exynos.c
@@ -189,7 +189,6 @@ static void dw_mci_exynos_set_clksel_timing(struct dw_mci *host, u32 timing)
 		set_bit(DW_MMC_CARD_NO_USE_HOLD, &host->slot->flags);
 }
 
-#ifdef CONFIG_PM
 static int dw_mci_exynos_runtime_resume(struct device *dev)
 {
 	struct dw_mci *host = dev_get_drvdata(dev);
@@ -203,9 +202,7 @@ static int dw_mci_exynos_runtime_resume(struct device *dev)
 
 	return ret;
 }
-#endif /* CONFIG_PM */
 
-#ifdef CONFIG_PM_SLEEP
 /**
  * dw_mci_exynos_suspend_noirq - Exynos-specific suspend code
  * @dev: Device to suspend (this device)
@@ -265,7 +262,6 @@ static int dw_mci_exynos_resume_noirq(struct device *dev)
 
 	return 0;
 }
-#endif /* CONFIG_PM_SLEEP */
 
 static void dw_mci_exynos_config_hs400(struct dw_mci *host, u32 timing)
 {
@@ -712,11 +708,8 @@ static void dw_mci_exynos_remove(struct platform_device *pdev)
 }
 
 static const struct dev_pm_ops dw_mci_exynos_pmops = {
-	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(dw_mci_exynos_suspend_noirq,
-				      dw_mci_exynos_resume_noirq)
-	SET_RUNTIME_PM_OPS(dw_mci_runtime_suspend,
-			   dw_mci_exynos_runtime_resume,
-			   NULL)
+	NOIRQ_SYSTEM_SLEEP_PM_OPS(dw_mci_exynos_suspend_noirq, dw_mci_exynos_resume_noirq)
+	RUNTIME_PM_OPS(dw_mci_runtime_suspend, dw_mci_exynos_runtime_resume, NULL)
 };
 
 static struct platform_driver dw_mci_exynos_pltfm_driver = {
@@ -726,7 +719,7 @@ static struct platform_driver dw_mci_exynos_pltfm_driver = {
 		.name		= "dwmmc_exynos",
 		.probe_type	= PROBE_PREFER_ASYNCHRONOUS,
 		.of_match_table	= dw_mci_exynos_match,
-		.pm		= &dw_mci_exynos_pmops,
+		.pm		= pm_ptr(&dw_mci_exynos_pmops),
 	},
 };
 
diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h
index 5463392dc811..588027932412 100644
--- a/drivers/mmc/host/dw_mmc.h
+++ b/drivers/mmc/host/dw_mmc.h
@@ -541,6 +541,9 @@ extern void dw_mci_remove(struct dw_mci *host);
 #ifdef CONFIG_PM
 extern int dw_mci_runtime_suspend(struct device *device);
 extern int dw_mci_runtime_resume(struct device *device);
+#else
+static inline int dw_mci_runtime_suspend(struct device *device) { return -EOPNOTSUPP; }
+static inline int dw_mci_runtime_resume(struct device *device) { return -EOPNOTSUPP; }
 #endif
 
 /**
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 36/38] mmc: dw_mmc-k3: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (34 preceding siblings ...)
  2025-08-15  1:34 ` [PATCH 35/38] mmc: dw_mmc: exynos: " Jisheng Zhang
@ 2025-08-15  1:34 ` Jisheng Zhang
  2025-08-15  1:34 ` [PATCH 37/38] mmc: dw_mmc-pci: " Jisheng Zhang
                   ` (2 subsequent siblings)
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:34 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/dw_mmc-k3.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc-k3.c b/drivers/mmc/host/dw_mmc-k3.c
index 0311a37dd4ab..ad6aa1aea549 100644
--- a/drivers/mmc/host/dw_mmc-k3.c
+++ b/drivers/mmc/host/dw_mmc-k3.c
@@ -461,11 +461,8 @@ static int dw_mci_k3_probe(struct platform_device *pdev)
 }
 
 static const struct dev_pm_ops dw_mci_k3_dev_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-				pm_runtime_force_resume)
-	SET_RUNTIME_PM_OPS(dw_mci_runtime_suspend,
-			   dw_mci_runtime_resume,
-			   NULL)
+	SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
+	RUNTIME_PM_OPS(dw_mci_runtime_suspend, dw_mci_runtime_resume, NULL)
 };
 
 static struct platform_driver dw_mci_k3_pltfm_driver = {
@@ -475,7 +472,7 @@ static struct platform_driver dw_mci_k3_pltfm_driver = {
 		.name		= "dwmmc_k3",
 		.probe_type	= PROBE_PREFER_ASYNCHRONOUS,
 		.of_match_table	= dw_mci_k3_match,
-		.pm		= &dw_mci_k3_dev_pm_ops,
+		.pm		= pm_ptr(&dw_mci_k3_dev_pm_ops),
 	},
 };
 
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 37/38] mmc: dw_mmc-pci: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (35 preceding siblings ...)
  2025-08-15  1:34 ` [PATCH 36/38] mmc: dw_mmc-k3: " Jisheng Zhang
@ 2025-08-15  1:34 ` Jisheng Zhang
  2025-08-15  1:34 ` [PATCH 38/38] mmc: dw_mmc-rockchip: " Jisheng Zhang
  2025-08-22 10:15 ` [PATCH 00/38] mmc: host: " Ulf Hansson
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:34 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/dw_mmc-pci.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc-pci.c b/drivers/mmc/host/dw_mmc-pci.c
index e7ab699f488e..092cc99175af 100644
--- a/drivers/mmc/host/dw_mmc-pci.c
+++ b/drivers/mmc/host/dw_mmc-pci.c
@@ -75,11 +75,8 @@ static void dw_mci_pci_remove(struct pci_dev *pdev)
 }
 
 static const struct dev_pm_ops dw_mci_pci_dev_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-				pm_runtime_force_resume)
-	SET_RUNTIME_PM_OPS(dw_mci_runtime_suspend,
-			   dw_mci_runtime_resume,
-			   NULL)
+	SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
+	RUNTIME_PM_OPS(dw_mci_runtime_suspend, dw_mci_runtime_resume, NULL)
 };
 
 static const struct pci_device_id dw_mci_pci_id[] = {
@@ -94,7 +91,7 @@ static struct pci_driver dw_mci_pci_driver = {
 	.probe		= dw_mci_pci_probe,
 	.remove		= dw_mci_pci_remove,
 	.driver		=	{
-		.pm =   &dw_mci_pci_dev_pm_ops,
+		.pm =   pm_ptr(&dw_mci_pci_dev_pm_ops),
 	},
 };
 
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 38/38] mmc: dw_mmc-rockchip: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (36 preceding siblings ...)
  2025-08-15  1:34 ` [PATCH 37/38] mmc: dw_mmc-pci: " Jisheng Zhang
@ 2025-08-15  1:34 ` Jisheng Zhang
  2025-08-22 10:15 ` [PATCH 00/38] mmc: host: " Ulf Hansson
  38 siblings, 0 replies; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-15  1:34 UTC (permalink / raw)
  To: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

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>
---
 drivers/mmc/host/dw_mmc-rockchip.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c
index baa23b517731..d2aec6cf9773 100644
--- a/drivers/mmc/host/dw_mmc-rockchip.c
+++ b/drivers/mmc/host/dw_mmc-rockchip.c
@@ -568,11 +568,8 @@ static void dw_mci_rockchip_remove(struct platform_device *pdev)
 }
 
 static const struct dev_pm_ops dw_mci_rockchip_dev_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-				pm_runtime_force_resume)
-	SET_RUNTIME_PM_OPS(dw_mci_runtime_suspend,
-			   dw_mci_runtime_resume,
-			   NULL)
+	SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
+	RUNTIME_PM_OPS(dw_mci_runtime_suspend, dw_mci_runtime_resume, NULL)
 };
 
 static struct platform_driver dw_mci_rockchip_pltfm_driver = {
@@ -582,7 +579,7 @@ static struct platform_driver dw_mci_rockchip_pltfm_driver = {
 		.name		= "dwmmc_rockchip",
 		.probe_type	= PROBE_PREFER_ASYNCHRONOUS,
 		.of_match_table	= dw_mci_rockchip_match,
-		.pm		= &dw_mci_rockchip_dev_pm_ops,
+		.pm		= pm_ptr(&dw_mci_rockchip_dev_pm_ops),
 	},
 };
 
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* RE: [PATCH 18/38] mmc: sdhci-esdhc-imx: use modern PM macros
  2025-08-15  1:33 ` [PATCH 18/38] mmc: sdhci-esdhc-imx: " Jisheng Zhang
@ 2025-08-15  3:23   ` Bough Chen
  2025-08-16  6:03     ` Jisheng Zhang
  0 siblings, 1 reply; 52+ messages in thread
From: Bough Chen @ 2025-08-15  3:23 UTC (permalink / raw)
  To: Jisheng Zhang, Ulf Hansson, Aubin Constans, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Manuel Lauss,
	Michał Mirosław, Jaehoon Chung, Krzysztof Kozlowski,
	Alim Akhtar, Heiko Stuebner, Russell King, Chaotian Jing,
	Matthias Brugger, AngeloGioacchino Del Regno, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Adrian Hunter, Kamal Dasu, Al Cooper,
	Broadcom internal kernel review list, Florian Fainelli,
	Michal Simek, Eugen Hristev, Vignesh Raghavendra, Ben Dooks,
	Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org

> -----Original Message-----
> From: Jisheng Zhang <jszhang@kernel.org>
> Sent: 2025年8月15日 9:34
> To: Ulf Hansson <ulf.hansson@linaro.org>; Aubin Constans
> <aubin.constans@microchip.com>; Nicolas Ferre
> <nicolas.ferre@microchip.com>; Alexandre Belloni
> <alexandre.belloni@bootlin.com>; Claudiu Beznea
> <claudiu.beznea@tuxon.dev>; Manuel Lauss <manuel.lauss@gmail.com>;
> Michał Mirosław <mirq-linux@rere.qmqm.pl>; Jaehoon Chung
> <jh80.chung@samsung.com>; Krzysztof Kozlowski <krzk@kernel.org>; Alim
> Akhtar <alim.akhtar@samsung.com>; Heiko Stuebner <heiko@sntech.de>;
> Russell King <linux@armlinux.org.uk>; Chaotian Jing
> <chaotian.jing@mediatek.com>; Matthias Brugger <matthias.bgg@gmail.com>;
> AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>;
> Shawn Guo <shawnguo@kernel.org>; Sascha Hauer <s.hauer@pengutronix.de>;
> Pengutronix Kernel Team <kernel@pengutronix.de>; Fabio Estevam
> <festevam@gmail.com>; Adrian Hunter <adrian.hunter@intel.com>; Kamal
> Dasu <kamal.dasu@broadcom.com>; Al Cooper <alcooperx@gmail.com>;
> Broadcom internal kernel review list
> <bcm-kernel-feedback-list@broadcom.com>; Florian Fainelli
> <florian.fainelli@broadcom.com>; Bough Chen <haibo.chen@nxp.com>; Michal
> Simek <michal.simek@amd.com>; Eugen Hristev <eugen.hristev@linaro.org>;
> Vignesh Raghavendra <vigneshr@ti.com>; Ben Dooks <ben-linux@fluff.org>;
> Viresh Kumar <vireshk@kernel.org>; Orson Zhai <orsonzhai@gmail.com>;
> Baolin Wang <baolin.wang@linux.alibaba.com>; Chunyan Zhang
> <zhang.lyra@gmail.com>; Patrice Chotard <patrice.chotard@foss.st.com>;
> Thierry Reding <thierry.reding@gmail.com>; Jonathan Hunter
> <jonathanh@nvidia.com>; Chen-Yu Tsai <wens@csie.org>; Jernej Skrabec
> <jernej.skrabec@gmail.com>; Samuel Holland <samuel@sholland.org>; Alexey
> Charkov <alchark@gmail.com>
> Cc: linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH 18/38] mmc: sdhci-esdhc-imx: 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.

Hi Jisheng,

When I remove all the configs under Power management options I got the following build warning:

drivers/mmc/host/sdhci-esdhc-imx.c:2079:12: warning: ‘sdhci_esdhc_resume’ defined but not used [-Wunused-function]
 2079 | static int sdhci_esdhc_resume(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~
  CC      drivers/mmc/host/cqhci-core.o
drivers/mmc/host/sdhci-esdhc-imx.c:2017:12: warning: ‘sdhci_esdhc_suspend’ defined but not used [-Wunused-function]
 2017 | static int sdhci_esdhc_suspend(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~

Regards
Haibo Chen
> 
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> ---
>  drivers/mmc/host/sdhci-esdhc-imx.c | 13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c
> b/drivers/mmc/host/sdhci-esdhc-imx.c
> index a040c0896a7b..a7a5df673b0f 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -1650,7 +1650,6 @@ static void sdhci_esdhc_imx_hwinit(struct sdhci_host
> *host)
>  	}
>  }
> 
> -#ifdef CONFIG_PM_SLEEP
>  static void sdhc_esdhc_tuning_save(struct sdhci_host *host)  {
>  	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); @@ -1707,7
> +1706,6 @@ static void sdhc_esdhc_tuning_restore(struct sdhci_host *host)
>  		       host->ioaddr + ESDHC_TUNE_CTRL_STATUS);
>  	}
>  }
> -#endif
> 
>  static void esdhc_cqe_enable(struct mmc_host *mmc)  { @@ -2016,7
> +2014,6 @@ static void sdhci_esdhc_imx_remove(struct platform_device
> *pdev)
>  		cpu_latency_qos_remove_request(&imx_data->pm_qos_req);
>  }
> 
> -#ifdef CONFIG_PM_SLEEP
>  static int sdhci_esdhc_suspend(struct device *dev)  {
>  	struct sdhci_host *host = dev_get_drvdata(dev); @@ -2112,9 +2109,7 @@
> static int sdhci_esdhc_resume(struct device *dev)
> 
>  	return ret;
>  }
> -#endif
> 
> -#ifdef CONFIG_PM
>  static int sdhci_esdhc_runtime_suspend(struct device *dev)  {
>  	struct sdhci_host *host = dev_get_drvdata(dev); @@ -2188,12 +2183,10
> @@ static int sdhci_esdhc_runtime_resume(struct device *dev)
>  		cpu_latency_qos_remove_request(&imx_data->pm_qos_req);
>  	return err;
>  }
> -#endif
> 
>  static const struct dev_pm_ops sdhci_esdhc_pmops = {
> -	SET_SYSTEM_SLEEP_PM_OPS(sdhci_esdhc_suspend, sdhci_esdhc_resume)
> -	SET_RUNTIME_PM_OPS(sdhci_esdhc_runtime_suspend,
> -				sdhci_esdhc_runtime_resume, NULL)
> +	SYSTEM_SLEEP_PM_OPS(sdhci_esdhc_suspend, sdhci_esdhc_resume)
> +	RUNTIME_PM_OPS(sdhci_esdhc_runtime_suspend,
> +sdhci_esdhc_runtime_resume, NULL)
>  };
> 
>  static struct platform_driver sdhci_esdhc_imx_driver = { @@ -2201,7 +2194,7
> @@ static struct platform_driver sdhci_esdhc_imx_driver = {
>  		.name	= "sdhci-esdhc-imx",
>  		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
>  		.of_match_table = imx_esdhc_dt_ids,
> -		.pm	= &sdhci_esdhc_pmops,
> +		.pm	= pm_ptr(&sdhci_esdhc_pmops),
>  	},
>  	.probe		= sdhci_esdhc_imx_probe,
>  	.remove		= sdhci_esdhc_imx_remove,
> --
> 2.50.0


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 18/38] mmc: sdhci-esdhc-imx: use modern PM macros
  2025-08-15  3:23   ` Bough Chen
@ 2025-08-16  6:03     ` Jisheng Zhang
  2025-08-18 12:15       ` Jisheng Zhang
  0 siblings, 1 reply; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-16  6:03 UTC (permalink / raw)
  To: Bough Chen
  Cc: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss,
	Micha�� Miros��aw, Jaehoon Chung,
	Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner, Russell King,
	Chaotian Jing, Matthias Brugger, AngeloGioacchino Del Regno,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Adrian Hunter, Kamal Dasu, Al Cooper,
	Broadcom internal kernel review list, Florian Fainelli,
	Michal Simek, Eugen Hristev, Vignesh Raghavendra, Ben Dooks,
	Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 6065 bytes --]

On Fri, Aug 15, 2025 at 03:23:56AM +0000, Bough Chen wrote:
> > -----Original Message-----
> > From: Jisheng Zhang <jszhang@kernel.org>
> > Sent: 2025Ò´8êÅ15ìí 9:34
> > To: Ulf Hansson <ulf.hansson@linaro.org>; Aubin Constans
> > <aubin.constans@microchip.com>; Nicolas Ferre
> > <nicolas.ferre@microchip.com>; Alexandre Belloni
> > <alexandre.belloni@bootlin.com>; Claudiu Beznea
> > <claudiu.beznea@tuxon.dev>; Manuel Lauss <manuel.lauss@gmail.com>;
> > Micha©© Miros©©aw <mirq-linux@rere.qmqm.pl>; Jaehoon Chung
> > <jh80.chung@samsung.com>; Krzysztof Kozlowski <krzk@kernel.org>; Alim
> > Akhtar <alim.akhtar@samsung.com>; Heiko Stuebner <heiko@sntech.de>;
> > Russell King <linux@armlinux.org.uk>; Chaotian Jing
> > <chaotian.jing@mediatek.com>; Matthias Brugger <matthias.bgg@gmail.com>;
> > AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>;
> > Shawn Guo <shawnguo@kernel.org>; Sascha Hauer <s.hauer@pengutronix.de>;
> > Pengutronix Kernel Team <kernel@pengutronix.de>; Fabio Estevam
> > <festevam@gmail.com>; Adrian Hunter <adrian.hunter@intel.com>; Kamal
> > Dasu <kamal.dasu@broadcom.com>; Al Cooper <alcooperx@gmail.com>;
> > Broadcom internal kernel review list
> > <bcm-kernel-feedback-list@broadcom.com>; Florian Fainelli
> > <florian.fainelli@broadcom.com>; Bough Chen <haibo.chen@nxp.com>; Michal
> > Simek <michal.simek@amd.com>; Eugen Hristev <eugen.hristev@linaro.org>;
> > Vignesh Raghavendra <vigneshr@ti.com>; Ben Dooks <ben-linux@fluff.org>;
> > Viresh Kumar <vireshk@kernel.org>; Orson Zhai <orsonzhai@gmail.com>;
> > Baolin Wang <baolin.wang@linux.alibaba.com>; Chunyan Zhang
> > <zhang.lyra@gmail.com>; Patrice Chotard <patrice.chotard@foss.st.com>;
> > Thierry Reding <thierry.reding@gmail.com>; Jonathan Hunter
> > <jonathanh@nvidia.com>; Chen-Yu Tsai <wens@csie.org>; Jernej Skrabec
> > <jernej.skrabec@gmail.com>; Samuel Holland <samuel@sholland.org>; Alexey
> > Charkov <alchark@gmail.com>
> > Cc: linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org
> > Subject: [PATCH 18/38] mmc: sdhci-esdhc-imx: 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.
> 
> Hi Jisheng,

Hi,

> 
> When I remove all the configs under Power management options I got the following build warning:
> 
> drivers/mmc/host/sdhci-esdhc-imx.c:2079:12: warning: ¡®sdhci_esdhc_resume¡¯ defined but not used [-Wunused-function]
>  2079 | static int sdhci_esdhc_resume(struct device *dev)
>       |            ^~~~~~~~~~~~~~~~~~
>   CC      drivers/mmc/host/cqhci-core.o
> drivers/mmc/host/sdhci-esdhc-imx.c:2017:12: warning: ¡®sdhci_esdhc_suspend¡¯ defined but not used [-Wunused-function]
>  2017 | static int sdhci_esdhc_suspend(struct device *dev)
>       |            ^~~~~~~~~~~~~~~~~~~

Hmm interesting, what's test toolchain? I tested this patch with gcc14
with below three combinations before sending out, no warnings at all:
PM + PM_SLEEP
PM only
!PM + ! PM_SLEEP

The sdhci_esdhc_suspend|resume are referenced by SYSTEM_SLEEP_PM_OPS.
The pm_sleep_ptr() macro does the tricky, when both PM and PM_SLEEP are
disabled, they are optimized out.

So can you plz kindly show your toolchain? I will check

Thanks
> 
> Regards
> Haibo Chen
> > 
> > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> > ---
> >  drivers/mmc/host/sdhci-esdhc-imx.c | 13 +++----------
> >  1 file changed, 3 insertions(+), 10 deletions(-)
> > 
> > diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c
> > b/drivers/mmc/host/sdhci-esdhc-imx.c
> > index a040c0896a7b..a7a5df673b0f 100644
> > --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> > +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> > @@ -1650,7 +1650,6 @@ static void sdhci_esdhc_imx_hwinit(struct sdhci_host
> > *host)
> >  	}
> >  }
> > 
> > -#ifdef CONFIG_PM_SLEEP
> >  static void sdhc_esdhc_tuning_save(struct sdhci_host *host)  {
> >  	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); @@ -1707,7
> > +1706,6 @@ static void sdhc_esdhc_tuning_restore(struct sdhci_host *host)
> >  		       host->ioaddr + ESDHC_TUNE_CTRL_STATUS);
> >  	}
> >  }
> > -#endif
> > 
> >  static void esdhc_cqe_enable(struct mmc_host *mmc)  { @@ -2016,7
> > +2014,6 @@ static void sdhci_esdhc_imx_remove(struct platform_device
> > *pdev)
> >  		cpu_latency_qos_remove_request(&imx_data->pm_qos_req);
> >  }
> > 
> > -#ifdef CONFIG_PM_SLEEP
> >  static int sdhci_esdhc_suspend(struct device *dev)  {
> >  	struct sdhci_host *host = dev_get_drvdata(dev); @@ -2112,9 +2109,7 @@
> > static int sdhci_esdhc_resume(struct device *dev)
> > 
> >  	return ret;
> >  }
> > -#endif
> > 
> > -#ifdef CONFIG_PM
> >  static int sdhci_esdhc_runtime_suspend(struct device *dev)  {
> >  	struct sdhci_host *host = dev_get_drvdata(dev); @@ -2188,12 +2183,10
> > @@ static int sdhci_esdhc_runtime_resume(struct device *dev)
> >  		cpu_latency_qos_remove_request(&imx_data->pm_qos_req);
> >  	return err;
> >  }
> > -#endif
> > 
> >  static const struct dev_pm_ops sdhci_esdhc_pmops = {
> > -	SET_SYSTEM_SLEEP_PM_OPS(sdhci_esdhc_suspend, sdhci_esdhc_resume)
> > -	SET_RUNTIME_PM_OPS(sdhci_esdhc_runtime_suspend,
> > -				sdhci_esdhc_runtime_resume, NULL)
> > +	SYSTEM_SLEEP_PM_OPS(sdhci_esdhc_suspend, sdhci_esdhc_resume)
> > +	RUNTIME_PM_OPS(sdhci_esdhc_runtime_suspend,
> > +sdhci_esdhc_runtime_resume, NULL)
> >  };
> > 
> >  static struct platform_driver sdhci_esdhc_imx_driver = { @@ -2201,7 +2194,7
> > @@ static struct platform_driver sdhci_esdhc_imx_driver = {
> >  		.name	= "sdhci-esdhc-imx",
> >  		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
> >  		.of_match_table = imx_esdhc_dt_ids,
> > -		.pm	= &sdhci_esdhc_pmops,
> > +		.pm	= pm_ptr(&sdhci_esdhc_pmops),
> >  	},
> >  	.probe		= sdhci_esdhc_imx_probe,
> >  	.remove		= sdhci_esdhc_imx_remove,
> > --
> > 2.50.0
> 

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 25/38] mmc: sdhci-spear: use modern PM macros
  2025-08-15  1:34 ` [PATCH 25/38] mmc: sdhci-spear: " Jisheng Zhang
@ 2025-08-18  6:38   ` Viresh Kumar
  0 siblings, 0 replies; 52+ messages in thread
From: Viresh Kumar @ 2025-08-18  6:38 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov, linux-mmc,
	linux-kernel

On 15-08-25, 09:34, Jisheng Zhang wrote:
> 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>
> ---
>  drivers/mmc/host/sdhci-spear.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 27/38] mmc: sdhci-st: use modern PM macros
  2025-08-15  1:34 ` [PATCH 27/38] mmc: sdhci-st: " Jisheng Zhang
@ 2025-08-18  8:49   ` Patrice CHOTARD
  0 siblings, 0 replies; 52+ messages in thread
From: Patrice CHOTARD @ 2025-08-18  8:49 UTC (permalink / raw)
  To: Jisheng Zhang, Ulf Hansson, Aubin Constans, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Manuel Lauss,
	Michał Mirosław, Jaehoon Chung, Krzysztof Kozlowski,
	Alim Akhtar, Heiko Stuebner, Russell King, Chaotian Jing,
	Matthias Brugger, AngeloGioacchino Del Regno, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Adrian Hunter, Kamal Dasu, Al Cooper,
	Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Thierry Reding, Jonathan Hunter, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel



On 8/15/25 03:34, Jisheng Zhang wrote:
> 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>
> ---
>  drivers/mmc/host/sdhci-st.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>

Thanks
Patrice

> 
> diff --git a/drivers/mmc/host/sdhci-st.c b/drivers/mmc/host/sdhci-st.c
> index 9157342ff7a4..bf6685805137 100644
> --- a/drivers/mmc/host/sdhci-st.c
> +++ b/drivers/mmc/host/sdhci-st.c
> @@ -445,7 +445,6 @@ static void sdhci_st_remove(struct platform_device *pdev)
>  	reset_control_assert(rstc);
>  }
>  
> -#ifdef CONFIG_PM_SLEEP
>  static int sdhci_st_suspend(struct device *dev)
>  {
>  	struct sdhci_host *host = dev_get_drvdata(dev);
> @@ -492,9 +491,8 @@ static int sdhci_st_resume(struct device *dev)
>  
>  	return sdhci_resume_host(host);
>  }
> -#endif
>  
> -static SIMPLE_DEV_PM_OPS(sdhci_st_pmops, sdhci_st_suspend, sdhci_st_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(sdhci_st_pmops, sdhci_st_suspend, sdhci_st_resume);
>  
>  static const struct of_device_id st_sdhci_match[] = {
>  	{ .compatible = "st,sdhci" },
> @@ -509,7 +507,7 @@ static struct platform_driver sdhci_st_driver = {
>  	.driver = {
>  		   .name = "sdhci-st",
>  		   .probe_type = PROBE_PREFER_ASYNCHRONOUS,
> -		   .pm = &sdhci_st_pmops,
> +		   .pm = pm_sleep_ptr(&sdhci_st_pmops),
>  		   .of_match_table = st_sdhci_match,
>  		  },
>  };

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 15/38] mmc: sdhci-acpi: use modern PM macros
  2025-08-15  1:33 ` [PATCH 15/38] mmc: sdhci-acpi: " Jisheng Zhang
@ 2025-08-18 10:40   ` Adrian Hunter
  0 siblings, 0 replies; 52+ messages in thread
From: Adrian Hunter @ 2025-08-18 10:40 UTC (permalink / raw)
  To: Jisheng Zhang, Ulf Hansson, Aubin Constans, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Manuel Lauss,
	Michał Mirosław, Jaehoon Chung, Krzysztof Kozlowski,
	Alim Akhtar, Heiko Stuebner, Russell King, Chaotian Jing,
	Matthias Brugger, AngeloGioacchino Del Regno, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

On 15/08/2025 04:33, Jisheng Zhang wrote:
> 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>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  drivers/mmc/host/sdhci-acpi.c | 18 ++++--------------
>  1 file changed, 4 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
> index 2d46d4854fa1..84c7054607fc 100644
> --- a/drivers/mmc/host/sdhci-acpi.c
> +++ b/drivers/mmc/host/sdhci-acpi.c
> @@ -973,8 +973,7 @@ static void sdhci_acpi_remove(struct platform_device *pdev)
>  		c->slot->free_slot(pdev);
>  }
>  
> -static void __maybe_unused sdhci_acpi_reset_signal_voltage_if_needed(
> -	struct device *dev)
> +static void sdhci_acpi_reset_signal_voltage_if_needed(struct device *dev)
>  {
>  	struct sdhci_acpi_host *c = dev_get_drvdata(dev);
>  	struct sdhci_host *host = c->host;
> @@ -989,8 +988,6 @@ static void __maybe_unused sdhci_acpi_reset_signal_voltage_if_needed(
>  	}
>  }
>  
> -#ifdef CONFIG_PM_SLEEP
> -
>  static int sdhci_acpi_suspend(struct device *dev)
>  {
>  	struct sdhci_acpi_host *c = dev_get_drvdata(dev);
> @@ -1017,10 +1014,6 @@ static int sdhci_acpi_resume(struct device *dev)
>  	return sdhci_resume_host(c->host);
>  }
>  
> -#endif
> -
> -#ifdef CONFIG_PM
> -
>  static int sdhci_acpi_runtime_suspend(struct device *dev)
>  {
>  	struct sdhci_acpi_host *c = dev_get_drvdata(dev);
> @@ -1045,12 +1038,9 @@ static int sdhci_acpi_runtime_resume(struct device *dev)
>  	return 0;
>  }
>  
> -#endif
> -
>  static const struct dev_pm_ops sdhci_acpi_pm_ops = {
> -	SET_SYSTEM_SLEEP_PM_OPS(sdhci_acpi_suspend, sdhci_acpi_resume)
> -	SET_RUNTIME_PM_OPS(sdhci_acpi_runtime_suspend,
> -			sdhci_acpi_runtime_resume, NULL)
> +	SYSTEM_SLEEP_PM_OPS(sdhci_acpi_suspend, sdhci_acpi_resume)
> +	RUNTIME_PM_OPS(sdhci_acpi_runtime_suspend, sdhci_acpi_runtime_resume, NULL)
>  };
>  
>  static struct platform_driver sdhci_acpi_driver = {
> @@ -1058,7 +1048,7 @@ static struct platform_driver sdhci_acpi_driver = {
>  		.name			= "sdhci-acpi",
>  		.probe_type		= PROBE_PREFER_ASYNCHRONOUS,
>  		.acpi_match_table	= sdhci_acpi_ids,
> -		.pm			= &sdhci_acpi_pm_ops,
> +		.pm			= pm_ptr(&sdhci_acpi_pm_ops),
>  	},
>  	.probe	= sdhci_acpi_probe,
>  	.remove = sdhci_acpi_remove,


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 01/38] sdhci: add some simple inline functions for !CONFIG_PM
  2025-08-15  1:33 ` [PATCH 01/38] sdhci: add some simple inline functions for !CONFIG_PM Jisheng Zhang
@ 2025-08-18 11:29   ` Adrian Hunter
  0 siblings, 0 replies; 52+ messages in thread
From: Adrian Hunter @ 2025-08-18 11:29 UTC (permalink / raw)
  To: Jisheng Zhang, Ulf Hansson, Aubin Constans, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Manuel Lauss,
	Michał Mirosław, Jaehoon Chung, Krzysztof Kozlowski,
	Alim Akhtar, Heiko Stuebner, Russell King, Chaotian Jing,
	Matthias Brugger, AngeloGioacchino Del Regno, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov
  Cc: linux-mmc, linux-kernel

On 15/08/2025 04:33, Jisheng Zhang wrote:
> In next commits, we will switch to the modern PM macros.
> 
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>

Subject would normally begin: "mmc: sdhci: ", otherwise:

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  drivers/mmc/host/sdhci.h | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> index 58fcbeaf281e..5b699af04bfe 100644
> --- a/drivers/mmc/host/sdhci.h
> +++ b/drivers/mmc/host/sdhci.h
> @@ -880,6 +880,13 @@ int sdhci_suspend_host(struct sdhci_host *host);
>  int sdhci_resume_host(struct sdhci_host *host);
>  void sdhci_runtime_suspend_host(struct sdhci_host *host);
>  void sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset);
> +#else
> +static inline bool sdhci_enable_irq_wakeups(struct sdhci_host *host) { return false; }
> +static inline void sdhci_disable_irq_wakeups(struct sdhci_host *host) {}
> +static inline int sdhci_suspend_host(struct sdhci_host *host) { return -EOPNOTSUPP; }
> +static inline int sdhci_resume_host(struct sdhci_host *host) { return -EOPNOTSUPP; }
> +static inline void sdhci_runtime_suspend_host(struct sdhci_host *host) {}
> +static inline void sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset) {}
>  #endif
>  
>  void sdhci_cqe_enable(struct mmc_host *mmc);


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 18/38] mmc: sdhci-esdhc-imx: use modern PM macros
  2025-08-16  6:03     ` Jisheng Zhang
@ 2025-08-18 12:15       ` Jisheng Zhang
  2025-08-19  3:48         ` Bough Chen
  0 siblings, 1 reply; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-18 12:15 UTC (permalink / raw)
  To: Bough Chen
  Cc: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss,
	Micha�� Miros��aw, Jaehoon Chung,
	Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner, Russell King,
	Chaotian Jing, Matthias Brugger, AngeloGioacchino Del Regno,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Adrian Hunter, Kamal Dasu, Al Cooper,
	Broadcom internal kernel review list, Florian Fainelli,
	Michal Simek, Eugen Hristev, Vignesh Raghavendra, Ben Dooks,
	Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org

On Sat, Aug 16, 2025 at 02:03:48PM +0800, Jisheng Zhang wrote:
> On Fri, Aug 15, 2025 at 03:23:56AM +0000, Bough Chen wrote:
> > > -----Original Message-----
> > > From: Jisheng Zhang <jszhang@kernel.org>
> > > Sent: 2025Ҵ8??15?? 9:34
> > > To: Ulf Hansson <ulf.hansson@linaro.org>; Aubin Constans
> > > <aubin.constans@microchip.com>; Nicolas Ferre
> > > <nicolas.ferre@microchip.com>; Alexandre Belloni
> > > <alexandre.belloni@bootlin.com>; Claudiu Beznea
> > > <claudiu.beznea@tuxon.dev>; Manuel Lauss <manuel.lauss@gmail.com>;
> > > Micha?? Miros??aw <mirq-linux@rere.qmqm.pl>; Jaehoon Chung
> > > <jh80.chung@samsung.com>; Krzysztof Kozlowski <krzk@kernel.org>; Alim
> > > Akhtar <alim.akhtar@samsung.com>; Heiko Stuebner <heiko@sntech.de>;
> > > Russell King <linux@armlinux.org.uk>; Chaotian Jing
> > > <chaotian.jing@mediatek.com>; Matthias Brugger <matthias.bgg@gmail.com>;
> > > AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>;
> > > Shawn Guo <shawnguo@kernel.org>; Sascha Hauer <s.hauer@pengutronix.de>;
> > > Pengutronix Kernel Team <kernel@pengutronix.de>; Fabio Estevam
> > > <festevam@gmail.com>; Adrian Hunter <adrian.hunter@intel.com>; Kamal
> > > Dasu <kamal.dasu@broadcom.com>; Al Cooper <alcooperx@gmail.com>;
> > > Broadcom internal kernel review list
> > > <bcm-kernel-feedback-list@broadcom.com>; Florian Fainelli
> > > <florian.fainelli@broadcom.com>; Bough Chen <haibo.chen@nxp.com>; Michal
> > > Simek <michal.simek@amd.com>; Eugen Hristev <eugen.hristev@linaro.org>;
> > > Vignesh Raghavendra <vigneshr@ti.com>; Ben Dooks <ben-linux@fluff.org>;
> > > Viresh Kumar <vireshk@kernel.org>; Orson Zhai <orsonzhai@gmail.com>;
> > > Baolin Wang <baolin.wang@linux.alibaba.com>; Chunyan Zhang
> > > <zhang.lyra@gmail.com>; Patrice Chotard <patrice.chotard@foss.st.com>;
> > > Thierry Reding <thierry.reding@gmail.com>; Jonathan Hunter
> > > <jonathanh@nvidia.com>; Chen-Yu Tsai <wens@csie.org>; Jernej Skrabec
> > > <jernej.skrabec@gmail.com>; Samuel Holland <samuel@sholland.org>; Alexey
> > > Charkov <alchark@gmail.com>
> > > Cc: linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org
> > > Subject: [PATCH 18/38] mmc: sdhci-esdhc-imx: 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.
> > 
> > Hi Jisheng,
> 
> Hi,
> 
> > 
> > When I remove all the configs under Power management options I got the following build warning:
> > 
> > drivers/mmc/host/sdhci-esdhc-imx.c:2079:12: warning: ??sdhci_esdhc_resume?? defined but not used [-Wunused-function]
> >  2079 | static int sdhci_esdhc_resume(struct device *dev)
> >       |            ^~~~~~~~~~~~~~~~~~
> >   CC      drivers/mmc/host/cqhci-core.o
> > drivers/mmc/host/sdhci-esdhc-imx.c:2017:12: warning: ??sdhci_esdhc_suspend?? defined but not used [-Wunused-function]
> >  2017 | static int sdhci_esdhc_suspend(struct device *dev)
> >       |            ^~~~~~~~~~~~~~~~~~~
> 
> Hmm interesting, what's test toolchain? I tested this patch with gcc14
> with below three combinations before sending out, no warnings at all:
> PM + PM_SLEEP
> PM only
> !PM + ! PM_SLEEP
> 
> The sdhci_esdhc_suspend|resume are referenced by SYSTEM_SLEEP_PM_OPS.
> The pm_sleep_ptr() macro does the tricky, when both PM and PM_SLEEP are
> disabled, they are optimized out.

Hi Haibo,

Could you plz share your toolchain information? And FYI, today I tested
clang with the above three combinations, also no warnings. So I'm really
interested how to reproduce your warnings.

And the kernel CI build robot hasn't sent out warning email so far.

Thanks
> 
> So can you plz kindly show your toolchain? I will check
> 
> Thanks
> > 
> > Regards
> > Haibo Chen
> > > 
> > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> > > ---
> > >  drivers/mmc/host/sdhci-esdhc-imx.c | 13 +++----------
> > >  1 file changed, 3 insertions(+), 10 deletions(-)
> > > 
> > > diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c
> > > b/drivers/mmc/host/sdhci-esdhc-imx.c
> > > index a040c0896a7b..a7a5df673b0f 100644
> > > --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> > > +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> > > @@ -1650,7 +1650,6 @@ static void sdhci_esdhc_imx_hwinit(struct sdhci_host
> > > *host)
> > >  	}
> > >  }
> > > 
> > > -#ifdef CONFIG_PM_SLEEP
> > >  static void sdhc_esdhc_tuning_save(struct sdhci_host *host)  {
> > >  	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); @@ -1707,7
> > > +1706,6 @@ static void sdhc_esdhc_tuning_restore(struct sdhci_host *host)
> > >  		       host->ioaddr + ESDHC_TUNE_CTRL_STATUS);
> > >  	}
> > >  }
> > > -#endif
> > > 
> > >  static void esdhc_cqe_enable(struct mmc_host *mmc)  { @@ -2016,7
> > > +2014,6 @@ static void sdhci_esdhc_imx_remove(struct platform_device
> > > *pdev)
> > >  		cpu_latency_qos_remove_request(&imx_data->pm_qos_req);
> > >  }
> > > 
> > > -#ifdef CONFIG_PM_SLEEP
> > >  static int sdhci_esdhc_suspend(struct device *dev)  {
> > >  	struct sdhci_host *host = dev_get_drvdata(dev); @@ -2112,9 +2109,7 @@
> > > static int sdhci_esdhc_resume(struct device *dev)
> > > 
> > >  	return ret;
> > >  }
> > > -#endif
> > > 
> > > -#ifdef CONFIG_PM
> > >  static int sdhci_esdhc_runtime_suspend(struct device *dev)  {
> > >  	struct sdhci_host *host = dev_get_drvdata(dev); @@ -2188,12 +2183,10
> > > @@ static int sdhci_esdhc_runtime_resume(struct device *dev)
> > >  		cpu_latency_qos_remove_request(&imx_data->pm_qos_req);
> > >  	return err;
> > >  }
> > > -#endif
> > > 
> > >  static const struct dev_pm_ops sdhci_esdhc_pmops = {
> > > -	SET_SYSTEM_SLEEP_PM_OPS(sdhci_esdhc_suspend, sdhci_esdhc_resume)
> > > -	SET_RUNTIME_PM_OPS(sdhci_esdhc_runtime_suspend,
> > > -				sdhci_esdhc_runtime_resume, NULL)
> > > +	SYSTEM_SLEEP_PM_OPS(sdhci_esdhc_suspend, sdhci_esdhc_resume)
> > > +	RUNTIME_PM_OPS(sdhci_esdhc_runtime_suspend,
> > > +sdhci_esdhc_runtime_resume, NULL)
> > >  };
> > > 
> > >  static struct platform_driver sdhci_esdhc_imx_driver = { @@ -2201,7 +2194,7
> > > @@ static struct platform_driver sdhci_esdhc_imx_driver = {
> > >  		.name	= "sdhci-esdhc-imx",
> > >  		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
> > >  		.of_match_table = imx_esdhc_dt_ids,
> > > -		.pm	= &sdhci_esdhc_pmops,
> > > +		.pm	= pm_ptr(&sdhci_esdhc_pmops),
> > >  	},
> > >  	.probe		= sdhci_esdhc_imx_probe,
> > >  	.remove		= sdhci_esdhc_imx_remove,
> > > --
> > > 2.50.0
> > 

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 02/38] mmc: sdhci-of-dwcmshc: use modern PM macros
  2025-08-15  1:33 ` [PATCH 02/38] mmc: sdhci-of-dwcmshc: use modern PM macros Jisheng Zhang
@ 2025-08-18 18:30   ` Drew Fustini
  0 siblings, 0 replies; 52+ messages in thread
From: Drew Fustini @ 2025-08-18 18:30 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Michał Mirosław,
	Jaehoon Chung, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
	Russell King, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Adrian Hunter, Kamal Dasu,
	Al Cooper, Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov, linux-mmc,
	linux-kernel

On Fri, Aug 15, 2025 at 09:33:37AM +0800, Jisheng Zhang wrote:
> 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>
> ---
>  drivers/mmc/host/sdhci-of-dwcmshc.c | 13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)

Tested-by: Drew Fustini <fustini@kernel.org> # for TH1520 on LPi4a

^ permalink raw reply	[flat|nested] 52+ messages in thread

* RE: [PATCH 18/38] mmc: sdhci-esdhc-imx: use modern PM macros
  2025-08-18 12:15       ` Jisheng Zhang
@ 2025-08-19  3:48         ` Bough Chen
  2025-08-19 11:59           ` Jisheng Zhang
  0 siblings, 1 reply; 52+ messages in thread
From: Bough Chen @ 2025-08-19  3:48 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss,
	Micha�� Miros��aw, Jaehoon Chung,
	Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner, Russell King,
	Chaotian Jing, Matthias Brugger, AngeloGioacchino Del Regno,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Adrian Hunter, Kamal Dasu, Al Cooper,
	Broadcom internal kernel review list, Florian Fainelli,
	Michal Simek, Eugen Hristev, Vignesh Raghavendra, Ben Dooks,
	Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org

> -----Original Message-----
> From: Jisheng Zhang <jszhang@kernel.org>
> Sent: 2025年8月18日 20:15
> To: Bough Chen <haibo.chen@nxp.com>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>; Aubin Constans
> <aubin.constans@microchip.com>; Nicolas Ferre
> <nicolas.ferre@microchip.com>; Alexandre Belloni
> <alexandre.belloni@bootlin.com>; Claudiu Beznea
> <claudiu.beznea@tuxon.dev>; Manuel Lauss <manuel.lauss@gmail.com>;
> Micha�� Miros��aw <mirq-linux@rere.qmqm.pl>; Jaehoon Chung
> <jh80.chung@samsung.com>; Krzysztof Kozlowski <krzk@kernel.org>; Alim
> Akhtar <alim.akhtar@samsung.com>; Heiko Stuebner <heiko@sntech.de>;
> Russell King <linux@armlinux.org.uk>; Chaotian Jing
> <chaotian.jing@mediatek.com>; Matthias Brugger <matthias.bgg@gmail.com>;
> AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>;
> Shawn Guo <shawnguo@kernel.org>; Sascha Hauer <s.hauer@pengutronix.de>;
> Pengutronix Kernel Team <kernel@pengutronix.de>; Fabio Estevam
> <festevam@gmail.com>; Adrian Hunter <adrian.hunter@intel.com>; Kamal
> Dasu <kamal.dasu@broadcom.com>; Al Cooper <alcooperx@gmail.com>;
> Broadcom internal kernel review list
> <bcm-kernel-feedback-list@broadcom.com>; Florian Fainelli
> <florian.fainelli@broadcom.com>; Michal Simek <michal.simek@amd.com>;
> Eugen Hristev <eugen.hristev@linaro.org>; Vignesh Raghavendra
> <vigneshr@ti.com>; Ben Dooks <ben-linux@fluff.org>; Viresh Kumar
> <vireshk@kernel.org>; Orson Zhai <orsonzhai@gmail.com>; Baolin Wang
> <baolin.wang@linux.alibaba.com>; Chunyan Zhang <zhang.lyra@gmail.com>;
> Patrice Chotard <patrice.chotard@foss.st.com>; Thierry Reding
> <thierry.reding@gmail.com>; Jonathan Hunter <jonathanh@nvidia.com>;
> Chen-Yu Tsai <wens@csie.org>; Jernej Skrabec <jernej.skrabec@gmail.com>;
> Samuel Holland <samuel@sholland.org>; Alexey Charkov <alchark@gmail.com>;
> linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH 18/38] mmc: sdhci-esdhc-imx: use modern PM macros
> 
> On Sat, Aug 16, 2025 at 02:03:48PM +0800, Jisheng Zhang wrote:
> > On Fri, Aug 15, 2025 at 03:23:56AM +0000, Bough Chen wrote:
> > > > -----Original Message-----
> > > > From: Jisheng Zhang <jszhang@kernel.org>
> > > > Sent: 2025Ҵ8??15?? 9:34
> > > > To: Ulf Hansson <ulf.hansson@linaro.org>; Aubin Constans
> > > > <aubin.constans@microchip.com>; Nicolas Ferre
> > > > <nicolas.ferre@microchip.com>; Alexandre Belloni
> > > > <alexandre.belloni@bootlin.com>; Claudiu Beznea
> > > > <claudiu.beznea@tuxon.dev>; Manuel Lauss <manuel.lauss@gmail.com>;
> > > > Micha?? Miros??aw <mirq-linux@rere.qmqm.pl>; Jaehoon Chung
> > > > <jh80.chung@samsung.com>; Krzysztof Kozlowski <krzk@kernel.org>;
> > > > Alim Akhtar <alim.akhtar@samsung.com>; Heiko Stuebner
> > > > <heiko@sntech.de>; Russell King <linux@armlinux.org.uk>; Chaotian
> > > > Jing <chaotian.jing@mediatek.com>; Matthias Brugger
> > > > <matthias.bgg@gmail.com>; AngeloGioacchino Del Regno
> > > > <angelogioacchino.delregno@collabora.com>;
> > > > Shawn Guo <shawnguo@kernel.org>; Sascha Hauer
> > > > <s.hauer@pengutronix.de>; Pengutronix Kernel Team
> > > > <kernel@pengutronix.de>; Fabio Estevam <festevam@gmail.com>;
> > > > Adrian Hunter <adrian.hunter@intel.com>; Kamal Dasu
> > > > <kamal.dasu@broadcom.com>; Al Cooper <alcooperx@gmail.com>;
> > > > Broadcom internal kernel review list
> > > > <bcm-kernel-feedback-list@broadcom.com>; Florian Fainelli
> > > > <florian.fainelli@broadcom.com>; Bough Chen <haibo.chen@nxp.com>;
> > > > Michal Simek <michal.simek@amd.com>; Eugen Hristev
> > > > <eugen.hristev@linaro.org>; Vignesh Raghavendra <vigneshr@ti.com>;
> > > > Ben Dooks <ben-linux@fluff.org>; Viresh Kumar
> > > > <vireshk@kernel.org>; Orson Zhai <orsonzhai@gmail.com>; Baolin
> > > > Wang <baolin.wang@linux.alibaba.com>; Chunyan Zhang
> > > > <zhang.lyra@gmail.com>; Patrice Chotard
> > > > <patrice.chotard@foss.st.com>; Thierry Reding
> > > > <thierry.reding@gmail.com>; Jonathan Hunter
> > > > <jonathanh@nvidia.com>; Chen-Yu Tsai <wens@csie.org>; Jernej
> > > > Skrabec <jernej.skrabec@gmail.com>; Samuel Holland
> > > > <samuel@sholland.org>; Alexey Charkov <alchark@gmail.com>
> > > > Cc: linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org
> > > > Subject: [PATCH 18/38] mmc: sdhci-esdhc-imx: 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.
> > >
> > > Hi Jisheng,
> >
> > Hi,
> >
> > >
> > > When I remove all the configs under Power management options I got the
> following build warning:
> > >
> > > drivers/mmc/host/sdhci-esdhc-imx.c:2079:12: warning:
> > > ??sdhci_esdhc_resume?? defined but not used [-Wunused-function]
> > >  2079 | static int sdhci_esdhc_resume(struct device *dev)
> > >       |            ^~~~~~~~~~~~~~~~~~
> > >   CC      drivers/mmc/host/cqhci-core.o
> > > drivers/mmc/host/sdhci-esdhc-imx.c:2017:12: warning:
> > > ??sdhci_esdhc_suspend?? defined but not used [-Wunused-function]
> > >  2017 | static int sdhci_esdhc_suspend(struct device *dev)
> > >       |            ^~~~~~~~~~~~~~~~~~~
> >
> > Hmm interesting, what's test toolchain? I tested this patch with gcc14
> > with below three combinations before sending out, no warnings at all:
> > PM + PM_SLEEP
> > PM only
> > !PM + ! PM_SLEEP
> >
> > The sdhci_esdhc_suspend|resume are referenced by
> SYSTEM_SLEEP_PM_OPS.
> > The pm_sleep_ptr() macro does the tricky, when both PM and PM_SLEEP
> > are disabled, they are optimized out.
> 
> Hi Haibo,
> 
> Could you plz share your toolchain information? And FYI, today I tested clang
> with the above three combinations, also no warnings. So I'm really interested
> how to reproduce your warnings.
> 
> And the kernel CI build robot hasn't sent out warning email so far.

I'm not sure whether my test step is correct.
I find for ARM, it force to enable the CONFIG_PM. to test your patch, I force remove all the PM related configs in .config. then meet this warning. And also many other driver build warning.
Seems this test method is not correct, can anyone confirm here?

I did another test today, I enable the COMPILE_TEST, and use x86, chose the usdhc in menuconfig, disable CONFIG_PM, and build kernel by the following command, do not meet any warning:
make ARCH=x86 CC=gcc -j64
Seems this means !PM + !PM_SLEEP verify ok.

What's your method to test these PM related combination?

Regards
Haibo chen


> 
> Thanks
> >
> > So can you plz kindly show your toolchain? I will check
> >
> > Thanks
> > >
> > > Regards
> > > Haibo Chen
> > > >
> > > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> > > > ---
> > > >  drivers/mmc/host/sdhci-esdhc-imx.c | 13 +++----------
> > > >  1 file changed, 3 insertions(+), 10 deletions(-)
> > > >
> > > > diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c
> > > > b/drivers/mmc/host/sdhci-esdhc-imx.c
> > > > index a040c0896a7b..a7a5df673b0f 100644
> > > > --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> > > > +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> > > > @@ -1650,7 +1650,6 @@ static void sdhci_esdhc_imx_hwinit(struct
> > > > sdhci_host
> > > > *host)
> > > >  	}
> > > >  }
> > > >
> > > > -#ifdef CONFIG_PM_SLEEP
> > > >  static void sdhc_esdhc_tuning_save(struct sdhci_host *host)  {
> > > >  	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); @@
> > > > -1707,7
> > > > +1706,6 @@ static void sdhc_esdhc_tuning_restore(struct sdhci_host
> > > > +*host)
> > > >  		       host->ioaddr + ESDHC_TUNE_CTRL_STATUS);
> > > >  	}
> > > >  }
> > > > -#endif
> > > >
> > > >  static void esdhc_cqe_enable(struct mmc_host *mmc)  { @@ -2016,7
> > > > +2014,6 @@ static void sdhci_esdhc_imx_remove(struct
> > > > +platform_device
> > > > *pdev)
> > > >  		cpu_latency_qos_remove_request(&imx_data->pm_qos_req);
> > > >  }
> > > >
> > > > -#ifdef CONFIG_PM_SLEEP
> > > >  static int sdhci_esdhc_suspend(struct device *dev)  {
> > > >  	struct sdhci_host *host = dev_get_drvdata(dev); @@ -2112,9
> > > > +2109,7 @@ static int sdhci_esdhc_resume(struct device *dev)
> > > >
> > > >  	return ret;
> > > >  }
> > > > -#endif
> > > >
> > > > -#ifdef CONFIG_PM
> > > >  static int sdhci_esdhc_runtime_suspend(struct device *dev)  {
> > > >  	struct sdhci_host *host = dev_get_drvdata(dev); @@ -2188,12
> > > > +2183,10 @@ static int sdhci_esdhc_runtime_resume(struct device *dev)
> > > >  		cpu_latency_qos_remove_request(&imx_data->pm_qos_req);
> > > >  	return err;
> > > >  }
> > > > -#endif
> > > >
> > > >  static const struct dev_pm_ops sdhci_esdhc_pmops = {
> > > > -	SET_SYSTEM_SLEEP_PM_OPS(sdhci_esdhc_suspend,
> sdhci_esdhc_resume)
> > > > -	SET_RUNTIME_PM_OPS(sdhci_esdhc_runtime_suspend,
> > > > -				sdhci_esdhc_runtime_resume, NULL)
> > > > +	SYSTEM_SLEEP_PM_OPS(sdhci_esdhc_suspend, sdhci_esdhc_resume)
> > > > +	RUNTIME_PM_OPS(sdhci_esdhc_runtime_suspend,
> > > > +sdhci_esdhc_runtime_resume, NULL)
> > > >  };
> > > >
> > > >  static struct platform_driver sdhci_esdhc_imx_driver = { @@
> > > > -2201,7 +2194,7 @@ static struct platform_driver sdhci_esdhc_imx_driver
> = {
> > > >  		.name	= "sdhci-esdhc-imx",
> > > >  		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
> > > >  		.of_match_table = imx_esdhc_dt_ids,
> > > > -		.pm	= &sdhci_esdhc_pmops,
> > > > +		.pm	= pm_ptr(&sdhci_esdhc_pmops),
> > > >  	},
> > > >  	.probe		= sdhci_esdhc_imx_probe,
> > > >  	.remove		= sdhci_esdhc_imx_remove,
> > > > --
> > > > 2.50.0
> > >

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 18/38] mmc: sdhci-esdhc-imx: use modern PM macros
  2025-08-19  3:48         ` Bough Chen
@ 2025-08-19 11:59           ` Jisheng Zhang
  2025-08-20  2:15             ` Bough Chen
  0 siblings, 1 reply; 52+ messages in thread
From: Jisheng Zhang @ 2025-08-19 11:59 UTC (permalink / raw)
  To: Bough Chen
  Cc: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss,
	Micha�� Miros��aw, Jaehoon Chung,
	Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner, Russell King,
	Chaotian Jing, Matthias Brugger, AngeloGioacchino Del Regno,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Adrian Hunter, Kamal Dasu, Al Cooper,
	Broadcom internal kernel review list, Florian Fainelli,
	Michal Simek, Eugen Hristev, Vignesh Raghavendra, Ben Dooks,
	Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org

On Tue, Aug 19, 2025 at 03:48:57AM +0000, Bough Chen wrote:
> > -----Original Message-----
> > From: Jisheng Zhang <jszhang@kernel.org>
> > Sent: 2025年8月18日 20:15
> > To: Bough Chen <haibo.chen@nxp.com>
> > Cc: Ulf Hansson <ulf.hansson@linaro.org>; Aubin Constans
> > <aubin.constans@microchip.com>; Nicolas Ferre
> > <nicolas.ferre@microchip.com>; Alexandre Belloni
> > <alexandre.belloni@bootlin.com>; Claudiu Beznea
> > <claudiu.beznea@tuxon.dev>; Manuel Lauss <manuel.lauss@gmail.com>;
> > Micha�� Miros��aw <mirq-linux@rere.qmqm.pl>; Jaehoon Chung
> > <jh80.chung@samsung.com>; Krzysztof Kozlowski <krzk@kernel.org>; Alim
> > Akhtar <alim.akhtar@samsung.com>; Heiko Stuebner <heiko@sntech.de>;
> > Russell King <linux@armlinux.org.uk>; Chaotian Jing
> > <chaotian.jing@mediatek.com>; Matthias Brugger <matthias.bgg@gmail.com>;
> > AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>;
> > Shawn Guo <shawnguo@kernel.org>; Sascha Hauer <s.hauer@pengutronix.de>;
> > Pengutronix Kernel Team <kernel@pengutronix.de>; Fabio Estevam
> > <festevam@gmail.com>; Adrian Hunter <adrian.hunter@intel.com>; Kamal
> > Dasu <kamal.dasu@broadcom.com>; Al Cooper <alcooperx@gmail.com>;
> > Broadcom internal kernel review list
> > <bcm-kernel-feedback-list@broadcom.com>; Florian Fainelli
> > <florian.fainelli@broadcom.com>; Michal Simek <michal.simek@amd.com>;
> > Eugen Hristev <eugen.hristev@linaro.org>; Vignesh Raghavendra
> > <vigneshr@ti.com>; Ben Dooks <ben-linux@fluff.org>; Viresh Kumar
> > <vireshk@kernel.org>; Orson Zhai <orsonzhai@gmail.com>; Baolin Wang
> > <baolin.wang@linux.alibaba.com>; Chunyan Zhang <zhang.lyra@gmail.com>;
> > Patrice Chotard <patrice.chotard@foss.st.com>; Thierry Reding
> > <thierry.reding@gmail.com>; Jonathan Hunter <jonathanh@nvidia.com>;
> > Chen-Yu Tsai <wens@csie.org>; Jernej Skrabec <jernej.skrabec@gmail.com>;
> > Samuel Holland <samuel@sholland.org>; Alexey Charkov <alchark@gmail.com>;
> > linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org
> > Subject: Re: [PATCH 18/38] mmc: sdhci-esdhc-imx: use modern PM macros
> > 
> > On Sat, Aug 16, 2025 at 02:03:48PM +0800, Jisheng Zhang wrote:
> > > On Fri, Aug 15, 2025 at 03:23:56AM +0000, Bough Chen wrote:
> > > > > -----Original Message-----
> > > > > From: Jisheng Zhang <jszhang@kernel.org>
> > > > > Sent: 2025Ҵ8??15?? 9:34
> > > > > To: Ulf Hansson <ulf.hansson@linaro.org>; Aubin Constans
> > > > > <aubin.constans@microchip.com>; Nicolas Ferre
> > > > > <nicolas.ferre@microchip.com>; Alexandre Belloni
> > > > > <alexandre.belloni@bootlin.com>; Claudiu Beznea
> > > > > <claudiu.beznea@tuxon.dev>; Manuel Lauss <manuel.lauss@gmail.com>;
> > > > > Micha?? Miros??aw <mirq-linux@rere.qmqm.pl>; Jaehoon Chung
> > > > > <jh80.chung@samsung.com>; Krzysztof Kozlowski <krzk@kernel.org>;
> > > > > Alim Akhtar <alim.akhtar@samsung.com>; Heiko Stuebner
> > > > > <heiko@sntech.de>; Russell King <linux@armlinux.org.uk>; Chaotian
> > > > > Jing <chaotian.jing@mediatek.com>; Matthias Brugger
> > > > > <matthias.bgg@gmail.com>; AngeloGioacchino Del Regno
> > > > > <angelogioacchino.delregno@collabora.com>;
> > > > > Shawn Guo <shawnguo@kernel.org>; Sascha Hauer
> > > > > <s.hauer@pengutronix.de>; Pengutronix Kernel Team
> > > > > <kernel@pengutronix.de>; Fabio Estevam <festevam@gmail.com>;
> > > > > Adrian Hunter <adrian.hunter@intel.com>; Kamal Dasu
> > > > > <kamal.dasu@broadcom.com>; Al Cooper <alcooperx@gmail.com>;
> > > > > Broadcom internal kernel review list
> > > > > <bcm-kernel-feedback-list@broadcom.com>; Florian Fainelli
> > > > > <florian.fainelli@broadcom.com>; Bough Chen <haibo.chen@nxp.com>;
> > > > > Michal Simek <michal.simek@amd.com>; Eugen Hristev
> > > > > <eugen.hristev@linaro.org>; Vignesh Raghavendra <vigneshr@ti.com>;
> > > > > Ben Dooks <ben-linux@fluff.org>; Viresh Kumar
> > > > > <vireshk@kernel.org>; Orson Zhai <orsonzhai@gmail.com>; Baolin
> > > > > Wang <baolin.wang@linux.alibaba.com>; Chunyan Zhang
> > > > > <zhang.lyra@gmail.com>; Patrice Chotard
> > > > > <patrice.chotard@foss.st.com>; Thierry Reding
> > > > > <thierry.reding@gmail.com>; Jonathan Hunter
> > > > > <jonathanh@nvidia.com>; Chen-Yu Tsai <wens@csie.org>; Jernej
> > > > > Skrabec <jernej.skrabec@gmail.com>; Samuel Holland
> > > > > <samuel@sholland.org>; Alexey Charkov <alchark@gmail.com>
> > > > > Cc: linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org
> > > > > Subject: [PATCH 18/38] mmc: sdhci-esdhc-imx: 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.
> > > >
> > > > Hi Jisheng,
> > >
> > > Hi,
> > >
> > > >
> > > > When I remove all the configs under Power management options I got the
> > following build warning:
> > > >
> > > > drivers/mmc/host/sdhci-esdhc-imx.c:2079:12: warning:
> > > > ??sdhci_esdhc_resume?? defined but not used [-Wunused-function]
> > > >  2079 | static int sdhci_esdhc_resume(struct device *dev)
> > > >       |            ^~~~~~~~~~~~~~~~~~
> > > >   CC      drivers/mmc/host/cqhci-core.o
> > > > drivers/mmc/host/sdhci-esdhc-imx.c:2017:12: warning:
> > > > ??sdhci_esdhc_suspend?? defined but not used [-Wunused-function]
> > > >  2017 | static int sdhci_esdhc_suspend(struct device *dev)
> > > >       |            ^~~~~~~~~~~~~~~~~~~
> > >
> > > Hmm interesting, what's test toolchain? I tested this patch with gcc14
> > > with below three combinations before sending out, no warnings at all:
> > > PM + PM_SLEEP
> > > PM only
> > > !PM + ! PM_SLEEP
> > >
> > > The sdhci_esdhc_suspend|resume are referenced by
> > SYSTEM_SLEEP_PM_OPS.
> > > The pm_sleep_ptr() macro does the tricky, when both PM and PM_SLEEP
> > > are disabled, they are optimized out.
> > 
> > Hi Haibo,
> > 
> > Could you plz share your toolchain information? And FYI, today I tested clang
> > with the above three combinations, also no warnings. So I'm really interested
> > how to reproduce your warnings.
> > 
> > And the kernel CI build robot hasn't sent out warning email so far.
> 
> I'm not sure whether my test step is correct.
> I find for ARM, it force to enable the CONFIG_PM. to test your patch, I force remove all the PM related configs in .config. then meet this warning. And also many other driver build warning.

Now, I tried arm multi_v7_defconfig, then unselect those platforms which
enable CONFIG_PM, then enable COMPILE_TEST, then unselect CONFIG_PM and
CONFIG_PM_SLEEP, and build with  arm-linux-gnueabihf-gcc-14, stil no
any warning.
So can you plz share your defconfig? you can save it by 'make savedefconfig'
And I asked twice about your toolchain information, can you plz provide
it?

> Seems this test method is not correct, can anyone confirm here?
> 
> I did another test today, I enable the COMPILE_TEST, and use x86, chose the usdhc in menuconfig, disable CONFIG_PM, and build kernel by the following command, do not meet any warning:
> make ARCH=x86 CC=gcc -j64
> Seems this means !PM + !PM_SLEEP verify ok.

I tested not only x86, but also arm64 and riscv...

> 
> What's your method to test these PM related combination?

Similar as yours -- enable COMPILE_TEST.
Sure for the drivers I used: sdhci-of-dwcmshc, sdhci-pxav3 and
sdhci-xenon, I tested them.

B.R

^ permalink raw reply	[flat|nested] 52+ messages in thread

* RE: [PATCH 18/38] mmc: sdhci-esdhc-imx: use modern PM macros
  2025-08-19 11:59           ` Jisheng Zhang
@ 2025-08-20  2:15             ` Bough Chen
  0 siblings, 0 replies; 52+ messages in thread
From: Bough Chen @ 2025-08-20  2:15 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss,
	Micha�� Miros��aw, Jaehoon Chung,
	Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner, Russell King,
	Chaotian Jing, Matthias Brugger, AngeloGioacchino Del Regno,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Adrian Hunter, Kamal Dasu, Al Cooper,
	Broadcom internal kernel review list, Florian Fainelli,
	Michal Simek, Eugen Hristev, Vignesh Raghavendra, Ben Dooks,
	Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org

> -----Original Message-----
> From: Jisheng Zhang <jszhang@kernel.org>
> Sent: 2025年8月19日 19:59
> To: Bough Chen <haibo.chen@nxp.com>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>; Aubin Constans
> <aubin.constans@microchip.com>; Nicolas Ferre
> <nicolas.ferre@microchip.com>; Alexandre Belloni
> <alexandre.belloni@bootlin.com>; Claudiu Beznea
> <claudiu.beznea@tuxon.dev>; Manuel Lauss <manuel.lauss@gmail.com>;
> Micha�� Miros��aw <mirq-linux@rere.qmqm.pl>; Jaehoon Chung
> <jh80.chung@samsung.com>; Krzysztof Kozlowski <krzk@kernel.org>; Alim
> Akhtar <alim.akhtar@samsung.com>; Heiko Stuebner <heiko@sntech.de>;
> Russell King <linux@armlinux.org.uk>; Chaotian Jing
> <chaotian.jing@mediatek.com>; Matthias Brugger <matthias.bgg@gmail.com>;
> AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>;
> Shawn Guo <shawnguo@kernel.org>; Sascha Hauer <s.hauer@pengutronix.de>;
> Pengutronix Kernel Team <kernel@pengutronix.de>; Fabio Estevam
> <festevam@gmail.com>; Adrian Hunter <adrian.hunter@intel.com>; Kamal
> Dasu <kamal.dasu@broadcom.com>; Al Cooper <alcooperx@gmail.com>;
> Broadcom internal kernel review list
> <bcm-kernel-feedback-list@broadcom.com>; Florian Fainelli
> <florian.fainelli@broadcom.com>; Michal Simek <michal.simek@amd.com>;
> Eugen Hristev <eugen.hristev@linaro.org>; Vignesh Raghavendra
> <vigneshr@ti.com>; Ben Dooks <ben-linux@fluff.org>; Viresh Kumar
> <vireshk@kernel.org>; Orson Zhai <orsonzhai@gmail.com>; Baolin Wang
> <baolin.wang@linux.alibaba.com>; Chunyan Zhang <zhang.lyra@gmail.com>;
> Patrice Chotard <patrice.chotard@foss.st.com>; Thierry Reding
> <thierry.reding@gmail.com>; Jonathan Hunter <jonathanh@nvidia.com>;
> Chen-Yu Tsai <wens@csie.org>; Jernej Skrabec <jernej.skrabec@gmail.com>;
> Samuel Holland <samuel@sholland.org>; Alexey Charkov <alchark@gmail.com>;
> linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH 18/38] mmc: sdhci-esdhc-imx: use modern PM macros
> 
> On Tue, Aug 19, 2025 at 03:48:57AM +0000, Bough Chen wrote:
> > > -----Original Message-----
> > > From: Jisheng Zhang <jszhang@kernel.org>
> > > Sent: 2025年8月18日 20:15
> > > To: Bough Chen <haibo.chen@nxp.com>
> > > Cc: Ulf Hansson <ulf.hansson@linaro.org>; Aubin Constans
> > > <aubin.constans@microchip.com>; Nicolas Ferre
> > > <nicolas.ferre@microchip.com>; Alexandre Belloni
> > > <alexandre.belloni@bootlin.com>; Claudiu Beznea
> > > <claudiu.beznea@tuxon.dev>; Manuel Lauss <manuel.lauss@gmail.com>;
> > > Micha   Miros  aw <mirq-linux@rere.qmqm.pl>; Jaehoon Chung
> > > <jh80.chung@samsung.com>; Krzysztof Kozlowski <krzk@kernel.org>;
> > > Alim Akhtar <alim.akhtar@samsung.com>; Heiko Stuebner
> > > <heiko@sntech.de>; Russell King <linux@armlinux.org.uk>; Chaotian
> > > Jing <chaotian.jing@mediatek.com>; Matthias Brugger
> > > <matthias.bgg@gmail.com>; AngeloGioacchino Del Regno
> > > <angelogioacchino.delregno@collabora.com>;
> > > Shawn Guo <shawnguo@kernel.org>; Sascha Hauer
> > > <s.hauer@pengutronix.de>; Pengutronix Kernel Team
> > > <kernel@pengutronix.de>; Fabio Estevam <festevam@gmail.com>; Adrian
> > > Hunter <adrian.hunter@intel.com>; Kamal Dasu
> > > <kamal.dasu@broadcom.com>; Al Cooper <alcooperx@gmail.com>;
> Broadcom
> > > internal kernel review list <bcm-kernel-feedback-list@broadcom.com>;
> > > Florian Fainelli <florian.fainelli@broadcom.com>; Michal Simek
> > > <michal.simek@amd.com>; Eugen Hristev <eugen.hristev@linaro.org>;
> > > Vignesh Raghavendra <vigneshr@ti.com>; Ben Dooks
> > > <ben-linux@fluff.org>; Viresh Kumar <vireshk@kernel.org>; Orson Zhai
> > > <orsonzhai@gmail.com>; Baolin Wang <baolin.wang@linux.alibaba.com>;
> > > Chunyan Zhang <zhang.lyra@gmail.com>; Patrice Chotard
> > > <patrice.chotard@foss.st.com>; Thierry Reding
> > > <thierry.reding@gmail.com>; Jonathan Hunter <jonathanh@nvidia.com>;
> > > Chen-Yu Tsai <wens@csie.org>; Jernej Skrabec
> > > <jernej.skrabec@gmail.com>; Samuel Holland <samuel@sholland.org>;
> > > Alexey Charkov <alchark@gmail.com>; linux-mmc@vger.kernel.org;
> > > linux-kernel@vger.kernel.org
> > > Subject: Re: [PATCH 18/38] mmc: sdhci-esdhc-imx: use modern PM
> > > macros
> > >
> > > On Sat, Aug 16, 2025 at 02:03:48PM +0800, Jisheng Zhang wrote:
> > > > On Fri, Aug 15, 2025 at 03:23:56AM +0000, Bough Chen wrote:
> > > > > > -----Original Message-----
> > > > > > From: Jisheng Zhang <jszhang@kernel.org>
> > > > > > Sent: 2025Ҵ8??15?? 9:34
> > > > > > To: Ulf Hansson <ulf.hansson@linaro.org>; Aubin Constans
> > > > > > <aubin.constans@microchip.com>; Nicolas Ferre
> > > > > > <nicolas.ferre@microchip.com>; Alexandre Belloni
> > > > > > <alexandre.belloni@bootlin.com>; Claudiu Beznea
> > > > > > <claudiu.beznea@tuxon.dev>; Manuel Lauss
> > > > > > <manuel.lauss@gmail.com>; Micha?? Miros??aw
> > > > > > <mirq-linux@rere.qmqm.pl>; Jaehoon Chung
> > > > > > <jh80.chung@samsung.com>; Krzysztof Kozlowski
> > > > > > <krzk@kernel.org>; Alim Akhtar <alim.akhtar@samsung.com>;
> > > > > > Heiko Stuebner <heiko@sntech.de>; Russell King
> > > > > > <linux@armlinux.org.uk>; Chaotian Jing
> > > > > > <chaotian.jing@mediatek.com>; Matthias Brugger
> > > > > > <matthias.bgg@gmail.com>; AngeloGioacchino Del Regno
> > > > > > <angelogioacchino.delregno@collabora.com>;
> > > > > > Shawn Guo <shawnguo@kernel.org>; Sascha Hauer
> > > > > > <s.hauer@pengutronix.de>; Pengutronix Kernel Team
> > > > > > <kernel@pengutronix.de>; Fabio Estevam <festevam@gmail.com>;
> > > > > > Adrian Hunter <adrian.hunter@intel.com>; Kamal Dasu
> > > > > > <kamal.dasu@broadcom.com>; Al Cooper <alcooperx@gmail.com>;
> > > > > > Broadcom internal kernel review list
> > > > > > <bcm-kernel-feedback-list@broadcom.com>; Florian Fainelli
> > > > > > <florian.fainelli@broadcom.com>; Bough Chen
> > > > > > <haibo.chen@nxp.com>; Michal Simek <michal.simek@amd.com>;
> > > > > > Eugen Hristev <eugen.hristev@linaro.org>; Vignesh Raghavendra
> > > > > > <vigneshr@ti.com>; Ben Dooks <ben-linux@fluff.org>; Viresh
> > > > > > Kumar <vireshk@kernel.org>; Orson Zhai <orsonzhai@gmail.com>;
> > > > > > Baolin Wang <baolin.wang@linux.alibaba.com>; Chunyan Zhang
> > > > > > <zhang.lyra@gmail.com>; Patrice Chotard
> > > > > > <patrice.chotard@foss.st.com>; Thierry Reding
> > > > > > <thierry.reding@gmail.com>; Jonathan Hunter
> > > > > > <jonathanh@nvidia.com>; Chen-Yu Tsai <wens@csie.org>; Jernej
> > > > > > Skrabec <jernej.skrabec@gmail.com>; Samuel Holland
> > > > > > <samuel@sholland.org>; Alexey Charkov <alchark@gmail.com>
> > > > > > Cc: linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org
> > > > > > Subject: [PATCH 18/38] mmc: sdhci-esdhc-imx: 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.
> > > > >
> > > > > Hi Jisheng,
> > > >
> > > > Hi,
> > > >
> > > > >
> > > > > When I remove all the configs under Power management options I
> > > > > got the
> > > following build warning:
> > > > >
> > > > > drivers/mmc/host/sdhci-esdhc-imx.c:2079:12: warning:
> > > > > ??sdhci_esdhc_resume?? defined but not used [-Wunused-function]
> > > > >  2079 | static int sdhci_esdhc_resume(struct device *dev)
> > > > >       |            ^~~~~~~~~~~~~~~~~~
> > > > >   CC      drivers/mmc/host/cqhci-core.o
> > > > > drivers/mmc/host/sdhci-esdhc-imx.c:2017:12: warning:
> > > > > ??sdhci_esdhc_suspend?? defined but not used [-Wunused-function]
> > > > >  2017 | static int sdhci_esdhc_suspend(struct device *dev)
> > > > >       |            ^~~~~~~~~~~~~~~~~~~
> > > >
> > > > Hmm interesting, what's test toolchain? I tested this patch with
> > > > gcc14 with below three combinations before sending out, no warnings at
> all:
> > > > PM + PM_SLEEP
> > > > PM only
> > > > !PM + ! PM_SLEEP
> > > >
> > > > The sdhci_esdhc_suspend|resume are referenced by
> > > SYSTEM_SLEEP_PM_OPS.
> > > > The pm_sleep_ptr() macro does the tricky, when both PM and
> > > > PM_SLEEP are disabled, they are optimized out.
> > >
> > > Hi Haibo,
> > >
> > > Could you plz share your toolchain information? And FYI, today I
> > > tested clang with the above three combinations, also no warnings. So
> > > I'm really interested how to reproduce your warnings.
> > >
> > > And the kernel CI build robot hasn't sent out warning email so far.
> >
> > I'm not sure whether my test step is correct.
> > I find for ARM, it force to enable the CONFIG_PM. to test your patch, I force
> remove all the PM related configs in .config. then meet this warning. And also
> many other driver build warning.
> 
> Now, I tried arm multi_v7_defconfig, then unselect those platforms which
> enable CONFIG_PM, then enable COMPILE_TEST, then unselect CONFIG_PM
> and CONFIG_PM_SLEEP, and build with  arm-linux-gnueabihf-gcc-14, stil no any
> warning.
> So can you plz share your defconfig? you can save it by 'make savedefconfig'
> And I asked twice about your toolchain information, can you plz provide it?
> 

Please ignore my first reply, the test method is wrong. 
The toolchain is : aarch64-poky-linux-gcc-13.2.0
I just use the default defconfig in arch/arm64/config.


For this patch:
Reviewed-by: Haibo Chen <haibo.chen@nxp.com>

Regards
Haibo Chen

> > Seems this test method is not correct, can anyone confirm here?
> >
> > I did another test today, I enable the COMPILE_TEST, and use x86, chose the
> usdhc in menuconfig, disable CONFIG_PM, and build kernel by the following
> command, do not meet any warning:
> > make ARCH=x86 CC=gcc -j64
> > Seems this means !PM + !PM_SLEEP verify ok.
> 
> I tested not only x86, but also arm64 and riscv...
> 
> >
> > What's your method to test these PM related combination?
> 
> Similar as yours -- enable COMPILE_TEST.
> Sure for the drivers I used: sdhci-of-dwcmshc, sdhci-pxav3 and sdhci-xenon, I
> tested them.
> 
> B.R


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/38] mmc: cb710-mmc: use modern PM macros
  2025-08-15  1:33 ` [PATCH 09/38] mmc: cb710-mmc: " Jisheng Zhang
@ 2025-08-20 19:21   ` Michał Mirosław
  0 siblings, 0 replies; 52+ messages in thread
From: Michał Mirosław @ 2025-08-20 19:21 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: Ulf Hansson, Aubin Constans, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Manuel Lauss, Jaehoon Chung, Krzysztof Kozlowski,
	Alim Akhtar, Heiko Stuebner, Russell King, Chaotian Jing,
	Matthias Brugger, AngeloGioacchino Del Regno, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Adrian Hunter, Kamal Dasu, Al Cooper,
	Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov, linux-mmc,
	linux-kernel

On Fri, Aug 15, 2025 at 09:33:44AM +0800, Jisheng Zhang wrote:
> 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.
> 
> At the same time, replace the platform_driver's .suspend and .resume
> usage with modern device_driver's .pm usage.
> 
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> ---
>  drivers/mmc/host/cb710-mmc.c | 19 +++++++++----------
>  1 file changed, 9 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/mmc/host/cb710-mmc.c b/drivers/mmc/host/cb710-mmc.c
> index 448d2f9159ea..31daec787495 100644
> --- a/drivers/mmc/host/cb710-mmc.c
> +++ b/drivers/mmc/host/cb710-mmc.c
> @@ -664,25 +664,25 @@ static const struct mmc_host_ops cb710_mmc_host = {
>  	.get_cd = cb710_mmc_get_cd,
>  };
>  
> -#ifdef CONFIG_PM
> -
> -static int cb710_mmc_suspend(struct platform_device *pdev, pm_message_t state)
> +static int cb710_mmc_suspend(struct device *dev)
>  {
> +	struct platform_device *pdev = to_platform_device(dev);
>  	struct cb710_slot *slot = cb710_pdev_to_slot(pdev);
>  
>  	cb710_mmc_enable_irq(slot, 0, ~0);
>  	return 0;
>  }
>  
> -static int cb710_mmc_resume(struct platform_device *pdev)
> +static int cb710_mmc_resume(struct device *dev)
>  {
> +	struct platform_device *pdev = to_platform_device(dev);
>  	struct cb710_slot *slot = cb710_pdev_to_slot(pdev);
>  
>  	cb710_mmc_enable_irq(slot, 0, ~0);
>  	return 0;
>  }
>  
> -#endif /* CONFIG_PM */
> +static DEFINE_SIMPLE_DEV_PM_OPS(cb710_mmc_pmops, cb710_mmc_suspend, cb710_mmc_resume);
>  
>  static int cb710_mmc_init(struct platform_device *pdev)
>  {
> @@ -767,13 +767,12 @@ static void cb710_mmc_exit(struct platform_device *pdev)
>  }
>  
>  static struct platform_driver cb710_mmc_driver = {
> -	.driver.name = "cb710-mmc",
> +	.driver = {
> +		.name = "cb710-mmc",
> +		.pm = pm_sleep_ptr(&cb710_mmc_pmops),
> +	},
>  	.probe = cb710_mmc_init,
>  	.remove = cb710_mmc_exit,
> -#ifdef CONFIG_PM
> -	.suspend = cb710_mmc_suspend,
> -	.resume = cb710_mmc_resume,
> -#endif
>  };
>  
>  module_platform_driver(cb710_mmc_driver);
> -- 
> 2.50.0
> 

Acked-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 00/38] mmc: host: use modern PM macros
  2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
                   ` (37 preceding siblings ...)
  2025-08-15  1:34 ` [PATCH 38/38] mmc: dw_mmc-rockchip: " Jisheng Zhang
@ 2025-08-22 10:15 ` Ulf Hansson
  38 siblings, 0 replies; 52+ messages in thread
From: Ulf Hansson @ 2025-08-22 10:15 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: Aubin Constans, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Manuel Lauss, Michał Mirosław, Jaehoon Chung,
	Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner, Russell King,
	Chaotian Jing, Matthias Brugger, AngeloGioacchino Del Regno,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Adrian Hunter, Kamal Dasu, Al Cooper,
	Broadcom internal kernel review list, Florian Fainelli,
	Haibo Chen, Michal Simek, Eugen Hristev, Vignesh Raghavendra,
	Ben Dooks, Viresh Kumar, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Alexey Charkov, linux-mmc,
	linux-kernel

On Fri, 15 Aug 2025 at 03:51, Jisheng Zhang <jszhang@kernel.org> wrote:
>
> 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 or
> __maybe_unused.
>
> 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.
>
> Previously, I only cleaned up the host drivers which I used, e.g
> sdhci-of-dwcmshc, sdhci-pxav3 and sdhci-xenon, these are both compile
> tested and functionality tested. But then I also cleaned up other
> host drivers, but they are compile-tested only.
>
> Jisheng Zhang (38):
>   sdhci: add some simple inline functions for !CONFIG_PM
>   mmc: sdhci-of-dwcmshc: use modern PM macros
>   mmc: sdhci-xenon: use modern PM macros
>   mmc: sdhci-pxav3: use modern PM macros
>   mmc: sunxi: use modern PM macros
>   mmc: alcor: use modern PM macros
>   mmc: atmel: use modern PM macros
>   mmc: au1xmmc: use modern PM macros
>   mmc: cb710-mmc: use modern PM macros
>   mmc: davinci_mmc: use modern PM macros
>   mmc: mmci: use modern PM macros
>   mmc: mxs-mmc: use modern PM macros
>   mmc: omap_hsmmc: use modern PM macros
>   mmc: rtsx_usb_sdmmc: use modern PM macros
>   mmc: sdhci-acpi: use modern PM macros
>   mmc: sdhci_am654: use modern PM macros
>   mmc: sdhci-brcmstb: use modern PM macros
>   mmc: sdhci-esdhc-imx: use modern PM macros
>   mmc: sdhci-of-arasan: use modern PM macros
>   mmc: sdhci-of-at91: use modern PM macros
>   mmc: sdhci-of-esdhc: use modern PM macros
>   mmc: sdhci-omap: use modern PM macros
>   mmc: sdhci-cadence: use modern PM macros
>   mmc: sdhci-s3c: use modern PM macros
>   mmc: sdhci-spear: use modern PM macros
>   mmc: sdhci-sprd: use modern PM macros
>   mmc: sdhci-st: use modern PM macros
>   mmc: sdhci-tegra: use modern PM macros
>   mmc: sh_mmicf: use modern PM macros
>   mmc: toshsd: use modern PM macros
>   mmc: wmt-sdmmc: use modern PM macros
>   mmc: mtk-sd: use modern PM macros
>   mmc: sdhci-msm: use modern PM macros
>   mmc: via-sdmmc: use modern PM macros
>   mmc: dw_mmc: exynos: use modern PM macros
>   mmc: dw_mmc-k3: use modern PM macros
>   mmc: dw_mmc-pci: use modern PM macros
>   mmc: dw_mmc-rockchip: use modern PM macros
>
>  drivers/mmc/host/alcor.c            |  8 +++-----
>  drivers/mmc/host/atmel-mci.c        |  9 +++------
>  drivers/mmc/host/au1xmmc.c          | 18 +++++++-----------
>  drivers/mmc/host/cb710-mmc.c        | 19 +++++++++----------
>  drivers/mmc/host/davinci_mmc.c      | 14 +++-----------
>  drivers/mmc/host/dw_mmc-exynos.c    | 13 +++----------
>  drivers/mmc/host/dw_mmc-k3.c        |  9 +++------
>  drivers/mmc/host/dw_mmc-pci.c       |  9 +++------
>  drivers/mmc/host/dw_mmc-rockchip.c  |  9 +++------
>  drivers/mmc/host/dw_mmc.h           |  3 +++
>  drivers/mmc/host/mmci.c             |  9 +++------
>  drivers/mmc/host/mtk-sd.c           | 14 +++++++-------
>  drivers/mmc/host/mxs-mmc.c          |  6 ++----
>  drivers/mmc/host/omap_hsmmc.c       | 13 ++++---------
>  drivers/mmc/host/rtsx_usb_sdmmc.c   |  7 ++-----
>  drivers/mmc/host/sdhci-acpi.c       | 18 ++++--------------
>  drivers/mmc/host/sdhci-brcmstb.c    |  8 ++------
>  drivers/mmc/host/sdhci-cadence.c    |  8 ++------
>  drivers/mmc/host/sdhci-esdhc-imx.c  | 13 +++----------
>  drivers/mmc/host/sdhci-msm.c        | 21 +++++++++------------
>  drivers/mmc/host/sdhci-of-arasan.c  |  8 +++-----
>  drivers/mmc/host/sdhci-of-at91.c    | 12 +++---------
>  drivers/mmc/host/sdhci-of-dwcmshc.c | 13 +++----------
>  drivers/mmc/host/sdhci-of-esdhc.c   |  8 ++------
>  drivers/mmc/host/sdhci-omap.c       | 18 +++++++-----------
>  drivers/mmc/host/sdhci-pxav3.c      | 11 +++--------
>  drivers/mmc/host/sdhci-s3c.c        | 11 +++--------
>  drivers/mmc/host/sdhci-spear.c      |  6 ++----
>  drivers/mmc/host/sdhci-sprd.c       | 10 +++-------
>  drivers/mmc/host/sdhci-st.c         |  6 ++----
>  drivers/mmc/host/sdhci-tegra.c      | 13 +++++--------
>  drivers/mmc/host/sdhci-xenon.c      | 13 +++----------
>  drivers/mmc/host/sdhci.h            |  7 +++++++
>  drivers/mmc/host/sdhci_am654.c      | 10 +++-------
>  drivers/mmc/host/sh_mmcif.c         |  8 ++------
>  drivers/mmc/host/sunxi-mmc.c        | 11 +++--------
>  drivers/mmc/host/toshsd.c           |  8 ++------
>  drivers/mmc/host/via-sdmmc.c        | 10 +++++-----
>  drivers/mmc/host/wmt-sdmmc.c        | 16 ++--------------
>  39 files changed, 141 insertions(+), 286 deletions(-)
>
> --
> 2.50.0
>

The series applied for next, thanks!

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 52+ messages in thread

end of thread, other threads:[~2025-08-22 10:16 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
2025-08-15  1:33 ` [PATCH 01/38] sdhci: add some simple inline functions for !CONFIG_PM Jisheng Zhang
2025-08-18 11:29   ` Adrian Hunter
2025-08-15  1:33 ` [PATCH 02/38] mmc: sdhci-of-dwcmshc: use modern PM macros Jisheng Zhang
2025-08-18 18:30   ` Drew Fustini
2025-08-15  1:33 ` [PATCH 03/38] mmc: sdhci-xenon: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 04/38] mmc: sdhci-pxav3: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 05/38] mmc: sunxi: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 06/38] mmc: alcor: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 07/38] mmc: atmel: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 08/38] mmc: au1xmmc: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 09/38] mmc: cb710-mmc: " Jisheng Zhang
2025-08-20 19:21   ` Michał Mirosław
2025-08-15  1:33 ` [PATCH 10/38] mmc: davinci_mmc: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 11/38] mmc: mmci: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 12/38] mmc: mxs-mmc: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 13/38] mmc: omap_hsmmc: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 14/38] mmc: rtsx_usb_sdmmc: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 15/38] mmc: sdhci-acpi: " Jisheng Zhang
2025-08-18 10:40   ` Adrian Hunter
2025-08-15  1:33 ` [PATCH 16/38] mmc: sdhci_am654: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 17/38] mmc: sdhci-brcmstb: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 18/38] mmc: sdhci-esdhc-imx: " Jisheng Zhang
2025-08-15  3:23   ` Bough Chen
2025-08-16  6:03     ` Jisheng Zhang
2025-08-18 12:15       ` Jisheng Zhang
2025-08-19  3:48         ` Bough Chen
2025-08-19 11:59           ` Jisheng Zhang
2025-08-20  2:15             ` Bough Chen
2025-08-15  1:33 ` [PATCH 19/38] mmc: sdhci-of-arasan: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 20/38] mmc: sdhci-of-at91: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 21/38] mmc: sdhci-of-esdhc: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 22/38] mmc: sdhci-omap: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 23/38] mmc: sdhci-cadence: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 24/38] mmc: sdhci-s3c: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 25/38] mmc: sdhci-spear: " Jisheng Zhang
2025-08-18  6:38   ` Viresh Kumar
2025-08-15  1:34 ` [PATCH 26/38] mmc: sdhci-sprd: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 27/38] mmc: sdhci-st: " Jisheng Zhang
2025-08-18  8:49   ` Patrice CHOTARD
2025-08-15  1:34 ` [PATCH 28/38] mmc: sdhci-tegra: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 29/38] mmc: sh_mmicf: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 30/38] mmc: toshsd: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 31/38] mmc: wmt-sdmmc: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 32/38] mmc: mtk-sd: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 33/38] mmc: sdhci-msm: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 34/38] mmc: via-sdmmc: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 35/38] mmc: dw_mmc: exynos: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 36/38] mmc: dw_mmc-k3: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 37/38] mmc: dw_mmc-pci: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 38/38] mmc: dw_mmc-rockchip: " Jisheng Zhang
2025-08-22 10:15 ` [PATCH 00/38] mmc: host: " Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).