Skip to content

Commit d0774bc

Browse files
jic23dtor
authored andcommitted
Input: lm8323 - 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 03ea337 commit d0774bc

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/input/keyboard/lm8323.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,6 @@ static void lm8323_remove(struct i2c_client *client)
770770
kfree(lm);
771771
}
772772

773-
#ifdef CONFIG_PM_SLEEP
774773
/*
775774
* We don't need to explicitly suspend the chip, as it already switches off
776775
* when there's no activity.
@@ -814,9 +813,8 @@ static int lm8323_resume(struct device *dev)
814813

815814
return 0;
816815
}
817-
#endif
818816

819-
static SIMPLE_DEV_PM_OPS(lm8323_pm_ops, lm8323_suspend, lm8323_resume);
817+
static DEFINE_SIMPLE_DEV_PM_OPS(lm8323_pm_ops, lm8323_suspend, lm8323_resume);
820818

821819
static const struct i2c_device_id lm8323_id[] = {
822820
{ "lm8323", 0 },
@@ -826,7 +824,7 @@ static const struct i2c_device_id lm8323_id[] = {
826824
static struct i2c_driver lm8323_i2c_driver = {
827825
.driver = {
828826
.name = "lm8323",
829-
.pm = &lm8323_pm_ops,
827+
.pm = pm_sleep_ptr(&lm8323_pm_ops),
830828
},
831829
.probe_new = lm8323_probe,
832830
.remove = lm8323_remove,

0 commit comments

Comments
 (0)