Skip to content

Commit aebc238

Browse files
jic23dtor
authored andcommitted
Input: sh-keysc - 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 9254ed3 commit aebc238

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/input/keyboard/sh_keysc.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ static int sh_keysc_remove(struct platform_device *pdev)
283283
return 0;
284284
}
285285

286-
#ifdef CONFIG_PM_SLEEP
287286
static int sh_keysc_suspend(struct device *dev)
288287
{
289288
struct platform_device *pdev = to_platform_device(dev);
@@ -316,17 +315,16 @@ static int sh_keysc_resume(struct device *dev)
316315

317316
return 0;
318317
}
319-
#endif
320318

321-
static SIMPLE_DEV_PM_OPS(sh_keysc_dev_pm_ops,
322-
sh_keysc_suspend, sh_keysc_resume);
319+
static DEFINE_SIMPLE_DEV_PM_OPS(sh_keysc_dev_pm_ops,
320+
sh_keysc_suspend, sh_keysc_resume);
323321

324322
static struct platform_driver sh_keysc_device_driver = {
325323
.probe = sh_keysc_probe,
326324
.remove = sh_keysc_remove,
327325
.driver = {
328326
.name = "sh_keysc",
329-
.pm = &sh_keysc_dev_pm_ops,
327+
.pm = pm_sleep_ptr(&sh_keysc_dev_pm_ops),
330328
}
331329
};
332330
module_platform_driver(sh_keysc_device_driver);

0 commit comments

Comments
 (0)