* [PATCH 00/39] spi: use modern PM macros
@ 2026-08-03 14:19 Jisheng Zhang
2026-08-03 14:19 ` [PATCH 01/39] spi: atmel-quadspi: " Jisheng Zhang
` (38 more replies)
0 siblings, 39 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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.
Compiled testd for arm, arm64, riscv and riscv64 with below
combinations:
!PM && !PM_SLEEP
PM && !PM_SLEEP
PM && PM_SLEEP
Jisheng Zhang (39):
spi: atmel-quadspi: use modern PM macros
spi: amlogic-spifc-a1: use modern PM macros
spi: at91-usart: use modern PM macros
spi: axiado: use modern PM macros
spi: bcm-qspi: use modern PM macros
spi: bcm63xx-hsspi: use modern PM macros
spi: bcmbca-hsspi: use modern PM macros
spi: cadence: use modern PM macros
spi: coldfire-qspi: use modern PM macros
spi: dln2: use modern PM macros
spi: dw-pci: use modern PM macros
spi: spi-fsl-dspi: use modern PM macros
spi: fsl-espi: use modern PM macros
spi: fsl-lpspi: use modern PM macros
spi: qcom-geni: use modern PM macros
spi: img-spfi: use modern PM macros
spi: loongson: use modern PM macros
spi: meson-spifc: use modern PM macros
spi: mt65xx: use modern PM macros
spi: mtk-nor: use modern PM macros
spi: mxic: use modern PM macros
spi: omap2-mcspi: use modern PM macros
spi: orion: use modern PM macros
spi: pl022: use modern PM macros
spi: spi-qcom-qspi: use modern PM macros
spi: qup: use modern PM macros
spi: rockchip-sfc: use modern PM macros
spi: rockchip: use modern PM macros
spi: s3c64xx: use modern PM macros
spi: slave-mt27xx: use modern PM macros
spi: sprd: use modern PM macros
spi: sunplus-sp7021: use modern PM macros
spi: syncuacer: use modern PM macros
spi: tegra114: use modern PM macros
spi: tegra20-sflash: use modern PM macros
spi: tegra20-slink: use modern PM macros
spi: tegra210-quad: use modern PM macros
spi: topcliff-pch: use modern PM macros
spi: zynqmp-gqspi: use modern PM macros
drivers/spi/atmel-quadspi.c | 16 +++++-----
drivers/spi/spi-amlogic-spifc-a1.c | 15 ++++------
drivers/spi/spi-at91-usart.c | 8 ++---
drivers/spi/spi-axiado.c | 15 +++++-----
drivers/spi/spi-bcm-qspi.c | 6 ++--
drivers/spi/spi-bcm63xx-hsspi.c | 8 ++---
drivers/spi/spi-bcmbca-hsspi.c | 8 ++---
drivers/spi/spi-brcmstb-qspi.c | 2 +-
drivers/spi/spi-cadence.c | 15 +++++-----
drivers/spi/spi-coldfire-qspi.c | 12 +++-----
drivers/spi/spi-dln2.c | 11 ++-----
drivers/spi/spi-dw-pci.c | 6 ++--
drivers/spi/spi-fsl-dspi.c | 6 ++--
drivers/spi/spi-fsl-espi.c | 11 ++-----
drivers/spi/spi-fsl-lpspi.c | 6 ++--
drivers/spi/spi-geni-qcom.c | 15 +++++-----
drivers/spi/spi-img-spfi.c | 11 ++-----
drivers/spi/spi-iproc-qspi.c | 2 +-
drivers/spi/spi-loongson-core.c | 4 +--
drivers/spi/spi-loongson-pci.c | 2 +-
drivers/spi/spi-loongson-plat.c | 2 +-
drivers/spi/spi-meson-spifc.c | 14 ++++-----
drivers/spi/spi-mt65xx.c | 11 ++-----
drivers/spi/spi-mtk-nor.c | 15 +++++-----
drivers/spi/spi-mxic.c | 9 +++---
drivers/spi/spi-omap2-mcspi.c | 9 +++---
drivers/spi/spi-orion.c | 12 +++-----
drivers/spi/spi-pl022.c | 10 ++-----
drivers/spi/spi-qcom-qspi.c | 16 +++++-----
drivers/spi/spi-qup.c | 14 ++++-----
drivers/spi/spi-rockchip-sfc.c | 12 +++-----
drivers/spi/spi-rockchip.c | 12 +++-----
drivers/spi/spi-s3c64xx.c | 12 +++-----
drivers/spi/spi-slave-mt27xx.c | 12 +++-----
drivers/spi/spi-sprd.c | 9 +++---
drivers/spi/spi-sunplus-sp7021.c | 16 +++++-----
drivers/spi/spi-synquacer.c | 10 +++----
drivers/spi/spi-tegra114.c | 10 +++----
drivers/spi/spi-tegra20-sflash.c | 10 +++----
drivers/spi/spi-tegra20-slink.c | 14 ++++-----
drivers/spi/spi-tegra210-quad.c | 14 ++++-----
drivers/spi/spi-topcliff-pch.c | 47 +++++++++++++-----------------
drivers/spi/spi-zynqmp-gqspi.c | 15 +++++-----
43 files changed, 195 insertions(+), 289 deletions(-)
--
2.53.0
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 01/39] spi: atmel-quadspi: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 02/39] spi: amlogic-spifc-a1: " Jisheng Zhang
` (37 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/atmel-quadspi.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c
index aaf7f4c46b22..28b6cfcaf34c 100644
--- a/drivers/spi/atmel-quadspi.c
+++ b/drivers/spi/atmel-quadspi.c
@@ -1527,7 +1527,7 @@ static void atmel_qspi_remove(struct platform_device *pdev)
}
}
-static int __maybe_unused atmel_qspi_suspend(struct device *dev)
+static int atmel_qspi_suspend(struct device *dev)
{
struct spi_controller *ctrl = dev_get_drvdata(dev);
struct atmel_qspi *aq = spi_controller_get_devdata(ctrl);
@@ -1554,7 +1554,7 @@ static int __maybe_unused atmel_qspi_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused atmel_qspi_resume(struct device *dev)
+static int atmel_qspi_resume(struct device *dev)
{
struct spi_controller *ctrl = dev_get_drvdata(dev);
struct atmel_qspi *aq = spi_controller_get_devdata(ctrl);
@@ -1586,7 +1586,7 @@ static int __maybe_unused atmel_qspi_resume(struct device *dev)
return 0;
}
-static int __maybe_unused atmel_qspi_runtime_suspend(struct device *dev)
+static int atmel_qspi_runtime_suspend(struct device *dev)
{
struct spi_controller *ctrl = dev_get_drvdata(dev);
struct atmel_qspi *aq = spi_controller_get_devdata(ctrl);
@@ -1597,7 +1597,7 @@ static int __maybe_unused atmel_qspi_runtime_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused atmel_qspi_runtime_resume(struct device *dev)
+static int atmel_qspi_runtime_resume(struct device *dev)
{
struct spi_controller *ctrl = dev_get_drvdata(dev);
struct atmel_qspi *aq = spi_controller_get_devdata(ctrl);
@@ -1614,10 +1614,10 @@ static int __maybe_unused atmel_qspi_runtime_resume(struct device *dev)
return ret;
}
-static const struct dev_pm_ops __maybe_unused atmel_qspi_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(atmel_qspi_suspend, atmel_qspi_resume)
- SET_RUNTIME_PM_OPS(atmel_qspi_runtime_suspend,
- atmel_qspi_runtime_resume, NULL)
+static const struct dev_pm_ops atmel_qspi_pm_ops = {
+ SYSTEM_SLEEP_PM_OPS(atmel_qspi_suspend, atmel_qspi_resume)
+ RUNTIME_PM_OPS(atmel_qspi_runtime_suspend,
+ atmel_qspi_runtime_resume, NULL)
};
static const struct atmel_qspi_caps atmel_sama5d2_qspi_caps = {};
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 02/39] spi: amlogic-spifc-a1: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
2026-08-03 14:19 ` [PATCH 01/39] spi: atmel-quadspi: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 03/39] spi: at91-usart: " Jisheng Zhang
` (36 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-amlogic-spifc-a1.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/drivers/spi/spi-amlogic-spifc-a1.c b/drivers/spi/spi-amlogic-spifc-a1.c
index 77a2c11bec5e..388bd2472dc0 100644
--- a/drivers/spi/spi-amlogic-spifc-a1.c
+++ b/drivers/spi/spi-amlogic-spifc-a1.c
@@ -374,7 +374,6 @@ static int amlogic_spifc_a1_probe(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
static int amlogic_spifc_a1_suspend(struct device *dev)
{
struct amlogic_spifc_a1 *spifc = dev_get_drvdata(dev);
@@ -409,9 +408,7 @@ static int amlogic_spifc_a1_resume(struct device *dev)
return ret;
}
-#endif /* CONFIG_PM_SLEEP */
-#ifdef CONFIG_PM
static int amlogic_spifc_a1_runtime_suspend(struct device *dev)
{
struct amlogic_spifc_a1 *spifc = dev_get_drvdata(dev);
@@ -432,14 +429,12 @@ static int amlogic_spifc_a1_runtime_resume(struct device *dev)
return ret;
}
-#endif /* CONFIG_PM */
static const struct dev_pm_ops amlogic_spifc_a1_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(amlogic_spifc_a1_suspend,
- amlogic_spifc_a1_resume)
- SET_RUNTIME_PM_OPS(amlogic_spifc_a1_runtime_suspend,
- amlogic_spifc_a1_runtime_resume,
- NULL)
+ SYSTEM_SLEEP_PM_OPS(amlogic_spifc_a1_suspend, amlogic_spifc_a1_resume)
+ RUNTIME_PM_OPS(amlogic_spifc_a1_runtime_suspend,
+ amlogic_spifc_a1_runtime_resume,
+ NULL)
};
#ifdef CONFIG_OF
@@ -455,7 +450,7 @@ static struct platform_driver amlogic_spifc_a1_driver = {
.driver = {
.name = "amlogic-spifc-a1",
.of_match_table = of_match_ptr(amlogic_spifc_a1_dt_match),
- .pm = &amlogic_spifc_a1_pm_ops,
+ .pm = pm_ptr(&amlogic_spifc_a1_pm_ops),
},
};
module_platform_driver(amlogic_spifc_a1_driver);
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 03/39] spi: at91-usart: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
2026-08-03 14:19 ` [PATCH 01/39] spi: atmel-quadspi: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 02/39] spi: amlogic-spifc-a1: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 04/39] spi: axiado: " Jisheng Zhang
` (35 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-at91-usart.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c
index 77cad4118202..804f6194c830 100644
--- a/drivers/spi/spi-at91-usart.c
+++ b/drivers/spi/spi-at91-usart.c
@@ -571,7 +571,7 @@ static int at91_usart_spi_probe(struct platform_device *pdev)
return ret;
}
-__maybe_unused static int at91_usart_spi_suspend(struct device *dev)
+static int at91_usart_spi_suspend(struct device *dev)
{
struct spi_controller *ctrl = dev_get_drvdata(dev);
struct at91_usart_spi *aus = spi_controller_get_devdata(ctrl);
@@ -587,7 +587,7 @@ __maybe_unused static int at91_usart_spi_suspend(struct device *dev)
return 0;
}
-__maybe_unused static int at91_usart_spi_resume(struct device *dev)
+static int at91_usart_spi_resume(struct device *dev)
{
struct spi_controller *ctrl = dev_get_drvdata(dev);
struct at91_usart_spi *aus = spi_controller_get_devdata(ctrl);
@@ -616,13 +616,13 @@ static void at91_usart_spi_remove(struct platform_device *pdev)
}
static const struct dev_pm_ops at91_usart_spi_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(at91_usart_spi_suspend, at91_usart_spi_resume)
+ SYSTEM_SLEEP_PM_OPS(at91_usart_spi_suspend, at91_usart_spi_resume)
};
static struct platform_driver at91_usart_spi_driver = {
.driver = {
.name = "at91_usart_spi",
- .pm = &at91_usart_spi_pm_ops,
+ .pm = pm_sleep_ptr(&at91_usart_spi_pm_ops),
},
.probe = at91_usart_spi_probe,
.remove = at91_usart_spi_remove,
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 04/39] spi: axiado: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (2 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 03/39] spi: at91-usart: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 05/39] spi: bcm-qspi: " Jisheng Zhang
` (34 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-axiado.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-axiado.c b/drivers/spi/spi-axiado.c
index 649f149617ce..c8e389e3e97e 100644
--- a/drivers/spi/spi-axiado.c
+++ b/drivers/spi/spi-axiado.c
@@ -902,7 +902,7 @@ static void ax_spi_remove(struct platform_device *pdev)
*
* Return: 0 on success and error value on error
*/
-static int __maybe_unused ax_spi_suspend(struct device *dev)
+static int ax_spi_suspend(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
@@ -917,7 +917,7 @@ static int __maybe_unused ax_spi_suspend(struct device *dev)
*
* Return: 0 on success and error value on error
*/
-static int __maybe_unused ax_spi_resume(struct device *dev)
+static int ax_spi_resume(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
struct ax_spi *xspi = spi_controller_get_devdata(ctlr);
@@ -934,7 +934,7 @@ static int __maybe_unused ax_spi_resume(struct device *dev)
*
* Return: 0 on success and error value on error
*/
-static int __maybe_unused ax_spi_runtime_resume(struct device *dev)
+static int ax_spi_runtime_resume(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
struct ax_spi *xspi = spi_controller_get_devdata(ctlr);
@@ -963,7 +963,7 @@ static int __maybe_unused ax_spi_runtime_resume(struct device *dev)
*
* Return: Always 0
*/
-static int __maybe_unused ax_spi_runtime_suspend(struct device *dev)
+static int ax_spi_runtime_suspend(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
struct ax_spi *xspi = spi_controller_get_devdata(ctlr);
@@ -975,9 +975,8 @@ static int __maybe_unused ax_spi_runtime_suspend(struct device *dev)
}
static const struct dev_pm_ops ax_spi_dev_pm_ops = {
- SET_RUNTIME_PM_OPS(ax_spi_runtime_suspend,
- ax_spi_runtime_resume, NULL)
- SET_SYSTEM_SLEEP_PM_OPS(ax_spi_suspend, ax_spi_resume)
+ RUNTIME_PM_OPS(ax_spi_runtime_suspend, ax_spi_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(ax_spi_suspend, ax_spi_resume)
};
static const struct of_device_id ax_spi_of_match[] = {
@@ -993,7 +992,7 @@ static struct platform_driver ax_spi_driver = {
.driver = {
.name = AX_SPI_NAME,
.of_match_table = ax_spi_of_match,
- .pm = &ax_spi_dev_pm_ops,
+ .pm = pm_ptr(&ax_spi_dev_pm_ops),
},
};
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 05/39] spi: bcm-qspi: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (3 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 04/39] spi: axiado: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 06/39] spi: bcm63xx-hsspi: " Jisheng Zhang
` (33 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-bcm-qspi.c | 6 +++---
drivers/spi/spi-brcmstb-qspi.c | 2 +-
drivers/spi/spi-iproc-qspi.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c
index dcade7b99cef..0db24fe7a109 100644
--- a/drivers/spi/spi-bcm-qspi.c
+++ b/drivers/spi/spi-bcm-qspi.c
@@ -1689,7 +1689,7 @@ void bcm_qspi_remove(struct platform_device *pdev)
/* function to be called by SoC specific platform driver remove() */
EXPORT_SYMBOL_GPL(bcm_qspi_remove);
-static int __maybe_unused bcm_qspi_suspend(struct device *dev)
+static int bcm_qspi_suspend(struct device *dev)
{
struct bcm_qspi *qspi = dev_get_drvdata(dev);
@@ -1705,7 +1705,7 @@ static int __maybe_unused bcm_qspi_suspend(struct device *dev)
return 0;
};
-static int __maybe_unused bcm_qspi_resume(struct device *dev)
+static int bcm_qspi_resume(struct device *dev)
{
struct bcm_qspi *qspi = dev_get_drvdata(dev);
int ret = 0;
@@ -1724,7 +1724,7 @@ static int __maybe_unused bcm_qspi_resume(struct device *dev)
return ret;
}
-SIMPLE_DEV_PM_OPS(bcm_qspi_pm_ops, bcm_qspi_suspend, bcm_qspi_resume);
+DEFINE_SIMPLE_DEV_PM_OPS(bcm_qspi_pm_ops, bcm_qspi_suspend, bcm_qspi_resume);
/* pm_ops to be called by SoC specific platform driver */
EXPORT_SYMBOL_GPL(bcm_qspi_pm_ops);
diff --git a/drivers/spi/spi-brcmstb-qspi.c b/drivers/spi/spi-brcmstb-qspi.c
index 7a33b479c1f7..651a73446cff 100644
--- a/drivers/spi/spi-brcmstb-qspi.c
+++ b/drivers/spi/spi-brcmstb-qspi.c
@@ -31,7 +31,7 @@ static struct platform_driver brcmstb_qspi_driver = {
.remove = brcmstb_qspi_remove,
.driver = {
.name = "brcmstb_qspi",
- .pm = &bcm_qspi_pm_ops,
+ .pm = pm_sleep_ptr(&bcm_qspi_pm_ops),
.of_match_table = brcmstb_qspi_of_match,
}
};
diff --git a/drivers/spi/spi-iproc-qspi.c b/drivers/spi/spi-iproc-qspi.c
index 392acc4026ab..5255d5124385 100644
--- a/drivers/spi/spi-iproc-qspi.c
+++ b/drivers/spi/spi-iproc-qspi.c
@@ -141,7 +141,7 @@ static struct platform_driver bcm_iproc_driver = {
.remove = bcm_iproc_remove,
.driver = {
.name = "bcm_iproc",
- .pm = &bcm_qspi_pm_ops,
+ .pm = pm_sleep_ptr(&bcm_qspi_pm_ops),
.of_match_table = bcm_iproc_of_match,
}
};
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 06/39] spi: bcm63xx-hsspi: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (4 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 05/39] spi: bcm-qspi: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 07/39] spi: bcmbca-hsspi: " Jisheng Zhang
` (32 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-bcm63xx-hsspi.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/spi-bcm63xx-hsspi.c b/drivers/spi/spi-bcm63xx-hsspi.c
index 58012e1b5ae7..ca6cf7c19835 100644
--- a/drivers/spi/spi-bcm63xx-hsspi.c
+++ b/drivers/spi/spi-bcm63xx-hsspi.c
@@ -884,7 +884,6 @@ static void bcm63xx_hsspi_remove(struct platform_device *pdev)
sysfs_remove_group(&pdev->dev.kobj, &bcm63xx_hsspi_group);
}
-#ifdef CONFIG_PM_SLEEP
static int bcm63xx_hsspi_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -919,10 +918,9 @@ static int bcm63xx_hsspi_resume(struct device *dev)
return 0;
}
-#endif
-static SIMPLE_DEV_PM_OPS(bcm63xx_hsspi_pm_ops, bcm63xx_hsspi_suspend,
- bcm63xx_hsspi_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(bcm63xx_hsspi_pm_ops, bcm63xx_hsspi_suspend,
+ bcm63xx_hsspi_resume);
static const struct of_device_id bcm63xx_hsspi_of_match[] = {
{ .compatible = "brcm,bcm6328-hsspi", },
@@ -934,7 +932,7 @@ MODULE_DEVICE_TABLE(of, bcm63xx_hsspi_of_match);
static struct platform_driver bcm63xx_hsspi_driver = {
.driver = {
.name = "bcm63xx-hsspi",
- .pm = &bcm63xx_hsspi_pm_ops,
+ .pm = pm_sleep_ptr(&bcm63xx_hsspi_pm_ops),
.of_match_table = bcm63xx_hsspi_of_match,
},
.probe = bcm63xx_hsspi_probe,
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 07/39] spi: bcmbca-hsspi: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (5 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 06/39] spi: bcm63xx-hsspi: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 08/39] spi: cadence: " Jisheng Zhang
` (31 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-bcmbca-hsspi.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/spi-bcmbca-hsspi.c b/drivers/spi/spi-bcmbca-hsspi.c
index 09c1472ae4fa..570ea635ab0c 100644
--- a/drivers/spi/spi-bcmbca-hsspi.c
+++ b/drivers/spi/spi-bcmbca-hsspi.c
@@ -563,7 +563,6 @@ static void bcmbca_hsspi_remove(struct platform_device *pdev)
sysfs_remove_group(&pdev->dev.kobj, &bcmbca_hsspi_group);
}
-#ifdef CONFIG_PM_SLEEP
static int bcmbca_hsspi_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -598,10 +597,9 @@ static int bcmbca_hsspi_resume(struct device *dev)
return 0;
}
-#endif
-static SIMPLE_DEV_PM_OPS(bcmbca_hsspi_pm_ops, bcmbca_hsspi_suspend,
- bcmbca_hsspi_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(bcmbca_hsspi_pm_ops, bcmbca_hsspi_suspend,
+ bcmbca_hsspi_resume);
static const struct of_device_id bcmbca_hsspi_of_match[] = {
{ .compatible = "brcm,bcmbca-hsspi-v1.1", },
@@ -613,7 +611,7 @@ MODULE_DEVICE_TABLE(of, bcmbca_hsspi_of_match);
static struct platform_driver bcmbca_hsspi_driver = {
.driver = {
.name = "bcmbca-hsspi",
- .pm = &bcmbca_hsspi_pm_ops,
+ .pm = pm_sleep_ptr(&bcmbca_hsspi_pm_ops),
.of_match_table = bcmbca_hsspi_of_match,
},
.probe = bcmbca_hsspi_probe,
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 08/39] spi: cadence: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (6 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 07/39] spi: bcmbca-hsspi: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 09/39] spi: coldfire-qspi: " Jisheng Zhang
` (30 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-cadence.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-cadence.c b/drivers/spi/spi-cadence.c
index 9b4e5b7013ae..a5e1e5a46bb4 100644
--- a/drivers/spi/spi-cadence.c
+++ b/drivers/spi/spi-cadence.c
@@ -801,7 +801,7 @@ static void cdns_spi_remove(struct platform_device *pdev)
*
* Return: 0 on success and error value on error
*/
-static int __maybe_unused cdns_spi_suspend(struct device *dev)
+static int cdns_spi_suspend(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
@@ -816,7 +816,7 @@ static int __maybe_unused cdns_spi_suspend(struct device *dev)
*
* Return: 0 on success and error value on error
*/
-static int __maybe_unused cdns_spi_resume(struct device *dev)
+static int cdns_spi_resume(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
struct cdns_spi *xspi = spi_controller_get_devdata(ctlr);
@@ -833,7 +833,7 @@ static int __maybe_unused cdns_spi_resume(struct device *dev)
*
* Return: 0 on success and error value on error
*/
-static int __maybe_unused cdns_spi_runtime_resume(struct device *dev)
+static int cdns_spi_runtime_resume(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
struct cdns_spi *xspi = spi_controller_get_devdata(ctlr);
@@ -862,7 +862,7 @@ static int __maybe_unused cdns_spi_runtime_resume(struct device *dev)
*
* Return: Always 0
*/
-static int __maybe_unused cdns_spi_runtime_suspend(struct device *dev)
+static int cdns_spi_runtime_suspend(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
struct cdns_spi *xspi = spi_controller_get_devdata(ctlr);
@@ -874,9 +874,8 @@ static int __maybe_unused cdns_spi_runtime_suspend(struct device *dev)
}
static const struct dev_pm_ops cdns_spi_dev_pm_ops = {
- SET_RUNTIME_PM_OPS(cdns_spi_runtime_suspend,
- cdns_spi_runtime_resume, NULL)
- SET_SYSTEM_SLEEP_PM_OPS(cdns_spi_suspend, cdns_spi_resume)
+ RUNTIME_PM_OPS(cdns_spi_runtime_suspend, cdns_spi_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(cdns_spi_suspend, cdns_spi_resume)
};
static const struct of_device_id cdns_spi_of_match[] = {
@@ -894,7 +893,7 @@ static struct platform_driver cdns_spi_driver = {
.driver = {
.name = CDNS_SPI_NAME,
.of_match_table = cdns_spi_of_match,
- .pm = &cdns_spi_dev_pm_ops,
+ .pm = pm_ptr(&cdns_spi_dev_pm_ops),
},
};
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 09/39] spi: coldfire-qspi: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (7 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 08/39] spi: cadence: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 10/39] spi: dln2: " Jisheng Zhang
` (29 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-coldfire-qspi.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c
index 3b175c1da36b..3c8290e08b6d 100644
--- a/drivers/spi/spi-coldfire-qspi.c
+++ b/drivers/spi/spi-coldfire-qspi.c
@@ -437,7 +437,6 @@ static void mcfqspi_remove(struct platform_device *pdev)
mcfqspi_cs_teardown(mcfqspi);
}
-#ifdef CONFIG_PM_SLEEP
static int mcfqspi_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -462,9 +461,7 @@ static int mcfqspi_resume(struct device *dev)
return spi_controller_resume(host);
}
-#endif
-#ifdef CONFIG_PM
static int mcfqspi_runtime_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -484,17 +481,16 @@ static int mcfqspi_runtime_resume(struct device *dev)
return 0;
}
-#endif
static const struct dev_pm_ops mcfqspi_pm = {
- SET_SYSTEM_SLEEP_PM_OPS(mcfqspi_suspend, mcfqspi_resume)
- SET_RUNTIME_PM_OPS(mcfqspi_runtime_suspend, mcfqspi_runtime_resume,
- NULL)
+ SYSTEM_SLEEP_PM_OPS(mcfqspi_suspend, mcfqspi_resume)
+ RUNTIME_PM_OPS(mcfqspi_runtime_suspend, mcfqspi_runtime_resume,
+ NULL)
};
static struct platform_driver mcfqspi_driver = {
.driver.name = DRIVER_NAME,
- .driver.pm = &mcfqspi_pm,
+ .driver.pm = pm_ptr(&mcfqspi_pm),
.probe = mcfqspi_probe,
.remove = mcfqspi_remove,
};
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 10/39] spi: dln2: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (8 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 09/39] spi: coldfire-qspi: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 11/39] spi: dw-pci: " Jisheng Zhang
` (28 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-dln2.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-dln2.c b/drivers/spi/spi-dln2.c
index 8333dda7d1e8..60085ed04a06 100644
--- a/drivers/spi/spi-dln2.c
+++ b/drivers/spi/spi-dln2.c
@@ -787,7 +787,6 @@ static void dln2_spi_remove(struct platform_device *pdev)
dev_err(&pdev->dev, "Failed to disable SPI module\n");
}
-#ifdef CONFIG_PM_SLEEP
static int dln2_spi_suspend(struct device *dev)
{
int ret;
@@ -834,9 +833,7 @@ static int dln2_spi_resume(struct device *dev)
return spi_controller_resume(host);
}
-#endif /* CONFIG_PM_SLEEP */
-#ifdef CONFIG_PM
static int dln2_spi_runtime_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -852,18 +849,16 @@ static int dln2_spi_runtime_resume(struct device *dev)
return dln2_spi_enable(dln2, true);
}
-#endif /* CONFIG_PM */
static const struct dev_pm_ops dln2_spi_pm = {
- SET_SYSTEM_SLEEP_PM_OPS(dln2_spi_suspend, dln2_spi_resume)
- SET_RUNTIME_PM_OPS(dln2_spi_runtime_suspend,
- dln2_spi_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(dln2_spi_suspend, dln2_spi_resume)
+ RUNTIME_PM_OPS(dln2_spi_runtime_suspend, dln2_spi_runtime_resume, NULL)
};
static struct platform_driver spi_dln2_driver = {
.driver = {
.name = "dln2-spi",
- .pm = &dln2_spi_pm,
+ .pm = pm_ptr(&dln2_spi_pm),
},
.probe = dln2_spi_probe,
.remove = dln2_spi_remove,
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 11/39] spi: dw-pci: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (9 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 10/39] spi: dln2: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 12/39] spi: spi-fsl-dspi: " Jisheng Zhang
` (27 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-dw-pci.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-dw-pci.c b/drivers/spi/spi-dw-pci.c
index bfb874f96a26..2f3bea51f1e6 100644
--- a/drivers/spi/spi-dw-pci.c
+++ b/drivers/spi/spi-dw-pci.c
@@ -154,7 +154,6 @@ static void dw_spi_pci_remove(struct pci_dev *pdev)
dw_spi_remove_controller(dws);
}
-#ifdef CONFIG_PM_SLEEP
static int dw_spi_pci_suspend(struct device *dev)
{
struct dw_spi *dws = dev_get_drvdata(dev);
@@ -168,9 +167,8 @@ static int dw_spi_pci_resume(struct device *dev)
return dw_spi_resume_controller(dws);
}
-#endif
-static SIMPLE_DEV_PM_OPS(dw_spi_pci_pm_ops, dw_spi_pci_suspend, dw_spi_pci_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(dw_spi_pci_pm_ops, dw_spi_pci_suspend, dw_spi_pci_resume);
static const struct pci_device_id dw_spi_pci_ids[] = {
/* Intel MID platform SPI controller 0 */
@@ -197,7 +195,7 @@ static struct pci_driver dw_spi_pci_driver = {
.probe = dw_spi_pci_probe,
.remove = dw_spi_pci_remove,
.driver = {
- .pm = &dw_spi_pci_pm_ops,
+ .pm = pm_sleep_ptr(&dw_spi_pci_pm_ops),
},
};
module_pci_driver(dw_spi_pci_driver);
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 12/39] spi: spi-fsl-dspi: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (10 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 11/39] spi: dw-pci: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 13/39] spi: fsl-espi: " Jisheng Zhang
` (26 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-fsl-dspi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index 019d05cdefe6..ef86267c1772 100644
--- a/drivers/spi/spi-fsl-dspi.c
+++ b/drivers/spi/spi-fsl-dspi.c
@@ -1460,7 +1460,6 @@ static int dspi_init(struct fsl_dspi *dspi)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
static int dspi_suspend(struct device *dev)
{
struct fsl_dspi *dspi = dev_get_drvdata(dev);
@@ -1500,9 +1499,8 @@ static int dspi_resume(struct device *dev)
return 0;
}
-#endif /* CONFIG_PM_SLEEP */
-static SIMPLE_DEV_PM_OPS(dspi_pm, dspi_suspend, dspi_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(dspi_pm, dspi_suspend, dspi_resume);
static int dspi_target_abort(struct spi_controller *host)
{
@@ -1727,7 +1725,7 @@ static void dspi_shutdown(struct platform_device *pdev)
static struct platform_driver fsl_dspi_driver = {
.driver.name = DRIVER_NAME,
.driver.of_match_table = fsl_dspi_dt_ids,
- .driver.pm = &dspi_pm,
+ .driver.pm = pm_sleep_ptr(&dspi_pm),
.probe = dspi_probe,
.remove = dspi_remove,
.shutdown = dspi_shutdown,
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 13/39] spi: fsl-espi: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (11 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 12/39] spi: spi-fsl-dspi: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 14/39] spi: fsl-lpspi: " Jisheng Zhang
` (25 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-fsl-espi.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c
index 1341bdd7db75..4ac8f9b06783 100644
--- a/drivers/spi/spi-fsl-espi.c
+++ b/drivers/spi/spi-fsl-espi.c
@@ -580,7 +580,6 @@ static irqreturn_t fsl_espi_irq(s32 irq, void *context_data)
return IRQ_HANDLED;
}
-#ifdef CONFIG_PM
static int fsl_espi_runtime_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -606,7 +605,6 @@ static int fsl_espi_runtime_resume(struct device *dev)
return 0;
}
-#endif
static size_t fsl_espi_max_message_size(struct spi_device *spi)
{
@@ -785,7 +783,6 @@ static void of_fsl_espi_remove(struct platform_device *dev)
pm_runtime_disable(&dev->dev);
}
-#ifdef CONFIG_PM_SLEEP
static int of_fsl_espi_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -811,12 +808,10 @@ static int of_fsl_espi_resume(struct device *dev)
return spi_controller_resume(host);
}
-#endif /* CONFIG_PM_SLEEP */
static const struct dev_pm_ops espi_pm = {
- SET_RUNTIME_PM_OPS(fsl_espi_runtime_suspend,
- fsl_espi_runtime_resume, NULL)
- SET_SYSTEM_SLEEP_PM_OPS(of_fsl_espi_suspend, of_fsl_espi_resume)
+ RUNTIME_PM_OPS(fsl_espi_runtime_suspend, fsl_espi_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(of_fsl_espi_suspend, of_fsl_espi_resume)
};
static const struct of_device_id of_fsl_espi_match[] = {
@@ -829,7 +824,7 @@ static struct platform_driver fsl_espi_driver = {
.driver = {
.name = "fsl_espi",
.of_match_table = of_fsl_espi_match,
- .pm = &espi_pm,
+ .pm = pm_ptr(&espi_pm),
},
.probe = of_fsl_espi_probe,
.remove = of_fsl_espi_remove,
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 14/39] spi: fsl-lpspi: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (12 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 13/39] spi: fsl-espi: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 15/39] spi: qcom-geni: " Jisheng Zhang
` (24 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-fsl-lpspi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c
index e14753144e19..5aa0a75b4e57 100644
--- a/drivers/spi/spi-fsl-lpspi.c
+++ b/drivers/spi/spi-fsl-lpspi.c
@@ -842,7 +842,6 @@ static irqreturn_t fsl_lpspi_isr(int irq, void *dev_id)
return IRQ_NONE;
}
-#ifdef CONFIG_PM
static int fsl_lpspi_runtime_resume(struct device *dev)
{
struct spi_controller *controller = dev_get_drvdata(dev);
@@ -876,7 +875,6 @@ static int fsl_lpspi_runtime_suspend(struct device *dev)
return 0;
}
-#endif
static int fsl_lpspi_init_rpm(struct fsl_lpspi_data *fsl_lpspi)
{
@@ -1056,8 +1054,8 @@ static int fsl_lpspi_resume(struct device *dev)
}
static const struct dev_pm_ops fsl_lpspi_pm_ops = {
- SET_RUNTIME_PM_OPS(fsl_lpspi_runtime_suspend,
- fsl_lpspi_runtime_resume, NULL)
+ RUNTIME_PM_OPS(fsl_lpspi_runtime_suspend,
+ fsl_lpspi_runtime_resume, NULL)
SYSTEM_SLEEP_PM_OPS(fsl_lpspi_suspend, fsl_lpspi_resume)
};
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 15/39] spi: qcom-geni: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (13 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 14/39] spi: fsl-lpspi: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 16/39] spi: img-spfi: " Jisheng Zhang
` (23 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-geni-qcom.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index 26e723cfea61..3b055d087b55 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -1150,7 +1150,7 @@ static int spi_geni_probe(struct platform_device *pdev)
return devm_spi_register_controller(dev, spi);
}
-static int __maybe_unused spi_geni_runtime_suspend(struct device *dev)
+static int spi_geni_runtime_suspend(struct device *dev)
{
struct spi_controller *spi = dev_get_drvdata(dev);
struct spi_geni_master *mas = spi_controller_get_devdata(spi);
@@ -1166,7 +1166,7 @@ static int __maybe_unused spi_geni_runtime_suspend(struct device *dev)
return geni_icc_disable(&mas->se);
}
-static int __maybe_unused spi_geni_runtime_resume(struct device *dev)
+static int spi_geni_runtime_resume(struct device *dev)
{
struct spi_controller *spi = dev_get_drvdata(dev);
struct spi_geni_master *mas = spi_controller_get_devdata(spi);
@@ -1183,7 +1183,7 @@ static int __maybe_unused spi_geni_runtime_resume(struct device *dev)
return dev_pm_opp_set_rate(mas->dev, mas->cur_sclk_hz);
}
-static int __maybe_unused spi_geni_suspend(struct device *dev)
+static int spi_geni_suspend(struct device *dev)
{
struct spi_controller *spi = dev_get_drvdata(dev);
int ret;
@@ -1199,7 +1199,7 @@ static int __maybe_unused spi_geni_suspend(struct device *dev)
return ret;
}
-static int __maybe_unused spi_geni_resume(struct device *dev)
+static int spi_geni_resume(struct device *dev)
{
struct spi_controller *spi = dev_get_drvdata(dev);
int ret;
@@ -1216,9 +1216,8 @@ static int __maybe_unused spi_geni_resume(struct device *dev)
}
static const struct dev_pm_ops spi_geni_pm_ops = {
- SET_RUNTIME_PM_OPS(spi_geni_runtime_suspend,
- spi_geni_runtime_resume, NULL)
- SET_SYSTEM_SLEEP_PM_OPS(spi_geni_suspend, spi_geni_resume)
+ RUNTIME_PM_OPS(spi_geni_runtime_suspend, spi_geni_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(spi_geni_suspend, spi_geni_resume)
};
static const struct of_device_id spi_geni_dt_match[] = {
@@ -1231,7 +1230,7 @@ static struct platform_driver spi_geni_driver = {
.probe = spi_geni_probe,
.driver = {
.name = "geni_spi",
- .pm = &spi_geni_pm_ops,
+ .pm = pm_ptr(&spi_geni_pm_ops),
.of_match_table = spi_geni_dt_match,
},
};
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 16/39] spi: img-spfi: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (14 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 15/39] spi: qcom-geni: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 17/39] spi: loongson: " Jisheng Zhang
` (22 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-img-spfi.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-img-spfi.c b/drivers/spi/spi-img-spfi.c
index aec724e3f824..19c8250ddb64 100644
--- a/drivers/spi/spi-img-spfi.c
+++ b/drivers/spi/spi-img-spfi.c
@@ -677,7 +677,6 @@ static void img_spfi_remove(struct platform_device *pdev)
}
}
-#ifdef CONFIG_PM
static int img_spfi_runtime_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -706,9 +705,7 @@ static int img_spfi_runtime_resume(struct device *dev)
return 0;
}
-#endif /* CONFIG_PM */
-#ifdef CONFIG_PM_SLEEP
static int img_spfi_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -730,12 +727,10 @@ static int img_spfi_resume(struct device *dev)
return spi_controller_resume(host);
}
-#endif /* CONFIG_PM_SLEEP */
static const struct dev_pm_ops img_spfi_pm_ops = {
- SET_RUNTIME_PM_OPS(img_spfi_runtime_suspend, img_spfi_runtime_resume,
- NULL)
- SET_SYSTEM_SLEEP_PM_OPS(img_spfi_suspend, img_spfi_resume)
+ RUNTIME_PM_OPS(img_spfi_runtime_suspend, img_spfi_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(img_spfi_suspend, img_spfi_resume)
};
static const struct of_device_id img_spfi_of_match[] = {
@@ -747,7 +742,7 @@ MODULE_DEVICE_TABLE(of, img_spfi_of_match);
static struct platform_driver img_spfi_driver = {
.driver = {
.name = "img-spfi",
- .pm = &img_spfi_pm_ops,
+ .pm = pm_ptr(&img_spfi_pm_ops),
.of_match_table = of_match_ptr(img_spfi_of_match),
},
.probe = img_spfi_probe,
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 17/39] spi: loongson: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (15 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 16/39] spi: img-spfi: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 18/39] spi: meson-spifc: " Jisheng Zhang
` (21 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-loongson-core.c | 4 ++--
drivers/spi/spi-loongson-pci.c | 2 +-
drivers/spi/spi-loongson-plat.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-loongson-core.c b/drivers/spi/spi-loongson-core.c
index f50423c3db4c..30b6a7176ce9 100644
--- a/drivers/spi/spi-loongson-core.c
+++ b/drivers/spi/spi-loongson-core.c
@@ -229,7 +229,7 @@ int loongson_spi_init_controller(struct device *dev, void __iomem *regs)
}
EXPORT_SYMBOL_NS_GPL(loongson_spi_init_controller, "SPI_LOONGSON_CORE");
-static int __maybe_unused loongson_spi_suspend(struct device *dev)
+static int loongson_spi_suspend(struct device *dev)
{
struct loongson_spi *loongson_spi;
struct spi_controller *controller;
@@ -249,7 +249,7 @@ static int __maybe_unused loongson_spi_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused loongson_spi_resume(struct device *dev)
+static int loongson_spi_resume(struct device *dev)
{
struct loongson_spi *loongson_spi;
struct spi_controller *controller;
diff --git a/drivers/spi/spi-loongson-pci.c b/drivers/spi/spi-loongson-pci.c
index 2fe5419a8dd2..ccc26efd88fe 100644
--- a/drivers/spi/spi-loongson-pci.c
+++ b/drivers/spi/spi-loongson-pci.c
@@ -43,7 +43,7 @@ static struct pci_driver loongson_spi_pci_driver = {
.probe = loongson_spi_pci_register,
.driver = {
.bus = &pci_bus_type,
- .pm = &loongson_spi_dev_pm_ops,
+ .pm = pm_sleep_ptr(&loongson_spi_dev_pm_ops),
},
};
module_pci_driver(loongson_spi_pci_driver);
diff --git a/drivers/spi/spi-loongson-plat.c b/drivers/spi/spi-loongson-plat.c
index 550b237838c0..6f8202264341 100644
--- a/drivers/spi/spi-loongson-plat.c
+++ b/drivers/spi/spi-loongson-plat.c
@@ -35,7 +35,7 @@ static struct platform_driver loongson_spi_plat_driver = {
.driver = {
.name = "loongson-spi",
.bus = &platform_bus_type,
- .pm = &loongson_spi_dev_pm_ops,
+ .pm = pm_sleep_ptr(&loongson_spi_dev_pm_ops),
.of_match_table = loongson_spi_id_table,
},
};
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 18/39] spi: meson-spifc: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (16 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 17/39] spi: loongson: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 19/39] spi: mt65xx: " Jisheng Zhang
` (20 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-meson-spifc.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/drivers/spi/spi-meson-spifc.c b/drivers/spi/spi-meson-spifc.c
index e36aa94bbdae..2ef090dec7ba 100644
--- a/drivers/spi/spi-meson-spifc.c
+++ b/drivers/spi/spi-meson-spifc.c
@@ -348,7 +348,6 @@ static void meson_spifc_remove(struct platform_device *pdev)
pm_runtime_put_noidle(&pdev->dev);
}
-#ifdef CONFIG_PM_SLEEP
static int meson_spifc_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -385,9 +384,7 @@ static int meson_spifc_resume(struct device *dev)
return ret;
}
-#endif /* CONFIG_PM_SLEEP */
-#ifdef CONFIG_PM
static int meson_spifc_runtime_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -405,13 +402,12 @@ static int meson_spifc_runtime_resume(struct device *dev)
return clk_prepare_enable(spifc->clk);
}
-#endif /* CONFIG_PM */
static const struct dev_pm_ops meson_spifc_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(meson_spifc_suspend, meson_spifc_resume)
- SET_RUNTIME_PM_OPS(meson_spifc_runtime_suspend,
- meson_spifc_runtime_resume,
- NULL)
+ SYSTEM_SLEEP_PM_OPS(meson_spifc_suspend, meson_spifc_resume)
+ RUNTIME_PM_OPS(meson_spifc_runtime_suspend,
+ meson_spifc_runtime_resume,
+ NULL)
};
static const struct of_device_id meson_spifc_dt_match[] = {
@@ -427,7 +423,7 @@ static struct platform_driver meson_spifc_driver = {
.driver = {
.name = "meson-spifc",
.of_match_table = of_match_ptr(meson_spifc_dt_match),
- .pm = &meson_spifc_pm_ops,
+ .pm = pm_ptr(&meson_spifc_pm_ops),
},
};
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 19/39] spi: mt65xx: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (17 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 18/39] spi: meson-spifc: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 20/39] spi: mtk-nor: " Jisheng Zhang
` (19 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-mt65xx.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
index 96f8555be983..b845a599f7c6 100644
--- a/drivers/spi/spi-mt65xx.c
+++ b/drivers/spi/spi-mt65xx.c
@@ -1367,7 +1367,6 @@ static void mtk_spi_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
}
-#ifdef CONFIG_PM_SLEEP
static int mtk_spi_suspend(struct device *dev)
{
int ret;
@@ -1419,9 +1418,7 @@ static int mtk_spi_resume(struct device *dev)
return ret;
}
-#endif /* CONFIG_PM_SLEEP */
-#ifdef CONFIG_PM
static int mtk_spi_runtime_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -1473,18 +1470,16 @@ static int mtk_spi_runtime_resume(struct device *dev)
return 0;
}
-#endif /* CONFIG_PM */
static const struct dev_pm_ops mtk_spi_pm = {
- SET_SYSTEM_SLEEP_PM_OPS(mtk_spi_suspend, mtk_spi_resume)
- SET_RUNTIME_PM_OPS(mtk_spi_runtime_suspend,
- mtk_spi_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(mtk_spi_suspend, mtk_spi_resume)
+ RUNTIME_PM_OPS(mtk_spi_runtime_suspend, mtk_spi_runtime_resume, NULL)
};
static struct platform_driver mtk_spi_driver = {
.driver = {
.name = "mtk-spi",
- .pm = &mtk_spi_pm,
+ .pm = pm_ptr(&mtk_spi_pm),
.of_match_table = mtk_spi_of_match,
},
.probe = mtk_spi_probe,
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 20/39] spi: mtk-nor: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (18 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 19/39] spi: mt65xx: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 21/39] spi: mxic: " Jisheng Zhang
` (18 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-mtk-nor.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-mtk-nor.c b/drivers/spi/spi-mtk-nor.c
index 74f34537b02c..5e1fdbb40ffb 100644
--- a/drivers/spi/spi-mtk-nor.c
+++ b/drivers/spi/spi-mtk-nor.c
@@ -947,7 +947,7 @@ static void mtk_nor_remove(struct platform_device *pdev)
mtk_nor_disable_clk(sp);
}
-static int __maybe_unused mtk_nor_runtime_suspend(struct device *dev)
+static int mtk_nor_runtime_suspend(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
struct mtk_nor *sp = spi_controller_get_devdata(ctlr);
@@ -957,7 +957,7 @@ static int __maybe_unused mtk_nor_runtime_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused mtk_nor_runtime_resume(struct device *dev)
+static int mtk_nor_runtime_resume(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
struct mtk_nor *sp = spi_controller_get_devdata(ctlr);
@@ -965,12 +965,12 @@ static int __maybe_unused mtk_nor_runtime_resume(struct device *dev)
return mtk_nor_enable_clk(sp);
}
-static int __maybe_unused mtk_nor_suspend(struct device *dev)
+static int mtk_nor_suspend(struct device *dev)
{
return pm_runtime_force_suspend(dev);
}
-static int __maybe_unused mtk_nor_resume(struct device *dev)
+static int mtk_nor_resume(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
struct mtk_nor *sp = spi_controller_get_devdata(ctlr);
@@ -986,16 +986,15 @@ static int __maybe_unused mtk_nor_resume(struct device *dev)
}
static const struct dev_pm_ops mtk_nor_pm_ops = {
- SET_RUNTIME_PM_OPS(mtk_nor_runtime_suspend,
- mtk_nor_runtime_resume, NULL)
- SET_SYSTEM_SLEEP_PM_OPS(mtk_nor_suspend, mtk_nor_resume)
+ RUNTIME_PM_OPS(mtk_nor_runtime_suspend, mtk_nor_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(mtk_nor_suspend, mtk_nor_resume)
};
static struct platform_driver mtk_nor_driver = {
.driver = {
.name = DRIVER_NAME,
.of_match_table = mtk_nor_match,
- .pm = &mtk_nor_pm_ops,
+ .pm = pm_ptr(&mtk_nor_pm_ops),
},
.probe = mtk_nor_probe,
.remove = mtk_nor_remove,
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 21/39] spi: mxic: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (19 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 20/39] spi: mtk-nor: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 22/39] spi: omap2-mcspi: " Jisheng Zhang
` (17 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-mxic.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/spi-mxic.c b/drivers/spi/spi-mxic.c
index 83b688e65284..e3c85e5191e3 100644
--- a/drivers/spi/spi-mxic.c
+++ b/drivers/spi/spi-mxic.c
@@ -721,7 +721,7 @@ static int mxic_spi_mem_ecc_probe(struct platform_device *pdev,
return 0;
}
-static int __maybe_unused mxic_spi_runtime_suspend(struct device *dev)
+static int mxic_spi_runtime_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
struct mxic_spi *mxic = spi_controller_get_devdata(host);
@@ -732,7 +732,7 @@ static int __maybe_unused mxic_spi_runtime_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused mxic_spi_runtime_resume(struct device *dev)
+static int mxic_spi_runtime_resume(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
struct mxic_spi *mxic = spi_controller_get_devdata(host);
@@ -748,8 +748,7 @@ static int __maybe_unused mxic_spi_runtime_resume(struct device *dev)
}
static const struct dev_pm_ops mxic_spi_dev_pm_ops = {
- SET_RUNTIME_PM_OPS(mxic_spi_runtime_suspend,
- mxic_spi_runtime_resume, NULL)
+ RUNTIME_PM_OPS(mxic_spi_runtime_suspend, mxic_spi_runtime_resume, NULL)
};
static int mxic_spi_probe(struct platform_device *pdev)
@@ -850,7 +849,7 @@ static struct platform_driver mxic_spi_driver = {
.driver = {
.name = "mxic-spi",
.of_match_table = mxic_spi_of_ids,
- .pm = &mxic_spi_dev_pm_ops,
+ .pm = pm_ptr(&mxic_spi_dev_pm_ops),
},
};
module_platform_driver(mxic_spi_driver);
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 22/39] spi: omap2-mcspi: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (20 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 21/39] spi: mxic: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 23/39] spi: orion: " Jisheng Zhang
` (16 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-omap2-mcspi.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 9cc078acc13c..a3355147f5de 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1620,7 +1620,7 @@ static void omap2_mcspi_remove(struct platform_device *pdev)
/* work with hotplug and coldplug */
MODULE_ALIAS("platform:omap2_mcspi");
-static int __maybe_unused omap2_mcspi_suspend(struct device *dev)
+static int omap2_mcspi_suspend(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
struct omap2_mcspi *mcspi = spi_controller_get_devdata(ctlr);
@@ -1639,7 +1639,7 @@ static int __maybe_unused omap2_mcspi_suspend(struct device *dev)
return pm_runtime_force_suspend(dev);
}
-static int __maybe_unused omap2_mcspi_resume(struct device *dev)
+static int omap2_mcspi_resume(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
struct omap2_mcspi *mcspi = spi_controller_get_devdata(ctlr);
@@ -1654,8 +1654,7 @@ static int __maybe_unused omap2_mcspi_resume(struct device *dev)
}
static const struct dev_pm_ops omap2_mcspi_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(omap2_mcspi_suspend,
- omap2_mcspi_resume)
+ SYSTEM_SLEEP_PM_OPS(omap2_mcspi_suspend, omap2_mcspi_resume)
.runtime_suspend = omap_mcspi_runtime_suspend,
.runtime_resume = omap_mcspi_runtime_resume,
};
@@ -1663,7 +1662,7 @@ static const struct dev_pm_ops omap2_mcspi_pm_ops = {
static struct platform_driver omap2_mcspi_driver = {
.driver = {
.name = "omap2_mcspi",
- .pm = &omap2_mcspi_pm_ops,
+ .pm = pm_ptr(&omap2_mcspi_pm_ops),
.of_match_table = omap_mcspi_of_match,
},
.probe = omap2_mcspi_probe,
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 23/39] spi: orion: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (21 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 22/39] spi: omap2-mcspi: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 24/39] spi: pl022: " Jisheng Zhang
` (15 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-orion.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index 265708a94984..a33b5840b95f 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -100,10 +100,8 @@ struct orion_spi {
struct orion_child_options child[ORION_NUM_CHIPSELECTS];
};
-#ifdef CONFIG_PM
static int orion_spi_runtime_suspend(struct device *dev);
static int orion_spi_runtime_resume(struct device *dev);
-#endif
static inline void __iomem *spi_reg(struct orion_spi *orion_spi, u32 reg)
{
@@ -814,7 +812,6 @@ static void orion_spi_remove(struct platform_device *pdev)
MODULE_ALIAS("platform:" DRIVER_NAME);
-#ifdef CONFIG_PM
static int orion_spi_runtime_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -834,18 +831,17 @@ static int orion_spi_runtime_resume(struct device *dev)
clk_prepare_enable(spi->axi_clk);
return clk_prepare_enable(spi->clk);
}
-#endif
static const struct dev_pm_ops orion_spi_pm_ops = {
- SET_RUNTIME_PM_OPS(orion_spi_runtime_suspend,
- orion_spi_runtime_resume,
- NULL)
+ RUNTIME_PM_OPS(orion_spi_runtime_suspend,
+ orion_spi_runtime_resume,
+ NULL)
};
static struct platform_driver orion_spi_driver = {
.driver = {
.name = DRIVER_NAME,
- .pm = &orion_spi_pm_ops,
+ .pm = pm_ptr(&orion_spi_pm_ops),
.of_match_table = of_match_ptr(orion_spi_of_match_table),
},
.probe = orion_spi_probe,
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 24/39] spi: pl022: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (22 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 23/39] spi: orion: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 25/39] spi: spi-qcom-qspi: " Jisheng Zhang
` (14 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-pl022.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index 95652df5fd09..4877ab909c51 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -2011,7 +2011,6 @@ pl022_remove(struct amba_device *adev)
amba_release_regions(adev);
}
-#ifdef CONFIG_PM_SLEEP
static int pl022_suspend(struct device *dev)
{
struct pl022 *pl022 = dev_get_drvdata(dev);
@@ -2049,9 +2048,7 @@ static int pl022_resume(struct device *dev)
return ret;
}
-#endif
-#ifdef CONFIG_PM
static int pl022_runtime_suspend(struct device *dev)
{
struct pl022 *pl022 = dev_get_drvdata(dev);
@@ -2071,11 +2068,10 @@ static int pl022_runtime_resume(struct device *dev)
return 0;
}
-#endif
static const struct dev_pm_ops pl022_dev_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(pl022_suspend, pl022_resume)
- SET_RUNTIME_PM_OPS(pl022_runtime_suspend, pl022_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(pl022_suspend, pl022_resume)
+ RUNTIME_PM_OPS(pl022_runtime_suspend, pl022_runtime_resume, NULL)
};
static struct vendor_data vendor_arm = {
@@ -2166,7 +2162,7 @@ MODULE_DEVICE_TABLE(amba, pl022_ids);
static struct amba_driver pl022_driver = {
.drv = {
.name = "ssp-pl022",
- .pm = &pl022_dev_pm_ops,
+ .pm = pm_ptr(&pl022_dev_pm_ops),
},
.id_table = pl022_ids,
.probe = pl022_probe,
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 25/39] spi: spi-qcom-qspi: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (23 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 24/39] spi: pl022: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 26/39] spi: qup: " Jisheng Zhang
` (13 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-qcom-qspi.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-qcom-qspi.c b/drivers/spi/spi-qcom-qspi.c
index caf55a6f70b3..0ac06a1ab868 100644
--- a/drivers/spi/spi-qcom-qspi.c
+++ b/drivers/spi/spi-qcom-qspi.c
@@ -828,7 +828,7 @@ static void qcom_qspi_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
}
-static int __maybe_unused qcom_qspi_runtime_suspend(struct device *dev)
+static int qcom_qspi_runtime_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
struct qcom_qspi *ctrl = spi_controller_get_devdata(host);
@@ -872,7 +872,7 @@ static int __maybe_unused qcom_qspi_runtime_suspend(struct device *dev)
return ret;
}
-static int __maybe_unused qcom_qspi_runtime_resume(struct device *dev)
+static int qcom_qspi_runtime_resume(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
struct qcom_qspi *ctrl = spi_controller_get_devdata(host);
@@ -916,7 +916,7 @@ static int __maybe_unused qcom_qspi_runtime_resume(struct device *dev)
return ret;
}
-static int __maybe_unused qcom_qspi_suspend(struct device *dev)
+static int qcom_qspi_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
int ret;
@@ -932,7 +932,7 @@ static int __maybe_unused qcom_qspi_suspend(struct device *dev)
return ret;
}
-static int __maybe_unused qcom_qspi_resume(struct device *dev)
+static int qcom_qspi_resume(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
int ret;
@@ -949,9 +949,9 @@ static int __maybe_unused qcom_qspi_resume(struct device *dev)
}
static const struct dev_pm_ops qcom_qspi_dev_pm_ops = {
- SET_RUNTIME_PM_OPS(qcom_qspi_runtime_suspend,
- qcom_qspi_runtime_resume, NULL)
- SET_SYSTEM_SLEEP_PM_OPS(qcom_qspi_suspend, qcom_qspi_resume)
+ RUNTIME_PM_OPS(qcom_qspi_runtime_suspend,
+ qcom_qspi_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(qcom_qspi_suspend, qcom_qspi_resume)
};
static const struct of_device_id qcom_qspi_dt_match[] = {
@@ -963,7 +963,7 @@ MODULE_DEVICE_TABLE(of, qcom_qspi_dt_match);
static struct platform_driver qcom_qspi_driver = {
.driver = {
.name = "qcom_qspi",
- .pm = &qcom_qspi_dev_pm_ops,
+ .pm = pm_ptr(&qcom_qspi_dev_pm_ops),
.of_match_table = qcom_qspi_dt_match,
},
.probe = qcom_qspi_probe,
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 26/39] spi: qup: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (24 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 25/39] spi: spi-qcom-qspi: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 27/39] spi: rockchip-sfc: " Jisheng Zhang
` (12 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-qup.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c
index 034546b3f058..e8b076b1622d 100644
--- a/drivers/spi/spi-qup.c
+++ b/drivers/spi/spi-qup.c
@@ -1211,7 +1211,6 @@ static int spi_qup_probe(struct platform_device *pdev)
return ret;
}
-#ifdef CONFIG_PM
static int spi_qup_pm_suspend_runtime(struct device *device)
{
struct spi_controller *host = dev_get_drvdata(device);
@@ -1253,9 +1252,7 @@ static int spi_qup_pm_resume_runtime(struct device *device)
writel_relaxed(config, controller->base + QUP_CONFIG);
return 0;
}
-#endif /* CONFIG_PM */
-#ifdef CONFIG_PM_SLEEP
static int spi_qup_suspend(struct device *device)
{
struct spi_controller *host = dev_get_drvdata(device);
@@ -1312,7 +1309,6 @@ static int spi_qup_resume(struct device *device)
clk_disable_unprepare(controller->iclk);
return ret;
}
-#endif /* CONFIG_PM_SLEEP */
static void spi_qup_remove(struct platform_device *pdev)
{
@@ -1352,16 +1348,16 @@ static const struct of_device_id spi_qup_dt_match[] = {
MODULE_DEVICE_TABLE(of, spi_qup_dt_match);
static const struct dev_pm_ops spi_qup_dev_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(spi_qup_suspend, spi_qup_resume)
- SET_RUNTIME_PM_OPS(spi_qup_pm_suspend_runtime,
- spi_qup_pm_resume_runtime,
- NULL)
+ SYSTEM_SLEEP_PM_OPS(spi_qup_suspend, spi_qup_resume)
+ RUNTIME_PM_OPS(spi_qup_pm_suspend_runtime,
+ spi_qup_pm_resume_runtime,
+ NULL)
};
static struct platform_driver spi_qup_driver = {
.driver = {
.name = "spi_qup",
- .pm = &spi_qup_dev_pm_ops,
+ .pm = pm_ptr(&spi_qup_dev_pm_ops),
.of_match_table = spi_qup_dt_match,
},
.probe = spi_qup_probe,
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 27/39] spi: rockchip-sfc: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (25 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 26/39] spi: qup: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 28/39] spi: rockchip: " Jisheng Zhang
` (11 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-rockchip-sfc.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-rockchip-sfc.c b/drivers/spi/spi-rockchip-sfc.c
index 174995042f53..662a994da60b 100644
--- a/drivers/spi/spi-rockchip-sfc.c
+++ b/drivers/spi/spi-rockchip-sfc.c
@@ -751,7 +751,6 @@ static void rockchip_sfc_remove(struct platform_device *pdev)
clk_disable_unprepare(sfc->hclk);
}
-#ifdef CONFIG_PM
static int rockchip_sfc_runtime_suspend(struct device *dev)
{
struct rockchip_sfc *sfc = dev_get_drvdata(dev);
@@ -777,9 +776,7 @@ static int rockchip_sfc_runtime_resume(struct device *dev)
return ret;
}
-#endif /* CONFIG_PM */
-#ifdef CONFIG_PM_SLEEP
static int rockchip_sfc_suspend(struct device *dev)
{
pinctrl_pm_select_sleep_state(dev);
@@ -810,12 +807,11 @@ static int rockchip_sfc_resume(struct device *dev)
return 0;
}
-#endif /* CONFIG_PM_SLEEP */
static const struct dev_pm_ops rockchip_sfc_pm_ops = {
- SET_RUNTIME_PM_OPS(rockchip_sfc_runtime_suspend,
- rockchip_sfc_runtime_resume, NULL)
- SET_SYSTEM_SLEEP_PM_OPS(rockchip_sfc_suspend, rockchip_sfc_resume)
+ RUNTIME_PM_OPS(rockchip_sfc_runtime_suspend,
+ rockchip_sfc_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(rockchip_sfc_suspend, rockchip_sfc_resume)
};
static const struct of_device_id rockchip_sfc_dt_ids[] = {
@@ -828,7 +824,7 @@ static struct platform_driver rockchip_sfc_driver = {
.driver = {
.name = "rockchip-sfc",
.of_match_table = rockchip_sfc_dt_ids,
- .pm = &rockchip_sfc_pm_ops,
+ .pm = pm_ptr(&rockchip_sfc_pm_ops),
},
.probe = rockchip_sfc_probe,
.remove = rockchip_sfc_remove,
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 28/39] spi: rockchip: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (26 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 27/39] spi: rockchip-sfc: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 29/39] spi: s3c64xx: " Jisheng Zhang
` (10 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-rockchip.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c
index 231fbcf0e7aa..1a81fd94b439 100644
--- a/drivers/spi/spi-rockchip.c
+++ b/drivers/spi/spi-rockchip.c
@@ -938,7 +938,6 @@ static void rockchip_spi_remove(struct platform_device *pdev)
dma_release_channel(ctlr->dma_rx);
}
-#ifdef CONFIG_PM_SLEEP
static int rockchip_spi_suspend(struct device *dev)
{
int ret;
@@ -972,9 +971,7 @@ static int rockchip_spi_resume(struct device *dev)
return spi_controller_resume(ctlr);
}
-#endif /* CONFIG_PM_SLEEP */
-#ifdef CONFIG_PM
static int rockchip_spi_runtime_suspend(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
@@ -1002,12 +999,11 @@ static int rockchip_spi_runtime_resume(struct device *dev)
return 0;
}
-#endif /* CONFIG_PM */
static const struct dev_pm_ops rockchip_spi_pm = {
- SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(rockchip_spi_suspend, rockchip_spi_resume)
- SET_RUNTIME_PM_OPS(rockchip_spi_runtime_suspend,
- rockchip_spi_runtime_resume, NULL)
+ NOIRQ_SYSTEM_SLEEP_PM_OPS(rockchip_spi_suspend, rockchip_spi_resume)
+ RUNTIME_PM_OPS(rockchip_spi_runtime_suspend,
+ rockchip_spi_runtime_resume, NULL)
};
static const struct of_device_id rockchip_spi_dt_match[] = {
@@ -1030,7 +1026,7 @@ MODULE_DEVICE_TABLE(of, rockchip_spi_dt_match);
static struct platform_driver rockchip_spi_driver = {
.driver = {
.name = DRIVER_NAME,
- .pm = &rockchip_spi_pm,
+ .pm = pm_ptr(&rockchip_spi_pm),
.of_match_table = of_match_ptr(rockchip_spi_dt_match),
},
.probe = rockchip_spi_probe,
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 29/39] spi: s3c64xx: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (27 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 28/39] spi: rockchip: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 30/39] spi: slave-mt27xx: " Jisheng Zhang
` (9 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-s3c64xx.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 28c56b06fa99..8d4120cf9df1 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -1408,7 +1408,6 @@ static void s3c64xx_spi_remove(struct platform_device *pdev)
pm_runtime_set_suspended(&pdev->dev);
}
-#ifdef CONFIG_PM_SLEEP
static int s3c64xx_spi_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -1444,9 +1443,7 @@ static int s3c64xx_spi_resume(struct device *dev)
return spi_controller_resume(host);
}
-#endif /* CONFIG_PM_SLEEP */
-#ifdef CONFIG_PM
static int s3c64xx_spi_runtime_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -1494,12 +1491,11 @@ static int s3c64xx_spi_runtime_resume(struct device *dev)
return ret;
}
-#endif /* CONFIG_PM */
static const struct dev_pm_ops s3c64xx_spi_pm = {
- SET_SYSTEM_SLEEP_PM_OPS(s3c64xx_spi_suspend, s3c64xx_spi_resume)
- SET_RUNTIME_PM_OPS(s3c64xx_spi_runtime_suspend,
- s3c64xx_spi_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(s3c64xx_spi_suspend, s3c64xx_spi_resume)
+ RUNTIME_PM_OPS(s3c64xx_spi_runtime_suspend,
+ s3c64xx_spi_runtime_resume, NULL)
};
static const struct s3c64xx_spi_port_config s3c6410_spi_port_config = {
@@ -1655,7 +1651,7 @@ MODULE_DEVICE_TABLE(of, s3c64xx_spi_dt_match);
static struct platform_driver s3c64xx_spi_driver = {
.driver = {
.name = "s3c64xx-spi",
- .pm = &s3c64xx_spi_pm,
+ .pm = pm_ptr(&s3c64xx_spi_pm),
.of_match_table = of_match_ptr(s3c64xx_spi_dt_match),
},
.probe = s3c64xx_spi_probe,
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 30/39] spi: slave-mt27xx: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (28 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 29/39] spi: s3c64xx: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 31/39] spi: sprd: " Jisheng Zhang
` (8 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-slave-mt27xx.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-slave-mt27xx.c b/drivers/spi/spi-slave-mt27xx.c
index e60ab4c18bed..256b510fa676 100644
--- a/drivers/spi/spi-slave-mt27xx.c
+++ b/drivers/spi/spi-slave-mt27xx.c
@@ -471,7 +471,6 @@ static void mtk_spi_slave_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
}
-#ifdef CONFIG_PM_SLEEP
static int mtk_spi_slave_suspend(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
@@ -508,9 +507,7 @@ static int mtk_spi_slave_resume(struct device *dev)
return ret;
}
-#endif /* CONFIG_PM_SLEEP */
-#ifdef CONFIG_PM
static int mtk_spi_slave_runtime_suspend(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
@@ -535,18 +532,17 @@ static int mtk_spi_slave_runtime_resume(struct device *dev)
return 0;
}
-#endif /* CONFIG_PM */
static const struct dev_pm_ops mtk_spi_slave_pm = {
- SET_SYSTEM_SLEEP_PM_OPS(mtk_spi_slave_suspend, mtk_spi_slave_resume)
- SET_RUNTIME_PM_OPS(mtk_spi_slave_runtime_suspend,
- mtk_spi_slave_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(mtk_spi_slave_suspend, mtk_spi_slave_resume)
+ RUNTIME_PM_OPS(mtk_spi_slave_runtime_suspend,
+ mtk_spi_slave_runtime_resume, NULL)
};
static struct platform_driver mtk_spi_slave_driver = {
.driver = {
.name = "mtk-spi-slave",
- .pm = &mtk_spi_slave_pm,
+ .pm = pm_ptr(&mtk_spi_slave_pm),
.of_match_table = mtk_spi_slave_of_match,
},
.probe = mtk_spi_slave_probe,
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 31/39] spi: sprd: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (29 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 30/39] spi: slave-mt27xx: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 32/39] spi: sunplus-sp7021: " Jisheng Zhang
` (7 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-sprd.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/spi-sprd.c b/drivers/spi/spi-sprd.c
index 29380938ef65..12b09174bb24 100644
--- a/drivers/spi/spi-sprd.c
+++ b/drivers/spi/spi-sprd.c
@@ -1016,7 +1016,7 @@ static void sprd_spi_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
}
-static int __maybe_unused sprd_spi_runtime_suspend(struct device *dev)
+static int sprd_spi_runtime_suspend(struct device *dev)
{
struct spi_controller *sctlr = dev_get_drvdata(dev);
struct sprd_spi *ss = spi_controller_get_devdata(sctlr);
@@ -1029,7 +1029,7 @@ static int __maybe_unused sprd_spi_runtime_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused sprd_spi_runtime_resume(struct device *dev)
+static int sprd_spi_runtime_resume(struct device *dev)
{
struct spi_controller *sctlr = dev_get_drvdata(dev);
struct sprd_spi *ss = spi_controller_get_devdata(sctlr);
@@ -1050,8 +1050,7 @@ static int __maybe_unused sprd_spi_runtime_resume(struct device *dev)
}
static const struct dev_pm_ops sprd_spi_pm_ops = {
- SET_RUNTIME_PM_OPS(sprd_spi_runtime_suspend,
- sprd_spi_runtime_resume, NULL)
+ RUNTIME_PM_OPS(sprd_spi_runtime_suspend, sprd_spi_runtime_resume, NULL)
};
static const struct of_device_id sprd_spi_of_match[] = {
@@ -1064,7 +1063,7 @@ static struct platform_driver sprd_spi_driver = {
.driver = {
.name = "sprd-spi",
.of_match_table = sprd_spi_of_match,
- .pm = &sprd_spi_pm_ops,
+ .pm = pm_ptr(&sprd_spi_pm_ops),
},
.probe = sprd_spi_probe,
.remove = sprd_spi_remove,
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 32/39] spi: sunplus-sp7021: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (30 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 31/39] spi: sprd: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 33/39] spi: syncuacer: " Jisheng Zhang
` (6 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/spi/spi-sunplus-sp7021.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/spi/spi-sunplus-sp7021.c b/drivers/spi/spi-sunplus-sp7021.c
index c1870322d976..f16fcda187dd 100644
--- a/drivers/spi/spi-sunplus-sp7021.c
+++ b/drivers/spi/spi-sunplus-sp7021.c
@@ -498,7 +498,7 @@ static void sp7021_spi_controller_remove(struct platform_device *pdev)
pm_runtime_set_suspended(&pdev->dev);
}
-static int __maybe_unused sp7021_spi_controller_suspend(struct device *dev)
+static int sp7021_spi_controller_suspend(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
struct sp7021_spi_ctlr *pspim = spi_controller_get_devdata(ctlr);
@@ -506,7 +506,7 @@ static int __maybe_unused sp7021_spi_controller_suspend(struct device *dev)
return reset_control_assert(pspim->rstc);
}
-static int __maybe_unused sp7021_spi_controller_resume(struct device *dev)
+static int sp7021_spi_controller_resume(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
struct sp7021_spi_ctlr *pspim = spi_controller_get_devdata(ctlr);
@@ -515,7 +515,6 @@ static int __maybe_unused sp7021_spi_controller_resume(struct device *dev)
return clk_prepare_enable(pspim->spi_clk);
}
-#ifdef CONFIG_PM
static int sp7021_spi_runtime_suspend(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
@@ -531,13 +530,12 @@ static int sp7021_spi_runtime_resume(struct device *dev)
return reset_control_deassert(pspim->rstc);
}
-#endif
static const struct dev_pm_ops sp7021_spi_pm_ops = {
- SET_RUNTIME_PM_OPS(sp7021_spi_runtime_suspend,
- sp7021_spi_runtime_resume, NULL)
- SET_SYSTEM_SLEEP_PM_OPS(sp7021_spi_controller_suspend,
- sp7021_spi_controller_resume)
+ RUNTIME_PM_OPS(sp7021_spi_runtime_suspend,
+ sp7021_spi_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(sp7021_spi_controller_suspend,
+ sp7021_spi_controller_resume)
};
static const struct of_device_id sp7021_spi_controller_ids[] = {
@@ -552,7 +550,7 @@ static struct platform_driver sp7021_spi_controller_driver = {
.driver = {
.name = "sunplus,sp7021-spi-controller",
.of_match_table = sp7021_spi_controller_ids,
- .pm = &sp7021_spi_pm_ops,
+ .pm = pm_ptr(&sp7021_spi_pm_ops),
},
};
module_platform_driver(sp7021_spi_controller_driver);
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 33/39] spi: syncuacer: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (31 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 32/39] spi: sunplus-sp7021: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 34/39] spi: tegra114: " Jisheng Zhang
` (5 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-synquacer.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/spi-synquacer.c b/drivers/spi/spi-synquacer.c
index c14225e39fd1..6d0cd11637b5 100644
--- a/drivers/spi/spi-synquacer.c
+++ b/drivers/spi/spi-synquacer.c
@@ -738,7 +738,7 @@ static void synquacer_spi_remove(struct platform_device *pdev)
clk_disable_unprepare(sspi->clk);
}
-static int __maybe_unused synquacer_spi_suspend(struct device *dev)
+static int synquacer_spi_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
struct synquacer_spi *sspi = spi_controller_get_devdata(host);
@@ -754,7 +754,7 @@ static int __maybe_unused synquacer_spi_suspend(struct device *dev)
return ret;
}
-static int __maybe_unused synquacer_spi_resume(struct device *dev)
+static int synquacer_spi_resume(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
struct synquacer_spi *sspi = spi_controller_get_devdata(host);
@@ -786,8 +786,8 @@ static int __maybe_unused synquacer_spi_resume(struct device *dev)
return ret;
}
-static SIMPLE_DEV_PM_OPS(synquacer_spi_pm_ops, synquacer_spi_suspend,
- synquacer_spi_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(synquacer_spi_pm_ops, synquacer_spi_suspend,
+ synquacer_spi_resume);
static const struct of_device_id synquacer_spi_of_match[] = {
{.compatible = "socionext,synquacer-spi"},
@@ -806,7 +806,7 @@ MODULE_DEVICE_TABLE(acpi, synquacer_hsspi_acpi_ids);
static struct platform_driver synquacer_spi_driver = {
.driver = {
.name = "synquacer-spi",
- .pm = &synquacer_spi_pm_ops,
+ .pm = pm_sleep_ptr(&synquacer_spi_pm_ops),
.of_match_table = synquacer_spi_of_match,
.acpi_match_table = ACPI_PTR(synquacer_hsspi_acpi_ids),
},
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 34/39] spi: tegra114: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (32 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 33/39] spi: syncuacer: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:19 ` [PATCH 35/39] spi: tegra20-sflash: " Jisheng Zhang
` (4 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-tegra114.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c
index aa44ffd09e61..333fb549214e 100644
--- a/drivers/spi/spi-tegra114.c
+++ b/drivers/spi/spi-tegra114.c
@@ -1450,7 +1450,6 @@ static void tegra_spi_remove(struct platform_device *pdev)
tegra_spi_runtime_suspend(&pdev->dev);
}
-#ifdef CONFIG_PM_SLEEP
static int tegra_spi_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -1476,7 +1475,6 @@ static int tegra_spi_resume(struct device *dev)
return spi_controller_resume(host);
}
-#endif
static int tegra_spi_runtime_suspend(struct device *dev)
{
@@ -1505,14 +1503,14 @@ static int tegra_spi_runtime_resume(struct device *dev)
}
static const struct dev_pm_ops tegra_spi_pm_ops = {
- SET_RUNTIME_PM_OPS(tegra_spi_runtime_suspend,
- tegra_spi_runtime_resume, NULL)
- SET_SYSTEM_SLEEP_PM_OPS(tegra_spi_suspend, tegra_spi_resume)
+ RUNTIME_PM_OPS(tegra_spi_runtime_suspend,
+ tegra_spi_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(tegra_spi_suspend, tegra_spi_resume)
};
static struct platform_driver tegra_spi_driver = {
.driver = {
.name = "spi-tegra114",
- .pm = &tegra_spi_pm_ops,
+ .pm = pm_ptr(&tegra_spi_pm_ops),
.of_match_table = tegra_spi_of_match,
},
.probe = tegra_spi_probe,
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 35/39] spi: tegra20-sflash: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (33 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 34/39] spi: tegra114: " Jisheng Zhang
@ 2026-08-03 14:19 ` Jisheng Zhang
2026-08-03 14:20 ` [PATCH 36/39] spi: tegra20-slink: " Jisheng Zhang
` (3 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:19 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-tegra20-sflash.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/spi/spi-tegra20-sflash.c b/drivers/spi/spi-tegra20-sflash.c
index 2caa33f0a52c..2a5e3acea06b 100644
--- a/drivers/spi/spi-tegra20-sflash.c
+++ b/drivers/spi/spi-tegra20-sflash.c
@@ -533,7 +533,6 @@ static void tegra_sflash_remove(struct platform_device *pdev)
tegra_sflash_runtime_suspend(&pdev->dev);
}
-#ifdef CONFIG_PM_SLEEP
static int tegra_sflash_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -557,7 +556,6 @@ static int tegra_sflash_resume(struct device *dev)
return spi_controller_resume(host);
}
-#endif
static int tegra_sflash_runtime_suspend(struct device *dev)
{
@@ -586,14 +584,14 @@ static int tegra_sflash_runtime_resume(struct device *dev)
}
static const struct dev_pm_ops slink_pm_ops = {
- SET_RUNTIME_PM_OPS(tegra_sflash_runtime_suspend,
- tegra_sflash_runtime_resume, NULL)
- SET_SYSTEM_SLEEP_PM_OPS(tegra_sflash_suspend, tegra_sflash_resume)
+ RUNTIME_PM_OPS(tegra_sflash_runtime_suspend,
+ tegra_sflash_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(tegra_sflash_suspend, tegra_sflash_resume)
};
static struct platform_driver tegra_sflash_driver = {
.driver = {
.name = "spi-tegra-sflash",
- .pm = &slink_pm_ops,
+ .pm = pm_ptr(&slink_pm_ops),
.of_match_table = tegra_sflash_of_match,
},
.probe = tegra_sflash_probe,
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 36/39] spi: tegra20-slink: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (34 preceding siblings ...)
2026-08-03 14:19 ` [PATCH 35/39] spi: tegra20-sflash: " Jisheng Zhang
@ 2026-08-03 14:20 ` Jisheng Zhang
2026-08-03 14:20 ` [PATCH 37/39] spi: tegra210-quad: " Jisheng Zhang
` (2 subsequent siblings)
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:20 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/spi/spi-tegra20-slink.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c
index c15c076295cd..ed1fcf57dd30 100644
--- a/drivers/spi/spi-tegra20-slink.c
+++ b/drivers/spi/spi-tegra20-slink.c
@@ -1144,7 +1144,6 @@ static void tegra_slink_remove(struct platform_device *pdev)
tegra_slink_deinit_dma_param(tspi, true);
}
-#ifdef CONFIG_PM_SLEEP
static int tegra_slink_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -1169,9 +1168,8 @@ static int tegra_slink_resume(struct device *dev)
return spi_controller_resume(host);
}
-#endif
-static int __maybe_unused tegra_slink_runtime_suspend(struct device *dev)
+static int tegra_slink_runtime_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
struct tegra_slink_data *tspi = spi_controller_get_devdata(host);
@@ -1183,7 +1181,7 @@ static int __maybe_unused tegra_slink_runtime_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused tegra_slink_runtime_resume(struct device *dev)
+static int tegra_slink_runtime_resume(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
struct tegra_slink_data *tspi = spi_controller_get_devdata(host);
@@ -1198,14 +1196,14 @@ static int __maybe_unused tegra_slink_runtime_resume(struct device *dev)
}
static const struct dev_pm_ops slink_pm_ops = {
- SET_RUNTIME_PM_OPS(tegra_slink_runtime_suspend,
- tegra_slink_runtime_resume, NULL)
- SET_SYSTEM_SLEEP_PM_OPS(tegra_slink_suspend, tegra_slink_resume)
+ RUNTIME_PM_OPS(tegra_slink_runtime_suspend,
+ tegra_slink_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(tegra_slink_suspend, tegra_slink_resume)
};
static struct platform_driver tegra_slink_driver = {
.driver = {
.name = "spi-tegra-slink",
- .pm = &slink_pm_ops,
+ .pm = pm_ptr(&slink_pm_ops),
.of_match_table = tegra_slink_of_match,
},
.probe = tegra_slink_probe,
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 37/39] spi: tegra210-quad: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (35 preceding siblings ...)
2026-08-03 14:20 ` [PATCH 36/39] spi: tegra20-slink: " Jisheng Zhang
@ 2026-08-03 14:20 ` Jisheng Zhang
2026-08-03 14:20 ` [PATCH 38/39] spi: topcliff-pch: " Jisheng Zhang
2026-08-03 14:20 ` [PATCH 39/39] spi: zynqmp-gqspi: " Jisheng Zhang
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:20 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-tegra210-quad.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/spi/spi-tegra210-quad.c b/drivers/spi/spi-tegra210-quad.c
index 588a929a9785..8ede864c3d3c 100644
--- a/drivers/spi/spi-tegra210-quad.c
+++ b/drivers/spi/spi-tegra210-quad.c
@@ -1837,14 +1837,14 @@ static void tegra_qspi_remove(struct platform_device *pdev)
tegra_qspi_deinit_dma(tqspi);
}
-static int __maybe_unused tegra_qspi_suspend(struct device *dev)
+static int tegra_qspi_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
return spi_controller_suspend(host);
}
-static int __maybe_unused tegra_qspi_resume(struct device *dev)
+static int tegra_qspi_resume(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
struct tegra_qspi *tqspi = spi_controller_get_devdata(host);
@@ -1863,7 +1863,7 @@ static int __maybe_unused tegra_qspi_resume(struct device *dev)
return spi_controller_resume(host);
}
-static int __maybe_unused tegra_qspi_runtime_suspend(struct device *dev)
+static int tegra_qspi_runtime_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
struct tegra_qspi *tqspi = spi_controller_get_devdata(host);
@@ -1879,7 +1879,7 @@ static int __maybe_unused tegra_qspi_runtime_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused tegra_qspi_runtime_resume(struct device *dev)
+static int tegra_qspi_runtime_resume(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
struct tegra_qspi *tqspi = spi_controller_get_devdata(host);
@@ -1896,14 +1896,14 @@ static int __maybe_unused tegra_qspi_runtime_resume(struct device *dev)
}
static const struct dev_pm_ops tegra_qspi_pm_ops = {
- SET_RUNTIME_PM_OPS(tegra_qspi_runtime_suspend, tegra_qspi_runtime_resume, NULL)
- SET_SYSTEM_SLEEP_PM_OPS(tegra_qspi_suspend, tegra_qspi_resume)
+ RUNTIME_PM_OPS(tegra_qspi_runtime_suspend, tegra_qspi_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(tegra_qspi_suspend, tegra_qspi_resume)
};
static struct platform_driver tegra_qspi_driver = {
.driver = {
.name = "tegra-qspi",
- .pm = &tegra_qspi_pm_ops,
+ .pm = pm_ptr(&tegra_qspi_pm_ops),
.of_match_table = tegra_qspi_of_match,
.acpi_match_table = ACPI_PTR(tegra_qspi_acpi_match),
},
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 38/39] spi: topcliff-pch: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (36 preceding siblings ...)
2026-08-03 14:20 ` [PATCH 37/39] spi: tegra210-quad: " Jisheng Zhang
@ 2026-08-03 14:20 ` Jisheng Zhang
2026-08-03 14:20 ` [PATCH 39/39] spi: zynqmp-gqspi: " Jisheng Zhang
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:20 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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, for pch_spi_pd_driver, we also switch to modern
driver.pm for pm ops.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/spi/spi-topcliff-pch.c | 47 +++++++++++++++-------------------
1 file changed, 20 insertions(+), 27 deletions(-)
diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c
index c5409ca7faef..98723042c16f 100644
--- a/drivers/spi/spi-topcliff-pch.c
+++ b/drivers/spi/spi-topcliff-pch.c
@@ -1438,19 +1438,17 @@ static void pch_spi_pd_remove(struct platform_device *plat_dev)
spi_controller_put(data->host);
}
-#ifdef CONFIG_PM
-static int pch_spi_pd_suspend(struct platform_device *pd_dev,
- pm_message_t state)
+
+static int pch_spi_pd_suspend(struct device *dev)
{
u8 count;
- struct pch_spi_board_data *board_dat = dev_get_platdata(&pd_dev->dev);
- struct pch_spi_data *data = platform_get_drvdata(pd_dev);
+ struct pch_spi_board_data *board_dat = dev_get_platdata(dev);
+ struct pch_spi_data *data = dev_get_drvdata(dev);
- dev_dbg(&pd_dev->dev, "%s ENTRY\n", __func__);
+ dev_dbg(dev, "%s ENTRY\n", __func__);
if (!board_dat) {
- dev_err(&pd_dev->dev,
- "%s pci_get_drvdata returned NULL\n", __func__);
+ dev_err(dev, "%s pci_get_drvdata returned NULL\n", __func__);
return -EFAULT;
}
@@ -1471,22 +1469,20 @@ static int pch_spi_pd_suspend(struct platform_device *pd_dev,
free_irq(board_dat->pdev->irq, data);
data->irq_reg_sts = false;
- dev_dbg(&pd_dev->dev,
- "%s free_irq invoked successfully.\n", __func__);
+ dev_dbg(dev, "%s free_irq invoked successfully.\n", __func__);
}
return 0;
}
-static int pch_spi_pd_resume(struct platform_device *pd_dev)
+static int pch_spi_pd_resume(struct device *dev)
{
- struct pch_spi_board_data *board_dat = dev_get_platdata(&pd_dev->dev);
- struct pch_spi_data *data = platform_get_drvdata(pd_dev);
+ struct pch_spi_board_data *board_dat = dev_get_platdata(dev);
+ struct pch_spi_data *data = dev_get_drvdata(dev);
int retval;
if (!board_dat) {
- dev_err(&pd_dev->dev,
- "%s pci_get_drvdata returned NULL\n", __func__);
+ dev_err(dev, "%s pci_get_drvdata returned NULL\n", __func__);
return -EFAULT;
}
@@ -1495,8 +1491,7 @@ static int pch_spi_pd_resume(struct platform_device *pd_dev)
retval = request_irq(board_dat->pdev->irq, pch_spi_handler,
IRQF_SHARED, KBUILD_MODNAME, data);
if (retval < 0) {
- dev_err(&pd_dev->dev,
- "%s request_irq failed\n", __func__);
+ dev_err(dev, "%s request_irq failed\n", __func__);
return retval;
}
@@ -1507,19 +1502,17 @@ static int pch_spi_pd_resume(struct platform_device *pd_dev)
}
return 0;
}
-#else
-#define pch_spi_pd_suspend NULL
-#define pch_spi_pd_resume NULL
-#endif
+
+static DEFINE_SIMPLE_DEV_PM_OPS(pch_spi_pd_pm_ops,
+ pch_spi_pd_suspend, pch_spi_pd_resume);
static struct platform_driver pch_spi_pd_driver = {
.driver = {
.name = "pch-spi",
+ .pm = pm_sleep_ptr(&pch_spi_pd_pm_ops),
},
.probe = pch_spi_pd_probe,
.remove = pch_spi_pd_remove,
- .suspend = pch_spi_pd_suspend,
- .resume = pch_spi_pd_resume
};
static int pch_spi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
@@ -1618,7 +1611,7 @@ static void pch_spi_remove(struct pci_dev *pdev)
kfree(pd_dev_save);
}
-static int __maybe_unused pch_spi_suspend(struct device *dev)
+static int pch_spi_suspend(struct device *dev)
{
struct pch_pd_dev_save *pd_dev_save = dev_get_drvdata(dev);
@@ -1629,7 +1622,7 @@ static int __maybe_unused pch_spi_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused pch_spi_resume(struct device *dev)
+static int pch_spi_resume(struct device *dev)
{
struct pch_pd_dev_save *pd_dev_save = dev_get_drvdata(dev);
@@ -1641,14 +1634,14 @@ static int __maybe_unused pch_spi_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(pch_spi_pm_ops, pch_spi_suspend, pch_spi_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(pch_spi_pm_ops, pch_spi_suspend, pch_spi_resume);
static struct pci_driver pch_spi_pcidev_driver = {
.name = "pch_spi",
.id_table = pch_spi_pcidev_id,
.probe = pch_spi_probe,
.remove = pch_spi_remove,
- .driver.pm = &pch_spi_pm_ops,
+ .driver.pm = pm_sleep_ptr(&pch_spi_pm_ops),
};
static int __init pch_spi_init(void)
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 39/39] spi: zynqmp-gqspi: use modern PM macros
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
` (37 preceding siblings ...)
2026-08-03 14:20 ` [PATCH 38/39] spi: topcliff-pch: " Jisheng Zhang
@ 2026-08-03 14:20 ` Jisheng Zhang
38 siblings, 0 replies; 40+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:20 UTC (permalink / raw)
To: Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Radu Pirea, Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang,
Prasad Bolisetty, Kamal Dasu, William Zhang, Kursad Oney,
Jonas Gorski, Anand Gore, Florian Fainelli,
Rafał Miłecki, Vladimir Oltean, Frank Li, Ray Jui,
Scott Branden, Yinbo Zhu, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Heiko Stuebner,
Andi Shyti, Tudor Ambarus, Krzysztof Kozlowski, Alim Akhtar,
Orson Zhai, Baolin Wang, Chunyan Zhang, Li-hao Kuo,
Masahisa Kojima, Jassi Brar, Laxman Dewangan, Thierry Reding,
Jonathan Hunter, Sowjanya Komatineni, Michal Simek
Cc: bcm-kernel-feedback-list, linux-spi, 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/spi/spi-zynqmp-gqspi.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c
index f9a1427dabad..4d55090fa443 100644
--- a/drivers/spi/spi-zynqmp-gqspi.c
+++ b/drivers/spi/spi-zynqmp-gqspi.c
@@ -935,7 +935,7 @@ static int zynqmp_qspi_read_op(struct zynqmp_qspi *xqspi, u8 rx_nbits,
*
* Return: Always 0
*/
-static int __maybe_unused zynqmp_qspi_suspend(struct device *dev)
+static int zynqmp_qspi_suspend(struct device *dev)
{
struct zynqmp_qspi *xqspi = dev_get_drvdata(dev);
struct spi_controller *ctlr = xqspi->ctlr;
@@ -959,7 +959,7 @@ static int __maybe_unused zynqmp_qspi_suspend(struct device *dev)
*
* Return: 0 on success; error value otherwise
*/
-static int __maybe_unused zynqmp_qspi_resume(struct device *dev)
+static int zynqmp_qspi_resume(struct device *dev)
{
struct zynqmp_qspi *xqspi = dev_get_drvdata(dev);
struct spi_controller *ctlr = xqspi->ctlr;
@@ -979,7 +979,7 @@ static int __maybe_unused zynqmp_qspi_resume(struct device *dev)
*
* Return: Always 0
*/
-static int __maybe_unused zynqmp_runtime_suspend(struct device *dev)
+static int zynqmp_runtime_suspend(struct device *dev)
{
struct zynqmp_qspi *xqspi = dev_get_drvdata(dev);
@@ -997,7 +997,7 @@ static int __maybe_unused zynqmp_runtime_suspend(struct device *dev)
*
* Return: 0 on success and error value on error
*/
-static int __maybe_unused zynqmp_runtime_resume(struct device *dev)
+static int zynqmp_runtime_resume(struct device *dev)
{
struct zynqmp_qspi *xqspi = dev_get_drvdata(dev);
int ret;
@@ -1186,9 +1186,8 @@ static int zynqmp_qspi_exec_op(struct spi_mem *mem,
}
static const struct dev_pm_ops zynqmp_qspi_dev_pm_ops = {
- SET_RUNTIME_PM_OPS(zynqmp_runtime_suspend,
- zynqmp_runtime_resume, NULL)
- SET_SYSTEM_SLEEP_PM_OPS(zynqmp_qspi_suspend, zynqmp_qspi_resume)
+ RUNTIME_PM_OPS(zynqmp_runtime_suspend, zynqmp_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(zynqmp_qspi_suspend, zynqmp_qspi_resume)
};
static const struct qspi_platform_data versal_qspi_def = {
@@ -1382,7 +1381,7 @@ static struct platform_driver zynqmp_qspi_driver = {
.driver = {
.name = "zynqmp-qspi",
.of_match_table = zynqmp_qspi_of_match,
- .pm = &zynqmp_qspi_dev_pm_ops,
+ .pm = pm_ptr(&zynqmp_qspi_dev_pm_ops),
},
};
--
2.53.0
^ permalink raw reply related [flat|nested] 40+ messages in thread
end of thread, other threads:[~2026-08-03 14:47 UTC | newest]
Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
2026-08-03 14:19 ` [PATCH 01/39] spi: atmel-quadspi: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 02/39] spi: amlogic-spifc-a1: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 03/39] spi: at91-usart: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 04/39] spi: axiado: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 05/39] spi: bcm-qspi: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 06/39] spi: bcm63xx-hsspi: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 07/39] spi: bcmbca-hsspi: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 08/39] spi: cadence: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 09/39] spi: coldfire-qspi: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 10/39] spi: dln2: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 11/39] spi: dw-pci: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 12/39] spi: spi-fsl-dspi: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 13/39] spi: fsl-espi: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 14/39] spi: fsl-lpspi: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 15/39] spi: qcom-geni: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 16/39] spi: img-spfi: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 17/39] spi: loongson: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 18/39] spi: meson-spifc: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 19/39] spi: mt65xx: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 20/39] spi: mtk-nor: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 21/39] spi: mxic: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 22/39] spi: omap2-mcspi: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 23/39] spi: orion: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 24/39] spi: pl022: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 25/39] spi: spi-qcom-qspi: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 26/39] spi: qup: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 27/39] spi: rockchip-sfc: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 28/39] spi: rockchip: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 29/39] spi: s3c64xx: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 30/39] spi: slave-mt27xx: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 31/39] spi: sprd: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 32/39] spi: sunplus-sp7021: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 33/39] spi: syncuacer: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 34/39] spi: tegra114: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 35/39] spi: tegra20-sflash: " Jisheng Zhang
2026-08-03 14:20 ` [PATCH 36/39] spi: tegra20-slink: " Jisheng Zhang
2026-08-03 14:20 ` [PATCH 37/39] spi: tegra210-quad: " Jisheng Zhang
2026-08-03 14:20 ` [PATCH 38/39] spi: topcliff-pch: " Jisheng Zhang
2026-08-03 14:20 ` [PATCH 39/39] spi: zynqmp-gqspi: " Jisheng Zhang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox