Skip to content

Commit 1844c79

Browse files
jic23dtor
authored andcommitted
Input: spear-keyboard - 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 ffa5d80 commit 1844c79

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/input/keyboard/spear-keyboard.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ static int spear_kbd_remove(struct platform_device *pdev)
284284
return 0;
285285
}
286286

287-
static int __maybe_unused spear_kbd_suspend(struct device *dev)
287+
static int spear_kbd_suspend(struct device *dev)
288288
{
289289
struct platform_device *pdev = to_platform_device(dev);
290290
struct spear_kbd *kbd = platform_get_drvdata(pdev);
@@ -337,7 +337,7 @@ static int __maybe_unused spear_kbd_suspend(struct device *dev)
337337
return 0;
338338
}
339339

340-
static int __maybe_unused spear_kbd_resume(struct device *dev)
340+
static int spear_kbd_resume(struct device *dev)
341341
{
342342
struct platform_device *pdev = to_platform_device(dev);
343343
struct spear_kbd *kbd = platform_get_drvdata(pdev);
@@ -364,7 +364,8 @@ static int __maybe_unused spear_kbd_resume(struct device *dev)
364364
return 0;
365365
}
366366

367-
static SIMPLE_DEV_PM_OPS(spear_kbd_pm_ops, spear_kbd_suspend, spear_kbd_resume);
367+
static DEFINE_SIMPLE_DEV_PM_OPS(spear_kbd_pm_ops,
368+
spear_kbd_suspend, spear_kbd_resume);
368369

369370
#ifdef CONFIG_OF
370371
static const struct of_device_id spear_kbd_id_table[] = {
@@ -379,7 +380,7 @@ static struct platform_driver spear_kbd_driver = {
379380
.remove = spear_kbd_remove,
380381
.driver = {
381382
.name = "keyboard",
382-
.pm = &spear_kbd_pm_ops,
383+
.pm = pm_sleep_ptr(&spear_kbd_pm_ops),
383384
.of_match_table = of_match_ptr(spear_kbd_id_table),
384385
},
385386
};

0 commit comments

Comments
 (0)