diff options
author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-12-22 19:45:58 +0000 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-12-28 17:29:23 +0000 |
commit | fa13990a2a1c4f9cdd7f70db7923522428046235 (patch) | |
tree | 458a7c16a07c36049e5e5737bdf9d3ad8f44c3bd | |
parent | 7949b138dffe0c67927263cfcc7dbe2041ee1b8f (diff) | |
download | iio-fa13990a2a1c4f9cdd7f70db7923522428046235.tar.gz |
Input: bu21013_ts - 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 <Jonathan.Cameron@huawei.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/input/touchscreen/bu21013_ts.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/input/touchscreen/bu21013_ts.c b/drivers/input/touchscreen/bu21013_ts.c index 5a4dbd39a3728..c994ab6f4e58b 100644 --- a/drivers/input/touchscreen/bu21013_ts.c +++ b/drivers/input/touchscreen/bu21013_ts.c @@ -560,7 +560,7 @@ static void bu21013_remove(struct i2c_client *client) /* The resources will be freed by devm */ } -static int __maybe_unused bu21013_suspend(struct device *dev) +static int bu21013_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct bu21013_ts *ts = i2c_get_clientdata(client); @@ -575,7 +575,7 @@ static int __maybe_unused bu21013_suspend(struct device *dev) return 0; } -static int __maybe_unused bu21013_resume(struct device *dev) +static int bu21013_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct bu21013_ts *ts = i2c_get_clientdata(client); @@ -604,7 +604,7 @@ static int __maybe_unused bu21013_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(bu21013_dev_pm_ops, bu21013_suspend, bu21013_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(bu21013_dev_pm_ops, bu21013_suspend, bu21013_resume); static const struct i2c_device_id bu21013_id[] = { { DRIVER_TP, 0 }, @@ -615,7 +615,7 @@ MODULE_DEVICE_TABLE(i2c, bu21013_id); static struct i2c_driver bu21013_driver = { .driver = { .name = DRIVER_TP, - .pm = &bu21013_dev_pm_ops, + .pm = pm_sleep_ptr(&bu21013_dev_pm_ops), }, .probe_new = bu21013_probe, .remove = bu21013_remove, |