Skip to content

Commit b946156

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

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/input/keyboard/max7359_keypad.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ static int max7359_probe(struct i2c_client *client)
242242
return 0;
243243
}
244244

245-
#ifdef CONFIG_PM_SLEEP
246245
static int max7359_suspend(struct device *dev)
247246
{
248247
struct i2c_client *client = to_i2c_client(dev);
@@ -267,9 +266,8 @@ static int max7359_resume(struct device *dev)
267266

268267
return 0;
269268
}
270-
#endif
271269

272-
static SIMPLE_DEV_PM_OPS(max7359_pm, max7359_suspend, max7359_resume);
270+
static DEFINE_SIMPLE_DEV_PM_OPS(max7359_pm, max7359_suspend, max7359_resume);
273271

274272
static const struct i2c_device_id max7359_ids[] = {
275273
{ "max7359", 0 },
@@ -280,7 +278,7 @@ MODULE_DEVICE_TABLE(i2c, max7359_ids);
280278
static struct i2c_driver max7359_i2c_driver = {
281279
.driver = {
282280
.name = "max7359",
283-
.pm = &max7359_pm,
281+
.pm = pm_sleep_ptr(&max7359_pm),
284282
},
285283
.probe_new = max7359_probe,
286284
.id_table = max7359_ids,

0 commit comments

Comments
 (0)