Skip to content

Commit 32a97d3

Browse files
jic23dtor
authored andcommitted
Input: adp5589-keys - 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]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent f318315 commit 32a97d3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/input/keyboard/adp5589-keys.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ static int adp5589_probe(struct i2c_client *client)
10161016
return 0;
10171017
}
10181018

1019-
static int __maybe_unused adp5589_suspend(struct device *dev)
1019+
static int adp5589_suspend(struct device *dev)
10201020
{
10211021
struct i2c_client *client = to_i2c_client(dev);
10221022
struct adp5589_kpad *kpad = i2c_get_clientdata(client);
@@ -1027,7 +1027,7 @@ static int __maybe_unused adp5589_suspend(struct device *dev)
10271027
return 0;
10281028
}
10291029

1030-
static int __maybe_unused adp5589_resume(struct device *dev)
1030+
static int adp5589_resume(struct device *dev)
10311031
{
10321032
struct i2c_client *client = to_i2c_client(dev);
10331033
struct adp5589_kpad *kpad = i2c_get_clientdata(client);
@@ -1038,7 +1038,7 @@ static int __maybe_unused adp5589_resume(struct device *dev)
10381038
return 0;
10391039
}
10401040

1041-
static SIMPLE_DEV_PM_OPS(adp5589_dev_pm_ops, adp5589_suspend, adp5589_resume);
1041+
static DEFINE_SIMPLE_DEV_PM_OPS(adp5589_dev_pm_ops, adp5589_suspend, adp5589_resume);
10421042

10431043
static const struct i2c_device_id adp5589_id[] = {
10441044
{"adp5589-keys", ADP5589},
@@ -1052,7 +1052,7 @@ MODULE_DEVICE_TABLE(i2c, adp5589_id);
10521052
static struct i2c_driver adp5589_driver = {
10531053
.driver = {
10541054
.name = KBUILD_MODNAME,
1055-
.pm = &adp5589_dev_pm_ops,
1055+
.pm = pm_sleep_ptr(&adp5589_dev_pm_ops),
10561056
},
10571057
.probe_new = adp5589_probe,
10581058
.id_table = adp5589_id,

0 commit comments

Comments
 (0)