[PATCH 08/39] spi: cadence: use modern PM macros
Jisheng Zhang <[email protected]> Mon, 3 Aug 2026 22:19:32 +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-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