aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2022-12-22 17:30:48 +0000
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-12-28 17:29:20 +0000
commita03506b35eb84a53132d9c16d990e8a01bcdb502 (patch)
tree24192f78941a32585707f5089f522ef10cb6da24
parent34cb6bdedf4ff0ad86cb31155001b77cdc41bc6d (diff)
downloadiio-a03506b35eb84a53132d9c16d990e8a01bcdb502.tar.gz
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 <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/input/keyboard/samsung-keypad.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c
index df0258dcf89e0..09e883ea13520 100644
--- a/drivers/input/keyboard/samsung-keypad.c
+++ b/drivers/input/keyboard/samsung-keypad.c
@@ -458,7 +458,6 @@ static int samsung_keypad_remove(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM
static int samsung_keypad_runtime_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
@@ -503,9 +502,7 @@ static int samsung_keypad_runtime_resume(struct device *dev)
return 0;
}
-#endif
-#ifdef CONFIG_PM_SLEEP
static void samsung_keypad_toggle_wakeup(struct samsung_keypad *keypad,
bool enable)
{
@@ -563,12 +560,11 @@ static int samsung_keypad_resume(struct device *dev)
return 0;
}
-#endif
static const struct dev_pm_ops samsung_keypad_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(samsung_keypad_suspend, samsung_keypad_resume)
- SET_RUNTIME_PM_OPS(samsung_keypad_runtime_suspend,
- samsung_keypad_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(samsung_keypad_suspend, samsung_keypad_resume)
+ RUNTIME_PM_OPS(samsung_keypad_runtime_suspend,
+ samsung_keypad_runtime_resume, NULL)
};
#ifdef CONFIG_OF
@@ -598,7 +594,7 @@ static struct platform_driver samsung_keypad_driver = {
.driver = {
.name = "samsung-keypad",
.of_match_table = of_match_ptr(samsung_keypad_dt_match),
- .pm = &samsung_keypad_pm_ops,
+ .pm = pm_ptr(&samsung_keypad_pm_ops),
},
.id_table = samsung_keypad_driver_ids,
};