Skip to content

Commit baa0e23

Browse files
jic23dtor
authored andcommitted
Input: nomadik-ske-keypad - 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]> Acked-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 6b94d7b commit baa0e23

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/input/keyboard/nomadik-ske-keypad.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,6 @@ static int ske_keypad_remove(struct platform_device *pdev)
388388
return 0;
389389
}
390390

391-
#ifdef CONFIG_PM_SLEEP
392391
static int ske_keypad_suspend(struct device *dev)
393392
{
394393
struct platform_device *pdev = to_platform_device(dev);
@@ -416,15 +415,14 @@ static int ske_keypad_resume(struct device *dev)
416415

417416
return 0;
418417
}
419-
#endif
420418

421-
static SIMPLE_DEV_PM_OPS(ske_keypad_dev_pm_ops,
422-
ske_keypad_suspend, ske_keypad_resume);
419+
static DEFINE_SIMPLE_DEV_PM_OPS(ske_keypad_dev_pm_ops,
420+
ske_keypad_suspend, ske_keypad_resume);
423421

424422
static struct platform_driver ske_keypad_driver = {
425423
.driver = {
426424
.name = "nmk-ske-keypad",
427-
.pm = &ske_keypad_dev_pm_ops,
425+
.pm = pm_sleep_ptr(&ske_keypad_dev_pm_ops),
428426
},
429427
.remove = ske_keypad_remove,
430428
};

0 commit comments

Comments
 (0)