counter: stm32-timer-cnt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Subsystems (4)
PATCH 1/1 counter: stm32-timer-cnt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
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 <[email protected]>
--- drivers/counter/stm32-timer-cnt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/counter/stm32-timer-cnt.c +4 -4
@@ -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);
Signature · 1 line
2.53.0