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

authored by

Jonathan Cameron and committed by
Dmitry Torokhov
a473a763 aebc2380

+3 -4
+3 -4
drivers/input/keyboard/st-keyscan.c
··· 212 212 return 0; 213 213 } 214 214 215 - #ifdef CONFIG_PM_SLEEP 216 215 static int keyscan_suspend(struct device *dev) 217 216 { 218 217 struct platform_device *pdev = to_platform_device(dev); ··· 246 247 mutex_unlock(&input->mutex); 247 248 return retval; 248 249 } 249 - #endif 250 250 251 - static SIMPLE_DEV_PM_OPS(keyscan_dev_pm_ops, keyscan_suspend, keyscan_resume); 251 + static DEFINE_SIMPLE_DEV_PM_OPS(keyscan_dev_pm_ops, 252 + keyscan_suspend, keyscan_resume); 252 253 253 254 static const struct of_device_id keyscan_of_match[] = { 254 255 { .compatible = "st,sti-keyscan" }, ··· 260 261 .probe = keyscan_probe, 261 262 .driver = { 262 263 .name = "st-keyscan", 263 - .pm = &keyscan_dev_pm_ops, 264 + .pm = pm_sleep_ptr(&keyscan_dev_pm_ops), 264 265 .of_match_table = of_match_ptr(keyscan_of_match), 265 266 } 266 267 };