Skip to content

Commit ba4de5d

Browse files
jic23dtor
authored andcommitted
Input: gpio-keys - 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 __maybe_unused markings. Signed-off-by: Jonathan Cameron <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 64bc273 commit ba4de5d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/input/keyboard/gpio_keys.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ gpio_keys_disable_wakeup(struct gpio_keys_drvdata *ddata)
992992
}
993993
}
994994

995-
static int __maybe_unused gpio_keys_suspend(struct device *dev)
995+
static int gpio_keys_suspend(struct device *dev)
996996
{
997997
struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev);
998998
struct input_dev *input = ddata->input;
@@ -1012,7 +1012,7 @@ static int __maybe_unused gpio_keys_suspend(struct device *dev)
10121012
return 0;
10131013
}
10141014

1015-
static int __maybe_unused gpio_keys_resume(struct device *dev)
1015+
static int gpio_keys_resume(struct device *dev)
10161016
{
10171017
struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev);
10181018
struct input_dev *input = ddata->input;
@@ -1034,7 +1034,7 @@ static int __maybe_unused gpio_keys_resume(struct device *dev)
10341034
return 0;
10351035
}
10361036

1037-
static SIMPLE_DEV_PM_OPS(gpio_keys_pm_ops, gpio_keys_suspend, gpio_keys_resume);
1037+
static DEFINE_SIMPLE_DEV_PM_OPS(gpio_keys_pm_ops, gpio_keys_suspend, gpio_keys_resume);
10381038

10391039
static void gpio_keys_shutdown(struct platform_device *pdev)
10401040
{
@@ -1050,7 +1050,7 @@ static struct platform_driver gpio_keys_device_driver = {
10501050
.shutdown = gpio_keys_shutdown,
10511051
.driver = {
10521052
.name = "gpio-keys",
1053-
.pm = &gpio_keys_pm_ops,
1053+
.pm = pm_sleep_ptr(&gpio_keys_pm_ops),
10541054
.of_match_table = gpio_keys_of_match,
10551055
.dev_groups = gpio_keys_groups,
10561056
}

0 commit comments

Comments
 (0)