Skip to content

Commit bad0193

Browse files
jic23dtor
authored andcommitted
Input: lpc32xx-keys - 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 d0774bc commit bad0193

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/input/keyboard/lpc32xx-keys.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ static int lpc32xx_kscan_probe(struct platform_device *pdev)
264264
return 0;
265265
}
266266

267-
#ifdef CONFIG_PM_SLEEP
268267
static int lpc32xx_kscan_suspend(struct device *dev)
269268
{
270269
struct platform_device *pdev = to_platform_device(dev);
@@ -302,10 +301,9 @@ static int lpc32xx_kscan_resume(struct device *dev)
302301
mutex_unlock(&input->mutex);
303302
return retval;
304303
}
305-
#endif
306304

307-
static SIMPLE_DEV_PM_OPS(lpc32xx_kscan_pm_ops, lpc32xx_kscan_suspend,
308-
lpc32xx_kscan_resume);
305+
static DEFINE_SIMPLE_DEV_PM_OPS(lpc32xx_kscan_pm_ops, lpc32xx_kscan_suspend,
306+
lpc32xx_kscan_resume);
309307

310308
static const struct of_device_id lpc32xx_kscan_match[] = {
311309
{ .compatible = "nxp,lpc3220-key" },
@@ -317,7 +315,7 @@ static struct platform_driver lpc32xx_kscan_driver = {
317315
.probe = lpc32xx_kscan_probe,
318316
.driver = {
319317
.name = DRV_NAME,
320-
.pm = &lpc32xx_kscan_pm_ops,
318+
.pm = pm_sleep_ptr(&lpc32xx_kscan_pm_ops),
321319
.of_match_table = lpc32xx_kscan_match,
322320
}
323321
};

0 commit comments

Comments
 (0)