Skip to content

Commit c51283d

Browse files
jic23dtor
authored andcommitted
Input: samsung-keypad - switch to pm_ptr() and SYSTEM_SLEEP/RUNTIME_PM_OPS()
The SET_ variants are deprecated as they require explicit protection against unused function warnings. The new combination of pm_ptr() and SYSTEM_SLEEP/RUNTIME_DEV_PM_OPS() allow the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the #ifdef guards. Signed-off-by: Jonathan Cameron <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent e04a088 commit c51283d

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

drivers/input/keyboard/samsung-keypad.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,6 @@ static int samsung_keypad_remove(struct platform_device *pdev)
458458
return 0;
459459
}
460460

461-
#ifdef CONFIG_PM
462461
static int samsung_keypad_runtime_suspend(struct device *dev)
463462
{
464463
struct platform_device *pdev = to_platform_device(dev);
@@ -503,9 +502,7 @@ static int samsung_keypad_runtime_resume(struct device *dev)
503502

504503
return 0;
505504
}
506-
#endif
507505

508-
#ifdef CONFIG_PM_SLEEP
509506
static void samsung_keypad_toggle_wakeup(struct samsung_keypad *keypad,
510507
bool enable)
511508
{
@@ -563,12 +560,11 @@ static int samsung_keypad_resume(struct device *dev)
563560

564561
return 0;
565562
}
566-
#endif
567563

568564
static const struct dev_pm_ops samsung_keypad_pm_ops = {
569-
SET_SYSTEM_SLEEP_PM_OPS(samsung_keypad_suspend, samsung_keypad_resume)
570-
SET_RUNTIME_PM_OPS(samsung_keypad_runtime_suspend,
571-
samsung_keypad_runtime_resume, NULL)
565+
SYSTEM_SLEEP_PM_OPS(samsung_keypad_suspend, samsung_keypad_resume)
566+
RUNTIME_PM_OPS(samsung_keypad_runtime_suspend,
567+
samsung_keypad_runtime_resume, NULL)
572568
};
573569

574570
#ifdef CONFIG_OF
@@ -598,7 +594,7 @@ static struct platform_driver samsung_keypad_driver = {
598594
.driver = {
599595
.name = "samsung-keypad",
600596
.of_match_table = of_match_ptr(samsung_keypad_dt_match),
601-
.pm = &samsung_keypad_pm_ops,
597+
.pm = pm_ptr(&samsung_keypad_pm_ops),
602598
},
603599
.id_table = samsung_keypad_driver_ids,
604600
};

0 commit comments

Comments
 (0)