[PATCH 14/39] spi: fsl-lpspi: use modern PM macros

Jisheng Zhang <[email protected]> Mon, 3 Aug 2026 22:19:38 +0800
Newsgroups org.kernel.vger.linux-spi,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
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 <[email protected]>
---
 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