linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: st: fix PM macros to use CONFIG_PM instead of CONFIG_PM_SLEEP
@ 2025-08-20 18:03 Raphael Gallais-Pou
  2025-08-21  7:29 ` Geert Uytterhoeven
  2025-08-21 18:25 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Raphael Gallais-Pou @ 2025-08-20 18:03 UTC (permalink / raw)
  To: Mark Brown, Geert Uytterhoeven; +Cc: linux-spi, linux-kernel

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: 6f8584a4826f ("spi: st: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()")

Signed-off-by: Raphael Gallais-Pou <rgallaispou@gmail.com>
---
 drivers/spi/spi-st-ssc4.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/spi-st-ssc4.c b/drivers/spi/spi-st-ssc4.c
index 49ab4c515156..c07c61dc4938 100644
--- a/drivers/spi/spi-st-ssc4.c
+++ b/drivers/spi/spi-st-ssc4.c
@@ -378,7 +378,7 @@ static void spi_st_remove(struct platform_device *pdev)
 	pinctrl_pm_select_sleep_state(&pdev->dev);
 }
 
-static int __maybe_unused spi_st_runtime_suspend(struct device *dev)
+static int spi_st_runtime_suspend(struct device *dev)
 {
 	struct spi_controller *host = dev_get_drvdata(dev);
 	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)
 	return 0;
 }
 
-static int __maybe_unused spi_st_runtime_resume(struct device *dev)
+static int spi_st_runtime_resume(struct device *dev)
 {
 	struct spi_controller *host = dev_get_drvdata(dev);
 	struct spi_st *spi_st = spi_controller_get_devdata(host);
@@ -428,8 +428,8 @@ static int __maybe_unused spi_st_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops spi_st_pm = {
-	SET_SYSTEM_SLEEP_PM_OPS(spi_st_suspend, spi_st_resume)
-	SET_RUNTIME_PM_OPS(spi_st_runtime_suspend, spi_st_runtime_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(spi_st_suspend, spi_st_resume)
+	RUNTIME_PM_OPS(spi_st_runtime_suspend, spi_st_runtime_resume, NULL)
 };
 
 static const struct of_device_id stm_spi_match[] = {
@@ -441,7 +441,7 @@ MODULE_DEVICE_TABLE(of, stm_spi_match);
 static struct platform_driver spi_st_driver = {
 	.driver = {
 		.name = "spi-st",
-		.pm = pm_sleep_ptr(&spi_st_pm),
+		.pm = pm_ptr(&spi_st_pm),
 		.of_match_table = of_match_ptr(stm_spi_match),
 	},
 	.probe = spi_st_probe,
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] spi: st: fix PM macros to use CONFIG_PM instead of CONFIG_PM_SLEEP
  2025-08-20 18:03 [PATCH] spi: st: fix PM macros to use CONFIG_PM instead of CONFIG_PM_SLEEP Raphael Gallais-Pou
@ 2025-08-21  7:29 ` Geert Uytterhoeven
  2025-08-21 18:25 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2025-08-21  7:29 UTC (permalink / raw)
  To: Raphael Gallais-Pou; +Cc: Mark Brown, linux-spi, linux-kernel

On Wed, 20 Aug 2025 at 20:03, Raphael Gallais-Pou <rgallaispou@gmail.com> wrote:
> 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: 6f8584a4826f ("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>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] spi: st: fix PM macros to use CONFIG_PM instead of CONFIG_PM_SLEEP
  2025-08-20 18:03 [PATCH] spi: st: fix PM macros to use CONFIG_PM instead of CONFIG_PM_SLEEP Raphael Gallais-Pou
  2025-08-21  7:29 ` Geert Uytterhoeven
@ 2025-08-21 18:25 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2025-08-21 18:25 UTC (permalink / raw)
  To: Geert Uytterhoeven, Raphael Gallais-Pou; +Cc: linux-spi, linux-kernel

On Wed, 20 Aug 2025 20:03:10 +0200, Raphael Gallais-Pou wrote:
> 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.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: st: fix PM macros to use CONFIG_PM instead of CONFIG_PM_SLEEP
      commit: 7c7cda81159b1abe7d50bcef2ccc6f662e225c8b

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-21 18:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-20 18:03 [PATCH] spi: st: fix PM macros to use CONFIG_PM instead of CONFIG_PM_SLEEP Raphael Gallais-Pou
2025-08-21  7:29 ` Geert Uytterhoeven
2025-08-21 18:25 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).