Skip to content

Commit bb46788

Browse files
jic23dtor
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent baa0e23 commit bb46788

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/input/keyboard/pmic8xxx-keypad.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,6 @@ static int pmic8xxx_kp_probe(struct platform_device *pdev)
621621
return 0;
622622
}
623623

624-
#ifdef CONFIG_PM_SLEEP
625624
static int pmic8xxx_kp_suspend(struct device *dev)
626625
{
627626
struct platform_device *pdev = to_platform_device(dev);
@@ -661,10 +660,9 @@ static int pmic8xxx_kp_resume(struct device *dev)
661660

662661
return 0;
663662
}
664-
#endif
665663

666-
static SIMPLE_DEV_PM_OPS(pm8xxx_kp_pm_ops,
667-
pmic8xxx_kp_suspend, pmic8xxx_kp_resume);
664+
static DEFINE_SIMPLE_DEV_PM_OPS(pm8xxx_kp_pm_ops,
665+
pmic8xxx_kp_suspend, pmic8xxx_kp_resume);
668666

669667
static const struct of_device_id pm8xxx_match_table[] = {
670668
{ .compatible = "qcom,pm8058-keypad" },
@@ -677,7 +675,7 @@ static struct platform_driver pmic8xxx_kp_driver = {
677675
.probe = pmic8xxx_kp_probe,
678676
.driver = {
679677
.name = "pm8xxx-keypad",
680-
.pm = &pm8xxx_kp_pm_ops,
678+
.pm = pm_sleep_ptr(&pm8xxx_kp_pm_ops),
681679
.of_match_table = pm8xxx_match_table,
682680
},
683681
};

0 commit comments

Comments
 (0)