Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20221204180841.2211588-23-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Jonathan Cameron and committed by
Dmitry Torokhov
aebc2380 9254ed3f

+3 -5
+3 -5
drivers/input/keyboard/sh_keysc.c
··· 283 283 return 0; 284 284 } 285 285 286 - #ifdef CONFIG_PM_SLEEP 287 286 static int sh_keysc_suspend(struct device *dev) 288 287 { 289 288 struct platform_device *pdev = to_platform_device(dev); ··· 315 316 316 317 return 0; 317 318 } 318 - #endif 319 319 320 - static SIMPLE_DEV_PM_OPS(sh_keysc_dev_pm_ops, 321 - sh_keysc_suspend, sh_keysc_resume); 320 + static DEFINE_SIMPLE_DEV_PM_OPS(sh_keysc_dev_pm_ops, 321 + sh_keysc_suspend, sh_keysc_resume); 322 322 323 323 static struct platform_driver sh_keysc_device_driver = { 324 324 .probe = sh_keysc_probe, 325 325 .remove = sh_keysc_remove, 326 326 .driver = { 327 327 .name = "sh_keysc", 328 - .pm = &sh_keysc_dev_pm_ops, 328 + .pm = pm_sleep_ptr(&sh_keysc_dev_pm_ops), 329 329 } 330 330 }; 331 331 module_platform_driver(sh_keysc_device_driver);