Skip to content

Commit 2a2d718

Browse files
Alain Volmatbroonie
authored andcommitted
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>
1 parent d4469e4 commit 2a2d718

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

drivers/spi/spi-stm32-ospi.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ static void stm32_ospi_remove(struct platform_device *pdev)
985985
pm_runtime_force_suspend(ospi->dev);
986986
}
987987

988-
static int __maybe_unused stm32_ospi_suspend(struct device *dev)
988+
static int stm32_ospi_suspend(struct device *dev)
989989
{
990990
struct stm32_ospi *ospi = dev_get_drvdata(dev);
991991

@@ -996,7 +996,7 @@ static int __maybe_unused stm32_ospi_suspend(struct device *dev)
996996
return pm_runtime_force_suspend(ospi->dev);
997997
}
998998

999-
static int __maybe_unused stm32_ospi_resume(struct device *dev)
999+
static int stm32_ospi_resume(struct device *dev)
10001000
{
10011001
struct stm32_ospi *ospi = dev_get_drvdata(dev);
10021002
void __iomem *regs_base = ospi->regs_base;
@@ -1025,7 +1025,7 @@ static int __maybe_unused stm32_ospi_resume(struct device *dev)
10251025
return 0;
10261026
}
10271027

1028-
static int __maybe_unused stm32_ospi_runtime_suspend(struct device *dev)
1028+
static int stm32_ospi_runtime_suspend(struct device *dev)
10291029
{
10301030
struct stm32_ospi *ospi = dev_get_drvdata(dev);
10311031

@@ -1034,17 +1034,16 @@ static int __maybe_unused stm32_ospi_runtime_suspend(struct device *dev)
10341034
return 0;
10351035
}
10361036

1037-
static int __maybe_unused stm32_ospi_runtime_resume(struct device *dev)
1037+
static int stm32_ospi_runtime_resume(struct device *dev)
10381038
{
10391039
struct stm32_ospi *ospi = dev_get_drvdata(dev);
10401040

10411041
return clk_prepare_enable(ospi->clk);
10421042
}
10431043

10441044
static const struct dev_pm_ops stm32_ospi_pm_ops = {
1045-
SET_SYSTEM_SLEEP_PM_OPS(stm32_ospi_suspend, stm32_ospi_resume)
1046-
SET_RUNTIME_PM_OPS(stm32_ospi_runtime_suspend,
1047-
stm32_ospi_runtime_resume, NULL)
1045+
SYSTEM_SLEEP_PM_OPS(stm32_ospi_suspend, stm32_ospi_resume)
1046+
RUNTIME_PM_OPS(stm32_ospi_runtime_suspend, stm32_ospi_runtime_resume, NULL)
10481047
};
10491048

10501049
static const struct of_device_id stm32_ospi_of_match[] = {
@@ -1058,7 +1057,7 @@ static struct platform_driver stm32_ospi_driver = {
10581057
.remove = stm32_ospi_remove,
10591058
.driver = {
10601059
.name = "stm32-ospi",
1061-
.pm = &stm32_ospi_pm_ops,
1060+
.pm = pm_ptr(&stm32_ospi_pm_ops),
10621061
.of_match_table = stm32_ospi_of_match,
10631062
},
10641063
};

0 commit comments

Comments
 (0)