From patchwork Wed Jan 5 19:10:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 454551 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p05JBiGD007840 for ; Wed, 5 Jan 2011 19:11:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751523Ab1AETLo (ORCPT ); Wed, 5 Jan 2011 14:11:44 -0500 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:39281 "EHLO opensource2.wolfsonmicro.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751373Ab1AETLn (ORCPT ); Wed, 5 Jan 2011 14:11:43 -0500 Received: from rakim.wolfsonmicro.main (lumison.wolfsonmicro.com [87.246.78.27]) by opensource2.wolfsonmicro.com (Postfix) with ESMTPSA id B48E31105E6; Wed, 5 Jan 2011 19:11:42 +0000 (GMT) Received: by rakim.wolfsonmicro.main (Postfix, from userid 1000) id 9305932D07E1; Wed, 5 Jan 2011 19:10:07 +0000 (GMT) From: Mark Brown To: Magnus Damm , Dmitry Torokhov , Magnus Damm Cc: linux-input@vger.kernel.org, Mark Brown Subject: [PATCH] Input: migor_ts - Convert to dev_pm_ops Date: Wed, 5 Jan 2011 19:10:06 +0000 Message-Id: <1294254606-26277-1-git-send-email-broonie@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.7.2.3 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 05 Jan 2011 19:11:45 +0000 (UTC) diff --git a/drivers/input/touchscreen/migor_ts.c b/drivers/input/touchscreen/migor_ts.c index defe5dd..5803bd0 100644 --- a/drivers/input/touchscreen/migor_ts.c +++ b/drivers/input/touchscreen/migor_ts.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -226,8 +227,9 @@ static int migor_ts_remove(struct i2c_client *client) return 0; } -static int migor_ts_suspend(struct i2c_client *client, pm_message_t mesg) +static int migor_ts_suspend(struct device *dev) { + struct i2c_client *client = to_i2c_client(dev); struct migor_ts_priv *priv = dev_get_drvdata(&client->dev); if (device_may_wakeup(&client->dev)) @@ -236,8 +238,9 @@ static int migor_ts_suspend(struct i2c_client *client, pm_message_t mesg) return 0; } -static int migor_ts_resume(struct i2c_client *client) +static int migor_ts_resume(struct device *dev) { + struct i2c_client *client = to_i2c_client(dev); struct migor_ts_priv *priv = dev_get_drvdata(&client->dev); if (device_may_wakeup(&client->dev)) @@ -246,6 +249,8 @@ static int migor_ts_resume(struct i2c_client *client) return 0; } +static SIMPLE_DEV_PM_OPS(migor_ts_pm, migor_ts_suspend, migor_ts_resume); + static const struct i2c_device_id migor_ts_id[] = { { "migor_ts", 0 }, { } @@ -255,11 +260,10 @@ MODULE_DEVICE_TABLE(i2c, migor_ts); static struct i2c_driver migor_ts_driver = { .driver = { .name = "migor_ts", + .pm = &migor_ts_pm, }, .probe = migor_ts_probe, .remove = migor_ts_remove, - .suspend = migor_ts_suspend, - .resume = migor_ts_resume, .id_table = migor_ts_id, };