summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlain Volmat <alain.volmat@foss.st.com>2026-01-06 15:14:18 +0300
committerMark Brown <broonie@kernel.org>2026-01-06 15:23:37 +0300
commit2a2d7187f5a7238582c2bbd4a6da7595c20e55a9 (patch)
tree7ef9d08832ba413b87c9a6a1793dec9235c28f23
parentd4469e4ee5da0a93eabfcb89a8c6ecdf7cf1e9be (diff)
downloadlinux-2a2d7187f5a7238582c2bbd4a6da7595c20e55a9.tar.xz
spi: stm32-ospi: 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@foss.st.com> Link: https://patch.msgid.link/20260106-spi_st_maybe_unused_removal-v1-2-8f5ca7136e96@foss.st.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spi-stm32-ospi.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/spi/spi-stm32-ospi.c b/drivers/spi/spi-stm32-ospi.c
index f36fd36da269..952db0eabb3d 100644
--- a/drivers/spi/spi-stm32-ospi.c
+++ b/drivers/spi/spi-stm32-ospi.c
@@ -985,7 +985,7 @@ static void stm32_ospi_remove(struct platform_device *pdev)
pm_runtime_force_suspend(ospi->dev);
}
-static int __maybe_unused stm32_ospi_suspend(struct device *dev)
+static int stm32_ospi_suspend(struct device *dev)
{
struct stm32_ospi *ospi = dev_get_drvdata(dev);
@@ -996,7 +996,7 @@ static int __maybe_unused stm32_ospi_suspend(struct device *dev)
return pm_runtime_force_suspend(ospi->dev);
}
-static int __maybe_unused stm32_ospi_resume(struct device *dev)
+static int stm32_ospi_resume(struct device *dev)
{
struct stm32_ospi *ospi = dev_get_drvdata(dev);
void __iomem *regs_base = ospi->regs_base;
@@ -1025,7 +1025,7 @@ static int __maybe_unused stm32_ospi_resume(struct device *dev)
return 0;
}
-static int __maybe_unused stm32_ospi_runtime_suspend(struct device *dev)
+static int stm32_ospi_runtime_suspend(struct device *dev)
{
struct stm32_ospi *ospi = dev_get_drvdata(dev);
@@ -1034,7 +1034,7 @@ static int __maybe_unused stm32_ospi_runtime_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused stm32_ospi_runtime_resume(struct device *dev)
+static int stm32_ospi_runtime_resume(struct device *dev)
{
struct stm32_ospi *ospi = dev_get_drvdata(dev);
@@ -1042,9 +1042,8 @@ static int __maybe_unused stm32_ospi_runtime_resume(struct device *dev)
}
static const struct dev_pm_ops stm32_ospi_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(stm32_ospi_suspend, stm32_ospi_resume)
- SET_RUNTIME_PM_OPS(stm32_ospi_runtime_suspend,
- stm32_ospi_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(stm32_ospi_suspend, stm32_ospi_resume)
+ RUNTIME_PM_OPS(stm32_ospi_runtime_suspend, stm32_ospi_runtime_resume, NULL)
};
static const struct of_device_id stm32_ospi_of_match[] = {
@@ -1058,7 +1057,7 @@ static struct platform_driver stm32_ospi_driver = {
.remove = stm32_ospi_remove,
.driver = {
.name = "stm32-ospi",
- .pm = &stm32_ospi_pm_ops,
+ .pm = pm_ptr(&stm32_ospi_pm_ops),
.of_match_table = stm32_ospi_of_match,
},
};