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: samsung-keypad - switch to pm_ptr() and SYSTEM_SLEEP/RUNTIME_PM_OPS()

The SET_ variants are deprecated as they require explicit protection
against unused function warnings. The new combination of pm_ptr()
and SYSTEM_SLEEP/RUNTIME_DEV_PM_OPS() allow 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/20230114171620.42891-4-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Jonathan Cameron and committed by
Dmitry Torokhov
c51283d7 e04a088b

+4 -8
+4 -8
drivers/input/keyboard/samsung-keypad.c
··· 458 458 return 0; 459 459 } 460 460 461 - #ifdef CONFIG_PM 462 461 static int samsung_keypad_runtime_suspend(struct device *dev) 463 462 { 464 463 struct platform_device *pdev = to_platform_device(dev); ··· 502 503 503 504 return 0; 504 505 } 505 - #endif 506 506 507 - #ifdef CONFIG_PM_SLEEP 508 507 static void samsung_keypad_toggle_wakeup(struct samsung_keypad *keypad, 509 508 bool enable) 510 509 { ··· 560 563 561 564 return 0; 562 565 } 563 - #endif 564 566 565 567 static const struct dev_pm_ops samsung_keypad_pm_ops = { 566 - SET_SYSTEM_SLEEP_PM_OPS(samsung_keypad_suspend, samsung_keypad_resume) 567 - SET_RUNTIME_PM_OPS(samsung_keypad_runtime_suspend, 568 - samsung_keypad_runtime_resume, NULL) 568 + SYSTEM_SLEEP_PM_OPS(samsung_keypad_suspend, samsung_keypad_resume) 569 + RUNTIME_PM_OPS(samsung_keypad_runtime_suspend, 570 + samsung_keypad_runtime_resume, NULL) 569 571 }; 570 572 571 573 #ifdef CONFIG_OF ··· 594 598 .driver = { 595 599 .name = "samsung-keypad", 596 600 .of_match_table = of_match_ptr(samsung_keypad_dt_match), 597 - .pm = &samsung_keypad_pm_ops, 601 + .pm = pm_ptr(&samsung_keypad_pm_ops), 598 602 }, 599 603 .id_table = samsung_keypad_driver_ids, 600 604 };