Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20221204180841.2211588-26-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Jonathan Cameron and committed by
Dmitry Torokhov
bf7aa12b eeeeb51b

+3 -5
+3 -5
drivers/input/keyboard/tca6416-keypad.c
··· 320 320 kfree(chip); 321 321 } 322 322 323 - #ifdef CONFIG_PM_SLEEP 324 323 static int tca6416_keypad_suspend(struct device *dev) 325 324 { 326 325 struct i2c_client *client = to_i2c_client(dev); ··· 341 342 342 343 return 0; 343 344 } 344 - #endif 345 345 346 - static SIMPLE_DEV_PM_OPS(tca6416_keypad_dev_pm_ops, 347 - tca6416_keypad_suspend, tca6416_keypad_resume); 346 + static DEFINE_SIMPLE_DEV_PM_OPS(tca6416_keypad_dev_pm_ops, 347 + tca6416_keypad_suspend, tca6416_keypad_resume); 348 348 349 349 static struct i2c_driver tca6416_keypad_driver = { 350 350 .driver = { 351 351 .name = "tca6416-keypad", 352 - .pm = &tca6416_keypad_dev_pm_ops, 352 + .pm = pm_sleep_ptr(&tca6416_keypad_dev_pm_ops), 353 353 }, 354 354 .probe_new = tca6416_keypad_probe, 355 355 .remove = tca6416_keypad_remove,