Commit 9254ed3f authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Dmitry Torokhov

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: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20221204180841.2211588-22-jic23@kernel.orgSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent a4b4fa51
...@@ -226,7 +226,6 @@ static void qt1070_remove(struct i2c_client *client) ...@@ -226,7 +226,6 @@ static void qt1070_remove(struct i2c_client *client)
kfree(data); kfree(data);
} }
#ifdef CONFIG_PM_SLEEP
static int qt1070_suspend(struct device *dev) static int qt1070_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
...@@ -248,9 +247,8 @@ static int qt1070_resume(struct device *dev) ...@@ -248,9 +247,8 @@ static int qt1070_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(qt1070_pm_ops, qt1070_suspend, qt1070_resume); static DEFINE_SIMPLE_DEV_PM_OPS(qt1070_pm_ops, qt1070_suspend, qt1070_resume);
static const struct i2c_device_id qt1070_id[] = { static const struct i2c_device_id qt1070_id[] = {
{ "qt1070", 0 }, { "qt1070", 0 },
...@@ -270,7 +268,7 @@ static struct i2c_driver qt1070_driver = { ...@@ -270,7 +268,7 @@ static struct i2c_driver qt1070_driver = {
.driver = { .driver = {
.name = "qt1070", .name = "qt1070",
.of_match_table = of_match_ptr(qt1070_of_match), .of_match_table = of_match_ptr(qt1070_of_match),
.pm = &qt1070_pm_ops, .pm = pm_sleep_ptr(&qt1070_pm_ops),
}, },
.id_table = qt1070_id, .id_table = qt1070_id,
.probe_new = qt1070_probe, .probe_new = qt1070_probe,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment