From 1e64a06711595124889ffe0bd0c9150430a00403 Mon Sep 17 00:00:00 2001 From: Jisheng Zhang Date: Mon, 3 Aug 2026 22:19:32 +0800 Subject: [PATCH] spi: cadence: 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-9-jszhang@kernel.org Signed-off-by: Mark Brown --- 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 af1a05e78492..50ef3a7871c2 100644 --- a/drivers/spi/spi-cadence.c +++ b/drivers/spi/spi-cadence.c @@ -807,7 +807,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); @@ -822,7 +822,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); @@ -839,7 +839,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); @@ -868,7 +868,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); @@ -880,9 +880,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[] = { @@ -900,7 +899,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), }, };