]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
spi: stm32-qspi: avoid __maybe_unused and use pm_ptr
authorAlain Volmat <alain.volmat@foss.st.com>
Tue, 6 Jan 2026 12:14:19 +0000 (13:14 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 6 Jan 2026 12:23:38 +0000 (12:23 +0000)
Switch to usage of pm_ptr / SYSTEM_SLEEP_PM_OPS / RUNTIME_PM_OPS
in order to avoid having to mark the pm related functions as
__maybe_unused.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Link: https://patch.msgid.link/20260106-spi_st_maybe_unused_removal-v1-3-8f5ca7136e96@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-stm32-qspi.c

index f2d19f1c5ab1c4ea4c2269108c7250fc00d707a9..e7965be99bd95532802fe77253fc529a13314b40 100644 (file)
@@ -891,7 +891,7 @@ static void stm32_qspi_remove(struct platform_device *pdev)
        clk_disable_unprepare(qspi->clk);
 }
 
-static int __maybe_unused stm32_qspi_runtime_suspend(struct device *dev)
+static int stm32_qspi_runtime_suspend(struct device *dev)
 {
        struct stm32_qspi *qspi = dev_get_drvdata(dev);
 
@@ -900,21 +900,21 @@ static int __maybe_unused stm32_qspi_runtime_suspend(struct device *dev)
        return 0;
 }
 
-static int __maybe_unused stm32_qspi_runtime_resume(struct device *dev)
+static int stm32_qspi_runtime_resume(struct device *dev)
 {
        struct stm32_qspi *qspi = dev_get_drvdata(dev);
 
        return clk_prepare_enable(qspi->clk);
 }
 
-static int __maybe_unused stm32_qspi_suspend(struct device *dev)
+static int stm32_qspi_suspend(struct device *dev)
 {
        pinctrl_pm_select_sleep_state(dev);
 
        return pm_runtime_force_suspend(dev);
 }
 
-static int __maybe_unused stm32_qspi_resume(struct device *dev)
+static int stm32_qspi_resume(struct device *dev)
 {
        struct stm32_qspi *qspi = dev_get_drvdata(dev);
        int ret;
@@ -938,9 +938,8 @@ static int __maybe_unused stm32_qspi_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops stm32_qspi_pm_ops = {
-       SET_RUNTIME_PM_OPS(stm32_qspi_runtime_suspend,
-                          stm32_qspi_runtime_resume, NULL)
-       SET_SYSTEM_SLEEP_PM_OPS(stm32_qspi_suspend, stm32_qspi_resume)
+       RUNTIME_PM_OPS(stm32_qspi_runtime_suspend, stm32_qspi_runtime_resume, NULL)
+       SYSTEM_SLEEP_PM_OPS(stm32_qspi_suspend, stm32_qspi_resume)
 };
 
 static const struct of_device_id stm32_qspi_match[] = {
@@ -955,7 +954,7 @@ static struct platform_driver stm32_qspi_driver = {
        .driver = {
                .name = "stm32-qspi",
                .of_match_table = stm32_qspi_match,
-               .pm = &stm32_qspi_pm_ops,
+               .pm = pm_ptr(&stm32_qspi_pm_ops),
        },
 };
 module_platform_driver(stm32_qspi_driver);