Skip to content

Commit a473a76

Browse files
jic23dtor
authored andcommitted
Input: st-keyscan - 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 aebc238 commit a473a76

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/input/keyboard/st-keyscan.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ static int keyscan_probe(struct platform_device *pdev)
212212
return 0;
213213
}
214214

215-
#ifdef CONFIG_PM_SLEEP
216215
static int keyscan_suspend(struct device *dev)
217216
{
218217
struct platform_device *pdev = to_platform_device(dev);
@@ -247,9 +246,9 @@ static int keyscan_resume(struct device *dev)
247246
mutex_unlock(&input->mutex);
248247
return retval;
249248
}
250-
#endif
251249

252-
static SIMPLE_DEV_PM_OPS(keyscan_dev_pm_ops, keyscan_suspend, keyscan_resume);
250+
static DEFINE_SIMPLE_DEV_PM_OPS(keyscan_dev_pm_ops,
251+
keyscan_suspend, keyscan_resume);
253252

254253
static const struct of_device_id keyscan_of_match[] = {
255254
{ .compatible = "st,sti-keyscan" },
@@ -261,7 +260,7 @@ static struct platform_driver keyscan_device_driver = {
261260
.probe = keyscan_probe,
262261
.driver = {
263262
.name = "st-keyscan",
264-
.pm = &keyscan_dev_pm_ops,
263+
.pm = pm_sleep_ptr(&keyscan_dev_pm_ops),
265264
.of_match_table = of_match_ptr(keyscan_of_match),
266265
}
267266
};

0 commit comments

Comments
 (0)