Skip to content

Commit 03ea337

Browse files
jic23dtor
authored andcommitted
Input: tm2-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 1844c79 commit 03ea337

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/input/keyboard/tm2-touchkey.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ static int tm2_touchkey_probe(struct i2c_client *client)
297297
return 0;
298298
}
299299

300-
static int __maybe_unused tm2_touchkey_suspend(struct device *dev)
300+
static int tm2_touchkey_suspend(struct device *dev)
301301
{
302302
struct i2c_client *client = to_i2c_client(dev);
303303
struct tm2_touchkey_data *touchkey = i2c_get_clientdata(client);
@@ -308,7 +308,7 @@ static int __maybe_unused tm2_touchkey_suspend(struct device *dev)
308308
return 0;
309309
}
310310

311-
static int __maybe_unused tm2_touchkey_resume(struct device *dev)
311+
static int tm2_touchkey_resume(struct device *dev)
312312
{
313313
struct i2c_client *client = to_i2c_client(dev);
314314
struct tm2_touchkey_data *touchkey = i2c_get_clientdata(client);
@@ -323,8 +323,8 @@ static int __maybe_unused tm2_touchkey_resume(struct device *dev)
323323
return ret;
324324
}
325325

326-
static SIMPLE_DEV_PM_OPS(tm2_touchkey_pm_ops,
327-
tm2_touchkey_suspend, tm2_touchkey_resume);
326+
static DEFINE_SIMPLE_DEV_PM_OPS(tm2_touchkey_pm_ops,
327+
tm2_touchkey_suspend, tm2_touchkey_resume);
328328

329329
static const struct i2c_device_id tm2_touchkey_id_table[] = {
330330
{ TM2_TOUCHKEY_DEV_NAME, 0 },
@@ -353,7 +353,7 @@ MODULE_DEVICE_TABLE(of, tm2_touchkey_of_match);
353353
static struct i2c_driver tm2_touchkey_driver = {
354354
.driver = {
355355
.name = TM2_TOUCHKEY_DEV_NAME,
356-
.pm = &tm2_touchkey_pm_ops,
356+
.pm = pm_sleep_ptr(&tm2_touchkey_pm_ops),
357357
.of_match_table = of_match_ptr(tm2_touchkey_of_match),
358358
},
359359
.probe_new = tm2_touchkey_probe,

0 commit comments

Comments
 (0)