From patchwork Wed Jan 5 19:04:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 454521 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 p05J632X004300 for ; Wed, 5 Jan 2011 19:06:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752494Ab1AETFs (ORCPT ); Wed, 5 Jan 2011 14:05:48 -0500 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:37283 "EHLO opensource2.wolfsonmicro.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752163Ab1AETFq (ORCPT ); Wed, 5 Jan 2011 14:05:46 -0500 Received: from rakim.wolfsonmicro.main (lumison.wolfsonmicro.com [87.246.78.27]) by opensource2.wolfsonmicro.com (Postfix) with ESMTPSA id 986AF1105E6; Wed, 5 Jan 2011 19:05:45 +0000 (GMT) Received: by rakim.wolfsonmicro.main (Postfix, from userid 1000) id 8669732D07E1; Wed, 5 Jan 2011 19:04:10 +0000 (GMT) From: Mark Brown To: Samuli Konttila , Alan Cox , Dmitry Torokhov Cc: linux-input@vger.kernel.org, Mark Brown Subject: [PATCH] Input: cy8ctmg110_ts - Convert to dev_pm_ops Date: Wed, 5 Jan 2011 19:04:09 +0000 Message-Id: <1294254249-25932-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:06:04 +0000 (UTC) diff --git a/drivers/input/touchscreen/cy8ctmg110_ts.c b/drivers/input/touchscreen/cy8ctmg110_ts.c index d0c3a72..a93c5c2 100644 --- a/drivers/input/touchscreen/cy8ctmg110_ts.c +++ b/drivers/input/touchscreen/cy8ctmg110_ts.c @@ -280,8 +280,9 @@ err_free_mem: } #ifdef CONFIG_PM -static int cy8ctmg110_suspend(struct i2c_client *client, pm_message_t mesg) +static int cy8ctmg110_suspend(struct device *dev) { + struct i2c_client *client = to_i2c_client(dev); struct cy8ctmg110 *ts = i2c_get_clientdata(client); if (device_may_wakeup(&client->dev)) @@ -293,8 +294,9 @@ static int cy8ctmg110_suspend(struct i2c_client *client, pm_message_t mesg) return 0; } -static int cy8ctmg110_resume(struct i2c_client *client) +static int cy8ctmg110_resume(struct device *dev) { + struct i2c_client *client = to_i2c_client(dev); struct cy8ctmg110 *ts = i2c_get_clientdata(client); if (device_may_wakeup(&client->dev)) @@ -305,6 +307,8 @@ static int cy8ctmg110_resume(struct i2c_client *client) } return 0; } + +static SIMPLE_DEV_PM_OPS(cy8ctmg110_pm, cy8ctmg110_suspend, cy8ctmg110_resume); #endif static int __devexit cy8ctmg110_remove(struct i2c_client *client) @@ -335,14 +339,13 @@ static struct i2c_driver cy8ctmg110_driver = { .driver = { .owner = THIS_MODULE, .name = CY8CTMG110_DRIVER_NAME, +#ifdef CONFIG_PM + .pm = &cy8ctmg110_pm, +#endif }, .id_table = cy8ctmg110_idtable, .probe = cy8ctmg110_probe, .remove = __devexit_p(cy8ctmg110_remove), -#ifdef CONFIG_PM - .suspend = cy8ctmg110_suspend, - .resume = cy8ctmg110_resume, -#endif }; static int __init cy8ctmg110_init(void)