[PATCH 25/39] spi: spi-qcom-qspi: use modern PM macros
Jisheng Zhang <[email protected]> Mon, 3 Aug 2026 22:19:49 +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-qcom-qspi.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-qcom-qspi.c b/drivers/spi/spi-qcom-qspi.c index caf55a6f70b3..0ac06a1ab868 100644 --- a/drivers/spi/spi-qcom-qspi.c +++ b/drivers/spi/spi-qcom-qspi.c @@ -828,7 +828,7 @@ static void qcom_qspi_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); } -static int __maybe_unused qcom_qspi_runtime_suspend(struct device *dev) +static int qcom_qspi_runtime_suspend(struct device *dev) { struct spi_controller *host = dev_get_drvdata(dev); struct qcom_qspi *ctrl = spi_controller_get_devdata(host); @@ -872,7 +872,7 @@ static int __maybe_unused qcom_qspi_runtime_suspend(struct device *dev) return ret; } -static int __maybe_unused qcom_qspi_runtime_resume(struct device *dev) +static int qcom_qspi_runtime_resume(struct device *dev) { struct spi_controller *host = dev_get_drvdata(dev); struct qcom_qspi *ctrl = spi_controller_get_devdata(host); @@ -916,7 +916,7 @@ static int __maybe_unused qcom_qspi_runtime_resume(struct device *dev) return ret; } -static int __maybe_unused qcom_qspi_suspend(struct device *dev) +static int qcom_qspi_suspend(struct device *dev) { struct spi_controller *host = dev_get_drvdata(dev); int ret; @@ -932,7 +932,7 @@ static int __maybe_unused qcom_qspi_suspend(struct device *dev) return ret; } -static int __maybe_unused qcom_qspi_resume(struct device *dev) +static int qcom_qspi_resume(struct device *dev) { struct spi_controller *host = dev_get_drvdata(dev); int ret; @@ -949,9 +949,9 @@ static int __maybe_unused qcom_qspi_resume(struct device *dev) } static const struct dev_pm_ops qcom_qspi_dev_pm_ops = { - SET_RUNTIME_PM_OPS(qcom_qspi_runtime_suspend, - qcom_qspi_runtime_resume, NULL) - SET_SYSTEM_SLEEP_PM_OPS(qcom_qspi_suspend, qcom_qspi_resume) + RUNTIME_PM_OPS(qcom_qspi_runtime_suspend, + qcom_qspi_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(qcom_qspi_suspend, qcom_qspi_resume) }; static const struct of_device_id qcom_qspi_dt_match[] = { @@ -963,7 +963,7 @@ MODULE_DEVICE_TABLE(of, qcom_qspi_dt_match); static struct platform_driver qcom_qspi_driver = { .driver = { .name = "qcom_qspi", - .pm = &qcom_qspi_dev_pm_ops, + .pm = pm_ptr(&qcom_qspi_dev_pm_ops), .of_match_table = qcom_qspi_dt_match, }, .probe = qcom_qspi_probe, -- 2.53.0