Skip to content

Commit 995765e

Browse files
jic23dtor
authored andcommitted
Input: tegra-kbc - 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 bf7aa12 commit 995765e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/input/keyboard/tegra-kbc.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,6 @@ static int tegra_kbc_probe(struct platform_device *pdev)
713713
return 0;
714714
}
715715

716-
#ifdef CONFIG_PM_SLEEP
717716
static void tegra_kbc_set_keypress_interrupt(struct tegra_kbc *kbc, bool enable)
718717
{
719718
u32 val;
@@ -802,15 +801,15 @@ static int tegra_kbc_resume(struct device *dev)
802801

803802
return err;
804803
}
805-
#endif
806804

807-
static SIMPLE_DEV_PM_OPS(tegra_kbc_pm_ops, tegra_kbc_suspend, tegra_kbc_resume);
805+
static DEFINE_SIMPLE_DEV_PM_OPS(tegra_kbc_pm_ops,
806+
tegra_kbc_suspend, tegra_kbc_resume);
808807

809808
static struct platform_driver tegra_kbc_driver = {
810809
.probe = tegra_kbc_probe,
811810
.driver = {
812811
.name = "tegra-kbc",
813-
.pm = &tegra_kbc_pm_ops,
812+
.pm = pm_sleep_ptr(&tegra_kbc_pm_ops),
814813
.of_match_table = tegra_kbc_of_match,
815814
},
816815
};

0 commit comments

Comments
 (0)