summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/addac/adt7316-i2c.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2012-02-20 18:37:05 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-24 20:11:13 (GMT)
commit01788c533acbd63702146a2be975ae4007cfb2cf (patch)
tree06af3b838bb42e46ad124c1841398c5113f455ae /drivers/staging/iio/addac/adt7316-i2c.c
parent4eeb3335bbfb4e9d6a7995f283deeecb06e07aea (diff)
downloadlinux-fsl-qoriq-01788c533acbd63702146a2be975ae4007cfb2cf.tar.xz
staging:iio: Use dev_pm_ops
Use dev_pm_ops instead of legacy suspend/resume callbacks for IIO drivers. Note that this patch introduces a few new #ifdef CONFIG_PM_SLEEP around the suspend and resume callbacks to avoid warnings of unused functions if CONFIG_PM_SLEEP is not defined. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/iio/addac/adt7316-i2c.c')
-rw-r--r--drivers/staging/iio/addac/adt7316-i2c.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/drivers/staging/iio/addac/adt7316-i2c.c b/drivers/staging/iio/addac/adt7316-i2c.c
index 2c03a39..9e128dd 100644
--- a/drivers/staging/iio/addac/adt7316-i2c.c
+++ b/drivers/staging/iio/addac/adt7316-i2c.c
@@ -125,30 +125,14 @@ static const struct i2c_device_id adt7316_i2c_id[] = {
MODULE_DEVICE_TABLE(i2c, adt7316_i2c_id);
-#ifdef CONFIG_PM
-static int adt7316_i2c_suspend(struct i2c_client *client, pm_message_t message)
-{
- return adt7316_disable(&client->dev);
-}
-
-static int adt7316_i2c_resume(struct i2c_client *client)
-{
- return adt7316_enable(&client->dev);
-}
-#else
-# define adt7316_i2c_suspend NULL
-# define adt7316_i2c_resume NULL
-#endif
-
static struct i2c_driver adt7316_driver = {
.driver = {
.name = "adt7316",
+ .pm = ADT7316_PM_OPS,
.owner = THIS_MODULE,
},
.probe = adt7316_i2c_probe,
.remove = __devexit_p(adt7316_i2c_remove),
- .suspend = adt7316_i2c_suspend,
- .resume = adt7316_i2c_resume,
.id_table = adt7316_i2c_id,
};
module_i2c_driver(adt7316_driver);