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

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

authored by

Jonathan Cameron and committed by
Dmitry Torokhov
bb467888 baa0e23f

+3 -5
+3 -5
drivers/input/keyboard/pmic8xxx-keypad.c
··· 621 621 return 0; 622 622 } 623 623 624 - #ifdef CONFIG_PM_SLEEP 625 624 static int pmic8xxx_kp_suspend(struct device *dev) 626 625 { 627 626 struct platform_device *pdev = to_platform_device(dev); ··· 660 661 661 662 return 0; 662 663 } 663 - #endif 664 664 665 - static SIMPLE_DEV_PM_OPS(pm8xxx_kp_pm_ops, 666 - pmic8xxx_kp_suspend, pmic8xxx_kp_resume); 665 + static DEFINE_SIMPLE_DEV_PM_OPS(pm8xxx_kp_pm_ops, 666 + pmic8xxx_kp_suspend, pmic8xxx_kp_resume); 667 667 668 668 static const struct of_device_id pm8xxx_match_table[] = { 669 669 { .compatible = "qcom,pm8058-keypad" }, ··· 675 677 .probe = pmic8xxx_kp_probe, 676 678 .driver = { 677 679 .name = "pm8xxx-keypad", 678 - .pm = &pm8xxx_kp_pm_ops, 680 + .pm = pm_sleep_ptr(&pm8xxx_kp_pm_ops), 679 681 .of_match_table = pm8xxx_match_table, 680 682 }, 681 683 };