Skip to content

Commit 9254ed3

Browse files
jic23dtor
authored andcommitted
Input: qt1070 - 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 a4b4fa5 commit 9254ed3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/input/keyboard/qt1070.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ static void qt1070_remove(struct i2c_client *client)
226226
kfree(data);
227227
}
228228

229-
#ifdef CONFIG_PM_SLEEP
230229
static int qt1070_suspend(struct device *dev)
231230
{
232231
struct i2c_client *client = to_i2c_client(dev);
@@ -248,9 +247,8 @@ static int qt1070_resume(struct device *dev)
248247

249248
return 0;
250249
}
251-
#endif
252250

253-
static SIMPLE_DEV_PM_OPS(qt1070_pm_ops, qt1070_suspend, qt1070_resume);
251+
static DEFINE_SIMPLE_DEV_PM_OPS(qt1070_pm_ops, qt1070_suspend, qt1070_resume);
254252

255253
static const struct i2c_device_id qt1070_id[] = {
256254
{ "qt1070", 0 },
@@ -270,7 +268,7 @@ static struct i2c_driver qt1070_driver = {
270268
.driver = {
271269
.name = "qt1070",
272270
.of_match_table = of_match_ptr(qt1070_of_match),
273-
.pm = &qt1070_pm_ops,
271+
.pm = pm_sleep_ptr(&qt1070_pm_ops),
274272
},
275273
.id_table = qt1070_id,
276274
.probe_new = qt1070_probe,

0 commit comments

Comments
 (0)