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

Input: tc3589x - 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-25-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Jonathan Cameron and committed by
Dmitry Torokhov
eeeeb51b a473a763

+3 -5
+3 -5
drivers/input/keyboard/tc3589x-keypad.c
··· 455 455 return 0; 456 456 } 457 457 458 - #ifdef CONFIG_PM_SLEEP 459 458 static int tc3589x_keypad_suspend(struct device *dev) 460 459 { 461 460 struct platform_device *pdev = to_platform_device(dev); ··· 491 492 492 493 return 0; 493 494 } 494 - #endif 495 495 496 - static SIMPLE_DEV_PM_OPS(tc3589x_keypad_dev_pm_ops, 497 - tc3589x_keypad_suspend, tc3589x_keypad_resume); 496 + static DEFINE_SIMPLE_DEV_PM_OPS(tc3589x_keypad_dev_pm_ops, 497 + tc3589x_keypad_suspend, tc3589x_keypad_resume); 498 498 499 499 static struct platform_driver tc3589x_keypad_driver = { 500 500 .driver = { 501 501 .name = "tc3589x-keypad", 502 - .pm = &tc3589x_keypad_dev_pm_ops, 502 + .pm = pm_sleep_ptr(&tc3589x_keypad_dev_pm_ops), 503 503 }, 504 504 .probe = tc3589x_keypad_probe, 505 505 };