Skip to content

Commit bf7aa12

Browse files
jic23dtor
authored andcommitted
Input: tca6416-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 ifdef guards. Signed-off-by: Jonathan Cameron <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent eeeeb51 commit bf7aa12

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/input/keyboard/tca6416-keypad.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ static void tca6416_keypad_remove(struct i2c_client *client)
320320
kfree(chip);
321321
}
322322

323-
#ifdef CONFIG_PM_SLEEP
324323
static int tca6416_keypad_suspend(struct device *dev)
325324
{
326325
struct i2c_client *client = to_i2c_client(dev);
@@ -342,15 +341,14 @@ static int tca6416_keypad_resume(struct device *dev)
342341

343342
return 0;
344343
}
345-
#endif
346344

347-
static SIMPLE_DEV_PM_OPS(tca6416_keypad_dev_pm_ops,
348-
tca6416_keypad_suspend, tca6416_keypad_resume);
345+
static DEFINE_SIMPLE_DEV_PM_OPS(tca6416_keypad_dev_pm_ops,
346+
tca6416_keypad_suspend, tca6416_keypad_resume);
349347

350348
static struct i2c_driver tca6416_keypad_driver = {
351349
.driver = {
352350
.name = "tca6416-keypad",
353-
.pm = &tca6416_keypad_dev_pm_ops,
351+
.pm = pm_sleep_ptr(&tca6416_keypad_dev_pm_ops),
354352
},
355353
.probe_new = tca6416_keypad_probe,
356354
.remove = tca6416_keypad_remove,

0 commit comments

Comments
 (0)