diff options
author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-12-04 19:08:25 +0100 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2022-12-07 22:27:43 +0100 |
commit | b94615650fe66e3e87cb14c5ec2e38b2884d9f37 (patch) | |
tree | 18035ccb8bdea2d2e3dda93046c575a672627458 /drivers/input | |
parent | Input: matrix-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() (diff) | |
download | linux-b94615650fe66e3e87cb14c5ec2e38b2884d9f37.tar.xz linux-b94615650fe66e3e87cb14c5ec2e38b2884d9f37.zip |
Input: max7359-keypad - 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-17-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/keyboard/max7359_keypad.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/input/keyboard/max7359_keypad.c b/drivers/input/keyboard/max7359_keypad.c index 1bba11ed4132..b363749d02e2 100644 --- a/drivers/input/keyboard/max7359_keypad.c +++ b/drivers/input/keyboard/max7359_keypad.c @@ -242,7 +242,6 @@ static int max7359_probe(struct i2c_client *client) return 0; } -#ifdef CONFIG_PM_SLEEP static int max7359_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); @@ -267,9 +266,8 @@ static int max7359_resume(struct device *dev) return 0; } -#endif -static SIMPLE_DEV_PM_OPS(max7359_pm, max7359_suspend, max7359_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(max7359_pm, max7359_suspend, max7359_resume); static const struct i2c_device_id max7359_ids[] = { { "max7359", 0 }, @@ -280,7 +278,7 @@ MODULE_DEVICE_TABLE(i2c, max7359_ids); static struct i2c_driver max7359_i2c_driver = { .driver = { .name = "max7359", - .pm = &max7359_pm, + .pm = pm_sleep_ptr(&max7359_pm), }, .probe_new = max7359_probe, .id_table = max7359_ids, |