[PATCH 22/39] spi: omap2-mcspi: use modern PM macros
Jisheng Zhang <[email protected]> Mon, 3 Aug 2026 22:19:46 +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-omap2-mcspi.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c index 9cc078acc13c..a3355147f5de 100644 --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c @@ -1620,7 +1620,7 @@ static void omap2_mcspi_remove(struct platform_device *pdev) /* work with hotplug and coldplug */ MODULE_ALIAS("platform:omap2_mcspi"); -static int __maybe_unused omap2_mcspi_suspend(struct device *dev) +static int omap2_mcspi_suspend(struct device *dev) { struct spi_controller *ctlr = dev_get_drvdata(dev); struct omap2_mcspi *mcspi = spi_controller_get_devdata(ctlr); @@ -1639,7 +1639,7 @@ static int __maybe_unused omap2_mcspi_suspend(struct device *dev) return pm_runtime_force_suspend(dev); } -static int __maybe_unused omap2_mcspi_resume(struct device *dev) +static int omap2_mcspi_resume(struct device *dev) { struct spi_controller *ctlr = dev_get_drvdata(dev); struct omap2_mcspi *mcspi = spi_controller_get_devdata(ctlr); @@ -1654,8 +1654,7 @@ static int __maybe_unused omap2_mcspi_resume(struct device *dev) } static const struct dev_pm_ops omap2_mcspi_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(omap2_mcspi_suspend, - omap2_mcspi_resume) + SYSTEM_SLEEP_PM_OPS(omap2_mcspi_suspend, omap2_mcspi_resume) .runtime_suspend = omap_mcspi_runtime_suspend, .runtime_resume = omap_mcspi_runtime_resume, }; @@ -1663,7 +1662,7 @@ static const struct dev_pm_ops omap2_mcspi_pm_ops = { static struct platform_driver omap2_mcspi_driver = { .driver = { .name = "omap2_mcspi", - .pm = &omap2_mcspi_pm_ops, + .pm = pm_ptr(&omap2_mcspi_pm_ops), .of_match_table = omap_mcspi_of_match, }, .probe = omap2_mcspi_probe, -- 2.53.0