Commit 311fd6b0 authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Dmitry Torokhov

Input: hideep - 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: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Anthony Kim <anthony.kim@hideep.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230102181842.718010-48-jic23@kernel.orgSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 05ebb78b
...@@ -959,7 +959,7 @@ static const struct attribute_group hideep_ts_attr_group = { ...@@ -959,7 +959,7 @@ static const struct attribute_group hideep_ts_attr_group = {
.attrs = hideep_ts_sysfs_entries, .attrs = hideep_ts_sysfs_entries,
}; };
static int __maybe_unused hideep_suspend(struct device *dev) static int hideep_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct hideep_ts *ts = i2c_get_clientdata(client); struct hideep_ts *ts = i2c_get_clientdata(client);
...@@ -970,7 +970,7 @@ static int __maybe_unused hideep_suspend(struct device *dev) ...@@ -970,7 +970,7 @@ static int __maybe_unused hideep_suspend(struct device *dev)
return 0; return 0;
} }
static int __maybe_unused hideep_resume(struct device *dev) static int hideep_resume(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct hideep_ts *ts = i2c_get_clientdata(client); struct hideep_ts *ts = i2c_get_clientdata(client);
...@@ -987,7 +987,7 @@ static int __maybe_unused hideep_resume(struct device *dev) ...@@ -987,7 +987,7 @@ static int __maybe_unused hideep_resume(struct device *dev)
return 0; return 0;
} }
static SIMPLE_DEV_PM_OPS(hideep_pm_ops, hideep_suspend, hideep_resume); static DEFINE_SIMPLE_DEV_PM_OPS(hideep_pm_ops, hideep_suspend, hideep_resume);
static const struct regmap_config hideep_regmap_config = { static const struct regmap_config hideep_regmap_config = {
.reg_bits = 16, .reg_bits = 16,
...@@ -1108,7 +1108,7 @@ static struct i2c_driver hideep_driver = { ...@@ -1108,7 +1108,7 @@ static struct i2c_driver hideep_driver = {
.name = HIDEEP_I2C_NAME, .name = HIDEEP_I2C_NAME,
.of_match_table = of_match_ptr(hideep_match_table), .of_match_table = of_match_ptr(hideep_match_table),
.acpi_match_table = ACPI_PTR(hideep_acpi_id), .acpi_match_table = ACPI_PTR(hideep_acpi_id),
.pm = &hideep_pm_ops, .pm = pm_sleep_ptr(&hideep_pm_ops),
}, },
.id_table = hideep_i2c_id, .id_table = hideep_i2c_id,
.probe_new = hideep_probe, .probe_new = hideep_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