[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260106-spi_st_maybe_unused_removal-v1-4-8f5ca7136e96@foss.st.com>
Date: Tue, 6 Jan 2026 13:14:20 +0100
From: Alain Volmat <alain.volmat@...s.st.com>
To: Mark Brown <broonie@...nel.org>,
Maxime Coquelin
<mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>
CC: <linux-spi@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-stm32@...md-mailman.stormreply.com>,
<linux-arm-kernel@...ts.infradead.org>,
Alain Volmat
<alain.volmat@...s.st.com>
Subject: [PATCH 4/4] drivers: spi: stm32: avoid __maybe_unused and use
pm_ptr
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@...s.st.com>
---
drivers/spi/spi-stm32.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
index 8f8968383ad0..5c1e685a65d9 100644
--- a/drivers/spi/spi-stm32.c
+++ b/drivers/spi/spi-stm32.c
@@ -2614,7 +2614,7 @@ static void stm32_spi_remove(struct platform_device *pdev)
pinctrl_pm_select_sleep_state(&pdev->dev);
}
-static int __maybe_unused stm32_spi_runtime_suspend(struct device *dev)
+static int stm32_spi_runtime_suspend(struct device *dev)
{
struct spi_controller *ctrl = dev_get_drvdata(dev);
struct stm32_spi *spi = spi_controller_get_devdata(ctrl);
@@ -2624,7 +2624,7 @@ static int __maybe_unused stm32_spi_runtime_suspend(struct device *dev)
return pinctrl_pm_select_sleep_state(dev);
}
-static int __maybe_unused stm32_spi_runtime_resume(struct device *dev)
+static int stm32_spi_runtime_resume(struct device *dev)
{
struct spi_controller *ctrl = dev_get_drvdata(dev);
struct stm32_spi *spi = spi_controller_get_devdata(ctrl);
@@ -2637,7 +2637,7 @@ static int __maybe_unused stm32_spi_runtime_resume(struct device *dev)
return clk_prepare_enable(spi->clk);
}
-static int __maybe_unused stm32_spi_suspend(struct device *dev)
+static int stm32_spi_suspend(struct device *dev)
{
struct spi_controller *ctrl = dev_get_drvdata(dev);
int ret;
@@ -2649,7 +2649,7 @@ static int __maybe_unused stm32_spi_suspend(struct device *dev)
return pm_runtime_force_suspend(dev);
}
-static int __maybe_unused stm32_spi_resume(struct device *dev)
+static int stm32_spi_resume(struct device *dev)
{
struct spi_controller *ctrl = dev_get_drvdata(dev);
struct stm32_spi *spi = spi_controller_get_devdata(ctrl);
@@ -2679,9 +2679,8 @@ static int __maybe_unused stm32_spi_resume(struct device *dev)
}
static const struct dev_pm_ops stm32_spi_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(stm32_spi_suspend, stm32_spi_resume)
- SET_RUNTIME_PM_OPS(stm32_spi_runtime_suspend,
- stm32_spi_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(stm32_spi_suspend, stm32_spi_resume)
+ RUNTIME_PM_OPS(stm32_spi_runtime_suspend, stm32_spi_runtime_resume, NULL)
};
static struct platform_driver stm32_spi_driver = {
@@ -2689,7 +2688,7 @@ static struct platform_driver stm32_spi_driver = {
.remove = stm32_spi_remove,
.driver = {
.name = DRIVER_NAME,
- .pm = &stm32_spi_pm_ops,
+ .pm = pm_ptr(&stm32_spi_pm_ops),
.of_match_table = stm32_spi_of_match,
},
};
--
2.34.1
Powered by blists - more mailing lists