Commit c51283d7 authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Dmitry Torokhov

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: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20230114171620.42891-4-jic23@kernel.orgSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent e04a088b
...@@ -458,7 +458,6 @@ static int samsung_keypad_remove(struct platform_device *pdev) ...@@ -458,7 +458,6 @@ static int samsung_keypad_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM
static int samsung_keypad_runtime_suspend(struct device *dev) static int samsung_keypad_runtime_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
...@@ -503,9 +502,7 @@ static int samsung_keypad_runtime_resume(struct device *dev) ...@@ -503,9 +502,7 @@ static int samsung_keypad_runtime_resume(struct device *dev)
return 0; return 0;
} }
#endif
#ifdef CONFIG_PM_SLEEP
static void samsung_keypad_toggle_wakeup(struct samsung_keypad *keypad, static void samsung_keypad_toggle_wakeup(struct samsung_keypad *keypad,
bool enable) bool enable)
{ {
...@@ -563,11 +560,10 @@ static int samsung_keypad_resume(struct device *dev) ...@@ -563,11 +560,10 @@ static int samsung_keypad_resume(struct device *dev)
return 0; return 0;
} }
#endif
static const struct dev_pm_ops samsung_keypad_pm_ops = { static const struct dev_pm_ops samsung_keypad_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(samsung_keypad_suspend, samsung_keypad_resume) SYSTEM_SLEEP_PM_OPS(samsung_keypad_suspend, samsung_keypad_resume)
SET_RUNTIME_PM_OPS(samsung_keypad_runtime_suspend, RUNTIME_PM_OPS(samsung_keypad_runtime_suspend,
samsung_keypad_runtime_resume, NULL) samsung_keypad_runtime_resume, NULL)
}; };
...@@ -598,7 +594,7 @@ static struct platform_driver samsung_keypad_driver = { ...@@ -598,7 +594,7 @@ static struct platform_driver samsung_keypad_driver = {
.driver = { .driver = {
.name = "samsung-keypad", .name = "samsung-keypad",
.of_match_table = of_match_ptr(samsung_keypad_dt_match), .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, .id_table = samsung_keypad_driver_ids,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment