Skip to content

Commit 7c7cda8

Browse files
rgallaispoubroonie
authored andcommitted
spi: st: fix PM macros to use CONFIG_PM instead of CONFIG_PM_SLEEP
pm_sleep_ptr() depends on CONFIG_PM_SLEEP while pm_ptr() depends on CONFIG_PM. Since ST SSC4 implements runtime PM it makes sense using pm_ptr() here. For the same reason replace PM macros that use CONFIG_PM. Doing so prevents from using __maybe_unused attribute of runtime PM functions. Link: https://lore.kernel.org/lkml/CAMuHMdX9nkROkAJJ5odv4qOWe0bFTmaFs=Rfxsfuc9+DT-bsEQ@mail.gmail.com Fixes: 6f8584a ("spi: st: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()") Signed-off-by: Raphael Gallais-Pou <rgallaispou@gmail.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20250820180310.9605-1-rgallaispou@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 13d0fe8 commit 7c7cda8

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

drivers/spi/spi-st-ssc4.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ static void spi_st_remove(struct platform_device *pdev)
378378
pinctrl_pm_select_sleep_state(&pdev->dev);
379379
}
380380

381-
static int __maybe_unused spi_st_runtime_suspend(struct device *dev)
381+
static int spi_st_runtime_suspend(struct device *dev)
382382
{
383383
struct spi_controller *host = dev_get_drvdata(dev);
384384
struct spi_st *spi_st = spi_controller_get_devdata(host);
@@ -391,7 +391,7 @@ static int __maybe_unused spi_st_runtime_suspend(struct device *dev)
391391
return 0;
392392
}
393393

394-
static int __maybe_unused spi_st_runtime_resume(struct device *dev)
394+
static int spi_st_runtime_resume(struct device *dev)
395395
{
396396
struct spi_controller *host = dev_get_drvdata(dev);
397397
struct spi_st *spi_st = spi_controller_get_devdata(host);
@@ -428,8 +428,8 @@ static int __maybe_unused spi_st_resume(struct device *dev)
428428
}
429429

430430
static const struct dev_pm_ops spi_st_pm = {
431-
SET_SYSTEM_SLEEP_PM_OPS(spi_st_suspend, spi_st_resume)
432-
SET_RUNTIME_PM_OPS(spi_st_runtime_suspend, spi_st_runtime_resume, NULL)
431+
SYSTEM_SLEEP_PM_OPS(spi_st_suspend, spi_st_resume)
432+
RUNTIME_PM_OPS(spi_st_runtime_suspend, spi_st_runtime_resume, NULL)
433433
};
434434

435435
static const struct of_device_id stm_spi_match[] = {
@@ -441,7 +441,7 @@ MODULE_DEVICE_TABLE(of, stm_spi_match);
441441
static struct platform_driver spi_st_driver = {
442442
.driver = {
443443
.name = "spi-st",
444-
.pm = pm_sleep_ptr(&spi_st_pm),
444+
.pm = pm_ptr(&spi_st_pm),
445445
.of_match_table = of_match_ptr(stm_spi_match),
446446
},
447447
.probe = spi_st_probe,

0 commit comments

Comments
 (0)