diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-05-03 06:54:51 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-15 07:38:43 -0300 |
commit | 5cbd28df305ab29b7e43bd8e901e7824f7ed9417 (patch) | |
tree | 05c23fd60b58bd46fa20d97f3fdd9344f9d1caf8 /drivers/media/video/msp3400-driver.c | |
parent | b18900080387808b7fb5b5374192e305fb216257 (diff) |
[media] Convert I2C drivers to dev_pm_ops
The legacy I2C PM functions have been deprecated and warning on boot
for over a year, convert the drivers still using them to dev_pm_ops.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/msp3400-driver.c')
-rw-r--r-- | drivers/media/video/msp3400-driver.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c index 82ce50721de3..aeb22be7dcbd 100644 --- a/drivers/media/video/msp3400-driver.c +++ b/drivers/media/video/msp3400-driver.c @@ -597,19 +597,23 @@ static int msp_log_status(struct v4l2_subdev *sd) return 0; } -static int msp_suspend(struct i2c_client *client, pm_message_t state) +#ifdef CONFIG_PM_SLEEP +static int msp_suspend(struct device *dev) { + struct i2c_client *client = to_i2c_client(dev); v4l_dbg(1, msp_debug, client, "suspend\n"); msp_reset(client); return 0; } -static int msp_resume(struct i2c_client *client) +static int msp_resume(struct device *dev) { + struct i2c_client *client = to_i2c_client(dev); v4l_dbg(1, msp_debug, client, "resume\n"); msp_wake_thread(client); return 0; } +#endif /* ----------------------------------------------------------------------- */ @@ -863,6 +867,10 @@ static int msp_remove(struct i2c_client *client) /* ----------------------------------------------------------------------- */ +static const struct dev_pm_ops msp3400_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(msp_suspend, msp_resume) +}; + static const struct i2c_device_id msp_id[] = { { "msp3400", 0 }, { } @@ -873,11 +881,10 @@ static struct i2c_driver msp_driver = { .driver = { .owner = THIS_MODULE, .name = "msp3400", + .pm = &msp3400_pm_ops, }, .probe = msp_probe, .remove = msp_remove, - .suspend = msp_suspend, - .resume = msp_resume, .id_table = msp_id, }; |