Skip to content

Commit e04a088

Browse files
jic23dtor
authored andcommitted
Input: axp20x-pek - switch to SYSTEM_SLEEP_PM_OPS() and pm_sleep_ptr()
SET_SYSTEM_SLEEP_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and SYSTEM_SLEEP_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Here the additional .resume_noirq callback is protected with pm_sleep_ptr(). This isn't strictly necessary but is done for consistency with the other callbacks. Signed-off-by: Jonathan Cameron <[email protected]> Cc: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 28bbeca commit e04a088

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/input/misc/axp20x-pek.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ static int axp20x_pek_probe(struct platform_device *pdev)
336336
return 0;
337337
}
338338

339-
static int __maybe_unused axp20x_pek_suspend(struct device *dev)
339+
static int axp20x_pek_suspend(struct device *dev)
340340
{
341341
struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev);
342342

@@ -355,7 +355,7 @@ static int __maybe_unused axp20x_pek_suspend(struct device *dev)
355355
return 0;
356356
}
357357

358-
static int __maybe_unused axp20x_pek_resume(struct device *dev)
358+
static int axp20x_pek_resume(struct device *dev)
359359
{
360360
struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev);
361361

@@ -389,10 +389,8 @@ static int __maybe_unused axp20x_pek_resume_noirq(struct device *dev)
389389
}
390390

391391
static const struct dev_pm_ops axp20x_pek_pm_ops = {
392-
SET_SYSTEM_SLEEP_PM_OPS(axp20x_pek_suspend, axp20x_pek_resume)
393-
#ifdef CONFIG_PM_SLEEP
394-
.resume_noirq = axp20x_pek_resume_noirq,
395-
#endif
392+
SYSTEM_SLEEP_PM_OPS(axp20x_pek_suspend, axp20x_pek_resume)
393+
.resume_noirq = pm_sleep_ptr(axp20x_pek_resume_noirq),
396394
};
397395

398396
static const struct platform_device_id axp_pek_id_match[] = {
@@ -413,7 +411,7 @@ static struct platform_driver axp20x_pek_driver = {
413411
.id_table = axp_pek_id_match,
414412
.driver = {
415413
.name = "axp20x-pek",
416-
.pm = &axp20x_pek_pm_ops,
414+
.pm = pm_sleep_ptr(&axp20x_pek_pm_ops),
417415
.dev_groups = axp20x_groups,
418416
},
419417
};

0 commit comments

Comments
 (0)