Skip to content

Commit 8362cb5

Browse files
jic23dtor
authored andcommitted
Input: mpr121-touchkey - 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 8c1f3b2 commit 8362cb5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/input/keyboard/mpr121_touchkey.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ static int mpr_touchkey_probe(struct i2c_client *client)
340340
return 0;
341341
}
342342

343-
static int __maybe_unused mpr_suspend(struct device *dev)
343+
static int mpr_suspend(struct device *dev)
344344
{
345345
struct i2c_client *client = to_i2c_client(dev);
346346

@@ -352,7 +352,7 @@ static int __maybe_unused mpr_suspend(struct device *dev)
352352
return 0;
353353
}
354354

355-
static int __maybe_unused mpr_resume(struct device *dev)
355+
static int mpr_resume(struct device *dev)
356356
{
357357
struct i2c_client *client = to_i2c_client(dev);
358358
struct mpr121_touchkey *mpr121 = i2c_get_clientdata(client);
@@ -366,7 +366,7 @@ static int __maybe_unused mpr_resume(struct device *dev)
366366
return 0;
367367
}
368368

369-
static SIMPLE_DEV_PM_OPS(mpr121_touchkey_pm_ops, mpr_suspend, mpr_resume);
369+
static DEFINE_SIMPLE_DEV_PM_OPS(mpr121_touchkey_pm_ops, mpr_suspend, mpr_resume);
370370

371371
static const struct i2c_device_id mpr121_id[] = {
372372
{ "mpr121_touchkey", 0 },
@@ -385,7 +385,7 @@ MODULE_DEVICE_TABLE(of, mpr121_touchkey_dt_match_table);
385385
static struct i2c_driver mpr_touchkey_driver = {
386386
.driver = {
387387
.name = "mpr121",
388-
.pm = &mpr121_touchkey_pm_ops,
388+
.pm = pm_sleep_ptr(&mpr121_touchkey_pm_ops),
389389
.of_match_table = of_match_ptr(mpr121_touchkey_dt_match_table),
390390
},
391391
.id_table = mpr121_id,

0 commit comments

Comments
 (0)