From 169d9f0fd9849a9ec8a0e4e889a8ad7953d0f334 Mon Sep 17 00:00:00 2001 From: Jisheng Zhang Date: Mon, 3 Aug 2026 22:19:45 +0800 Subject: [PATCH] spi: mxic: use modern PM macros Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused. Signed-off-by: Jisheng Zhang Link: https://patch.msgid.link/20260803142003.12857-22-jszhang@kernel.org Signed-off-by: Mark Brown --- 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);