Skip to content

Commit eeeeb51

Browse files
jic23dtor
authored andcommitted
Input: tc3589x - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_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 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 a473a76 commit eeeeb51

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/input/keyboard/tc3589x-keypad.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,6 @@ static int tc3589x_keypad_probe(struct platform_device *pdev)
455455
return 0;
456456
}
457457

458-
#ifdef CONFIG_PM_SLEEP
459458
static int tc3589x_keypad_suspend(struct device *dev)
460459
{
461460
struct platform_device *pdev = to_platform_device(dev);
@@ -492,15 +491,14 @@ static int tc3589x_keypad_resume(struct device *dev)
492491

493492
return 0;
494493
}
495-
#endif
496494

497-
static SIMPLE_DEV_PM_OPS(tc3589x_keypad_dev_pm_ops,
498-
tc3589x_keypad_suspend, tc3589x_keypad_resume);
495+
static DEFINE_SIMPLE_DEV_PM_OPS(tc3589x_keypad_dev_pm_ops,
496+
tc3589x_keypad_suspend, tc3589x_keypad_resume);
499497

500498
static struct platform_driver tc3589x_keypad_driver = {
501499
.driver = {
502500
.name = "tc3589x-keypad",
503-
.pm = &tc3589x_keypad_dev_pm_ops,
501+
.pm = pm_sleep_ptr(&tc3589x_keypad_dev_pm_ops),
504502
},
505503
.probe = tc3589x_keypad_probe,
506504
};

0 commit comments

Comments
 (0)