Skip to content

Commit ca219cf

Browse files
jic23dtor
authored andcommitted
Input: cros-ec-keyb - 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 __maybe_unused markings. Signed-off-by: Jonathan Cameron <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 32a97d3 commit ca219cf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/input/keyboard/cros_ec_keyb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ static int cros_ec_keyb_query_switches(struct cros_ec_keyb *ckdev)
415415
*
416416
* Returns 0 if no error or -error upon error.
417417
*/
418-
static __maybe_unused int cros_ec_keyb_resume(struct device *dev)
418+
static int cros_ec_keyb_resume(struct device *dev)
419419
{
420420
struct cros_ec_keyb *ckdev = dev_get_drvdata(dev);
421421

@@ -760,7 +760,7 @@ static const struct of_device_id cros_ec_keyb_of_match[] = {
760760
MODULE_DEVICE_TABLE(of, cros_ec_keyb_of_match);
761761
#endif
762762

763-
static SIMPLE_DEV_PM_OPS(cros_ec_keyb_pm_ops, NULL, cros_ec_keyb_resume);
763+
static DEFINE_SIMPLE_DEV_PM_OPS(cros_ec_keyb_pm_ops, NULL, cros_ec_keyb_resume);
764764

765765
static struct platform_driver cros_ec_keyb_driver = {
766766
.probe = cros_ec_keyb_probe,
@@ -769,7 +769,7 @@ static struct platform_driver cros_ec_keyb_driver = {
769769
.name = "cros-ec-keyb",
770770
.of_match_table = of_match_ptr(cros_ec_keyb_of_match),
771771
.acpi_match_table = ACPI_PTR(cros_ec_keyb_acpi_match),
772-
.pm = &cros_ec_keyb_pm_ops,
772+
.pm = pm_sleep_ptr(&cros_ec_keyb_pm_ops),
773773
},
774774
};
775775

0 commit comments

Comments
 (0)