Skip to content

Commit 64bc273

Browse files
jic23dtor
authored andcommitted
Input: ep39xx-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 __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 fbfb262 commit 64bc273

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/input/keyboard/ep93xx_keypad.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static void ep93xx_keypad_close(struct input_dev *pdev)
178178
}
179179

180180

181-
static int __maybe_unused ep93xx_keypad_suspend(struct device *dev)
181+
static int ep93xx_keypad_suspend(struct device *dev)
182182
{
183183
struct platform_device *pdev = to_platform_device(dev);
184184
struct ep93xx_keypad *keypad = platform_get_drvdata(pdev);
@@ -196,7 +196,7 @@ static int __maybe_unused ep93xx_keypad_suspend(struct device *dev)
196196
return 0;
197197
}
198198

199-
static int __maybe_unused ep93xx_keypad_resume(struct device *dev)
199+
static int ep93xx_keypad_resume(struct device *dev)
200200
{
201201
struct platform_device *pdev = to_platform_device(dev);
202202
struct ep93xx_keypad *keypad = platform_get_drvdata(pdev);
@@ -217,8 +217,8 @@ static int __maybe_unused ep93xx_keypad_resume(struct device *dev)
217217
return 0;
218218
}
219219

220-
static SIMPLE_DEV_PM_OPS(ep93xx_keypad_pm_ops,
221-
ep93xx_keypad_suspend, ep93xx_keypad_resume);
220+
static DEFINE_SIMPLE_DEV_PM_OPS(ep93xx_keypad_pm_ops,
221+
ep93xx_keypad_suspend, ep93xx_keypad_resume);
222222

223223
static void ep93xx_keypad_release_gpio_action(void *_pdev)
224224
{
@@ -318,7 +318,7 @@ static int ep93xx_keypad_remove(struct platform_device *pdev)
318318
static struct platform_driver ep93xx_keypad_driver = {
319319
.driver = {
320320
.name = "ep93xx-keypad",
321-
.pm = &ep93xx_keypad_pm_ops,
321+
.pm = pm_sleep_ptr(&ep93xx_keypad_pm_ops),
322322
},
323323
.probe = ep93xx_keypad_probe,
324324
.remove = ep93xx_keypad_remove,

0 commit comments

Comments
 (0)