[PATCH 21/39] spi: mxic: use modern PM macros

Jisheng Zhang <[email protected]> Mon, 3 Aug 2026 22:19:45 +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 __maybe_unused.

Signed-off-by: Jisheng Zhang <[email protected]>
---
 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