Skip to content

Commit 10a6d75

Browse files
Alain Volmatbroonie
authored andcommitted
spi: stm32-qspi: 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-3-8f5ca7136e96@foss.st.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 2a2d718 commit 10a6d75

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

drivers/spi/spi-stm32-qspi.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ static void stm32_qspi_remove(struct platform_device *pdev)
891891
clk_disable_unprepare(qspi->clk);
892892
}
893893

894-
static int __maybe_unused stm32_qspi_runtime_suspend(struct device *dev)
894+
static int stm32_qspi_runtime_suspend(struct device *dev)
895895
{
896896
struct stm32_qspi *qspi = dev_get_drvdata(dev);
897897

@@ -900,21 +900,21 @@ static int __maybe_unused stm32_qspi_runtime_suspend(struct device *dev)
900900
return 0;
901901
}
902902

903-
static int __maybe_unused stm32_qspi_runtime_resume(struct device *dev)
903+
static int stm32_qspi_runtime_resume(struct device *dev)
904904
{
905905
struct stm32_qspi *qspi = dev_get_drvdata(dev);
906906

907907
return clk_prepare_enable(qspi->clk);
908908
}
909909

910-
static int __maybe_unused stm32_qspi_suspend(struct device *dev)
910+
static int stm32_qspi_suspend(struct device *dev)
911911
{
912912
pinctrl_pm_select_sleep_state(dev);
913913

914914
return pm_runtime_force_suspend(dev);
915915
}
916916

917-
static int __maybe_unused stm32_qspi_resume(struct device *dev)
917+
static int stm32_qspi_resume(struct device *dev)
918918
{
919919
struct stm32_qspi *qspi = dev_get_drvdata(dev);
920920
int ret;
@@ -938,9 +938,8 @@ static int __maybe_unused stm32_qspi_resume(struct device *dev)
938938
}
939939

940940
static const struct dev_pm_ops stm32_qspi_pm_ops = {
941-
SET_RUNTIME_PM_OPS(stm32_qspi_runtime_suspend,
942-
stm32_qspi_runtime_resume, NULL)
943-
SET_SYSTEM_SLEEP_PM_OPS(stm32_qspi_suspend, stm32_qspi_resume)
941+
RUNTIME_PM_OPS(stm32_qspi_runtime_suspend, stm32_qspi_runtime_resume, NULL)
942+
SYSTEM_SLEEP_PM_OPS(stm32_qspi_suspend, stm32_qspi_resume)
944943
};
945944

946945
static const struct of_device_id stm32_qspi_match[] = {
@@ -955,7 +954,7 @@ static struct platform_driver stm32_qspi_driver = {
955954
.driver = {
956955
.name = "stm32-qspi",
957956
.of_match_table = stm32_qspi_match,
958-
.pm = &stm32_qspi_pm_ops,
957+
.pm = pm_ptr(&stm32_qspi_pm_ops),
959958
},
960959
};
961960
module_platform_driver(stm32_qspi_driver);

0 commit comments

Comments
 (0)