diff options
author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2023-01-14 20:16:11 +0300 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2023-01-28 01:49:52 +0300 |
commit | c0a150eee35f9a955cd47a737e97271ec262fd30 (patch) | |
tree | a2d6b186a2562bbdafcf92bbcaebcb159bab008a /drivers/input/misc/ad714x-i2c.c | |
parent | 90208b31f9380c376269bf7f24f4ab1f0e144617 (diff) | |
download | linux-c0a150eee35f9a955cd47a737e97271ec262fd30.tar.xz |
Input: ad714x - unify dev_pm_ops using EXPORT_SIMPLE_DEV_PM_OPS()
The I2C and SPI PM callbacks were identical (though wrapped in some
bouncing out to the bus specific container of the struct device and
then back again to get the drvdata). As such rather than just moving
these to SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() take the opportunity
to unify the struct dev_pm_ops and use the new EXPORT_SIMPLE_DEV_PM_OPS()
macro so that we can drop the unused suspend and resume callbacks as well
as the structure if !CONFIG_PM_SLEEP without needing to mark the callbacks
__maybe_unused.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Link: https://lore.kernel.org/r/20230114171620.42891-8-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/misc/ad714x-i2c.c')
-rw-r--r-- | drivers/input/misc/ad714x-i2c.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/input/misc/ad714x-i2c.c b/drivers/input/misc/ad714x-i2c.c index 5ef518a50e63..d8e39f4a57ac 100644 --- a/drivers/input/misc/ad714x-i2c.c +++ b/drivers/input/misc/ad714x-i2c.c @@ -12,18 +12,6 @@ #include <linux/pm.h> #include "ad714x.h" -static int __maybe_unused ad714x_i2c_suspend(struct device *dev) -{ - return ad714x_disable(i2c_get_clientdata(to_i2c_client(dev))); -} - -static int __maybe_unused ad714x_i2c_resume(struct device *dev) -{ - return ad714x_enable(i2c_get_clientdata(to_i2c_client(dev))); -} - -static SIMPLE_DEV_PM_OPS(ad714x_i2c_pm, ad714x_i2c_suspend, ad714x_i2c_resume); - static int ad714x_i2c_write(struct ad714x_chip *chip, unsigned short reg, unsigned short data) { @@ -96,7 +84,7 @@ MODULE_DEVICE_TABLE(i2c, ad714x_id); static struct i2c_driver ad714x_i2c_driver = { .driver = { .name = "ad714x_captouch", - .pm = &ad714x_i2c_pm, + .pm = pm_sleep_ptr(&ad714x_pm), }, .probe_new = ad714x_i2c_probe, .id_table = ad714x_id, |