Skip to content

Commit a4b4fa5

Browse files
jic23dtor
authored andcommitted
Input: pxa27x_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]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent bb46788 commit a4b4fa5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/input/keyboard/pxa27x_keypad.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,6 @@ static void pxa27x_keypad_close(struct input_dev *dev)
660660
clk_disable_unprepare(keypad->clk);
661661
}
662662

663-
#ifdef CONFIG_PM_SLEEP
664663
static int pxa27x_keypad_suspend(struct device *dev)
665664
{
666665
struct platform_device *pdev = to_platform_device(dev);
@@ -706,10 +705,9 @@ static int pxa27x_keypad_resume(struct device *dev)
706705

707706
return ret;
708707
}
709-
#endif
710708

711-
static SIMPLE_DEV_PM_OPS(pxa27x_keypad_pm_ops,
712-
pxa27x_keypad_suspend, pxa27x_keypad_resume);
709+
static DEFINE_SIMPLE_DEV_PM_OPS(pxa27x_keypad_pm_ops,
710+
pxa27x_keypad_suspend, pxa27x_keypad_resume);
713711

714712

715713
static int pxa27x_keypad_probe(struct platform_device *pdev)
@@ -830,7 +828,7 @@ static struct platform_driver pxa27x_keypad_driver = {
830828
.driver = {
831829
.name = "pxa27x-keypad",
832830
.of_match_table = of_match_ptr(pxa27x_keypad_dt_match),
833-
.pm = &pxa27x_keypad_pm_ops,
831+
.pm = pm_sleep_ptr(&pxa27x_keypad_pm_ops),
834832
},
835833
};
836834
module_platform_driver(pxa27x_keypad_driver);

0 commit comments

Comments
 (0)