All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] counter: stm32-timer-cnt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
@ 2026-08-20  7:13 Triet Hoang
  0 siblings, 0 replies; only message in thread
From: Triet Hoang @ 2026-08-20  7:13 UTC (permalink / raw)
  To: fabrice.gasnier
  Cc: wbg, mcoquelin.stm32, alexandre.torgue, linux-iio, linux-stm32,
	linux-arm-kernel, linux-kernel, Triet Hoang

Convert the deprecated SIMPLE_DEV_PM_OPS
to DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr().

This lets us drop the __maybe_unused annotations from its suspend and
resume callbacks, and reduces kernel size in case CONFIG_PM or
CONFIG_PM_SLEEP is disabled.

Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
---
 drivers/counter/stm32-timer-cnt.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/counter/stm32-timer-cnt.c b/drivers/counter/stm32-timer-cnt.c
index a3d8f7a5874e..3024ec002cc6 100644
--- a/drivers/counter/stm32-timer-cnt.c
+++ b/drivers/counter/stm32-timer-cnt.c
@@ -794,7 +794,7 @@ static int stm32_timer_cnt_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int __maybe_unused stm32_timer_cnt_suspend(struct device *dev)
+static int stm32_timer_cnt_suspend(struct device *dev)
 {
 	struct stm32_timer_cnt *priv = dev_get_drvdata(dev);
 
@@ -814,7 +814,7 @@ static int __maybe_unused stm32_timer_cnt_suspend(struct device *dev)
 	return pinctrl_pm_select_sleep_state(dev);
 }
 
-static int __maybe_unused stm32_timer_cnt_resume(struct device *dev)
+static int stm32_timer_cnt_resume(struct device *dev)
 {
 	struct stm32_timer_cnt *priv = dev_get_drvdata(dev);
 	int ret;
@@ -842,7 +842,7 @@ static int __maybe_unused stm32_timer_cnt_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(stm32_timer_cnt_pm_ops, stm32_timer_cnt_suspend,
+static DEFINE_SIMPLE_DEV_PM_OPS(stm32_timer_cnt_pm_ops, stm32_timer_cnt_suspend,
 			 stm32_timer_cnt_resume);
 
 static const struct of_device_id stm32_timer_cnt_of_match[] = {
@@ -857,7 +857,7 @@ static struct platform_driver stm32_timer_cnt_driver = {
 	.driver = {
 		.name = "stm32-timer-counter",
 		.of_match_table = stm32_timer_cnt_of_match,
-		.pm = &stm32_timer_cnt_pm_ops,
+		.pm = pm_sleep_ptr(&stm32_timer_cnt_pm_ops),
 	},
 };
 module_platform_driver(stm32_timer_cnt_driver);
-- 
2.53.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-20  7:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20  7:13 [PATCH] counter: stm32-timer-cnt: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.