From patchwork Thu Mar 22 20:34:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 10454 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1SAoiv-0003CI-4R for patchwork@linuxtv.org; Thu, 22 Mar 2012 21:35:05 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtp for id 1SAoiu-0007Rc-B3; Thu, 22 Mar 2012 21:35:05 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030841Ab2CVUfA (ORCPT ); Thu, 22 Mar 2012 16:35:00 -0400 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:53148 "EHLO opensource.wolfsonmicro.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932383Ab2CVUe5 (ORCPT ); Thu, 22 Mar 2012 16:34:57 -0400 Received: from finisterre.wolfsonmicro.main (unknown [87.246.78.26]) by opensource.wolfsonmicro.com (Postfix) with ESMTPSA id 086F811010F; Thu, 22 Mar 2012 20:34:55 +0000 (GMT) Received: from broonie by finisterre.wolfsonmicro.main with local (Exim 4.77) (envelope-from ) id 1SAoil-0008Hu-8F; Thu, 22 Mar 2012 20:34:55 +0000 From: Mark Brown To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, Mark Brown Subject: [PATCH] [media] Convert I2C drivers to dev_pm_ops Date: Thu, 22 Mar 2012 20:34:53 +0000 Message-Id: <1332448493-31828-1-git-send-email-broonie@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.7.9.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.3.22.202416 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODY_SIZE_3000_3999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, __ANY_URI 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __URI_NO_WWW 0, __URI_NS ' 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 --- drivers/media/video/msp3400-driver.c | 13 +++++++++---- drivers/media/video/tuner-core.c | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c index 82ce507..0a55317 100644 --- a/drivers/media/video/msp3400-driver.c +++ b/drivers/media/video/msp3400-driver.c @@ -597,15 +597,17 @@ static int msp_log_status(struct v4l2_subdev *sd) return 0; } -static int msp_suspend(struct i2c_client *client, pm_message_t state) +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; @@ -863,6 +865,10 @@ static int msp_remove(struct i2c_client *client) /* ----------------------------------------------------------------------- */ +static const struct dev_pm_ops msp3400_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(msp3400_suspend, msp3400_resume) +}; + static const struct i2c_device_id msp_id[] = { { "msp3400", 0 }, { } @@ -873,11 +879,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, }; diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index a5c6397..d3de74f 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c @@ -1241,8 +1241,9 @@ static int tuner_log_status(struct v4l2_subdev *sd) return 0; } -static int tuner_suspend(struct i2c_client *c, pm_message_t state) +static int tuner_suspend(struct device *dev) { + struct i2c_client *c = to_i2c_client(dev); struct tuner *t = to_tuner(i2c_get_clientdata(c)); struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; @@ -1254,8 +1255,9 @@ static int tuner_suspend(struct i2c_client *c, pm_message_t state) return 0; } -static int tuner_resume(struct i2c_client *c) +static int tuner_resume(struct device *dev) { + struct i2c_client *c = to_i2c_client(dev); struct tuner *t = to_tuner(i2c_get_clientdata(c)); tuner_dbg("resume\n"); @@ -1310,6 +1312,10 @@ static const struct v4l2_subdev_ops tuner_ops = { * I2C structs and module init functions */ +static const struct dev_pm_ops tuner_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(tuner_suspend, tuner_resume) +}; + static const struct i2c_device_id tuner_id[] = { { "tuner", }, /* autodetect */ { } @@ -1320,12 +1326,11 @@ static struct i2c_driver tuner_driver = { .driver = { .owner = THIS_MODULE, .name = "tuner", + .pm = tuner_pm_ops, }, .probe = tuner_probe, .remove = tuner_remove, .command = tuner_command, - .suspend = tuner_suspend, - .resume = tuner_resume, .id_table = tuner_id, };