From patchwork Wed Mar 16 07:18:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 638671 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 p2G7I6Nq002081 for ; Wed, 16 Mar 2011 07:18:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752018Ab1CPHSP (ORCPT ); Wed, 16 Mar 2011 03:18:15 -0400 Received: from mail-yw0-f46.google.com ([209.85.213.46]:63651 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751757Ab1CPHSO (ORCPT ); Wed, 16 Mar 2011 03:18:14 -0400 Received: by ywj3 with SMTP id 3so546365ywj.19 for ; Wed, 16 Mar 2011 00:18:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:subject:to:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=bLkdQ2ap+vYVoWfEQQjiWFfWmNGaGtmvkBz44arjeZ8=; b=HHhicJCjnYgCSehmysrdwv+FgtgH0oSzGAmY8JjR/crdi7AeDsjXuQZByD6XYUv3/s CkqIOv7Ab3sbhCnS/FaVmCwYgN8ogbMamf8jfegrUTtogXdwNcVV+qFZojqF+66G8d4q Bu5z28TZXUZgQ7PWmR4pWfbspMoeog+BW4QLo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:subject:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; b=Z/nt/sJCneu+pzmU0ruqfXjt/54Kz7TG67lLTUZlQqlW+9UwBxAd9/BAyc68F8NNXI clOBfJcNiv0/dwPkQp10w+V6LJfTahpLyokSdlFbEI0c3GO5gDMctG3kyhwHUc4UjjEU 9VEzQYlHHu7n8s+S8lcAveZayTxHSW1MCN+w8= Received: by 10.146.108.19 with SMTP id g19mr460718yac.24.1300259894402; Wed, 16 Mar 2011 00:18:14 -0700 (PDT) Received: from mailhub.coreip.homeip.net (c-98-234-113-65.hsd1.ca.comcast.net [98.234.113.65]) by mx.google.com with ESMTPS id w6sm857178anf.6.2011.03.16.00.18.11 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 16 Mar 2011 00:18:13 -0700 (PDT) From: Dmitry Torokhov Subject: [PATCH 02/17] Input: tsc2005 - convert to using dev_pm_ops To: Srikar , Phil Carmody , Aaro Koskinen Cc: linux-input@vger.kernel.org, lauri.leukkunen@nokia.com, David Brownell , Imre Deak , Hiroshi DOYU , Ari Kauppi , Tony Lindgren , Jarkko Nikula , Eero Nurkkala , Roman Tereshonkov Date: Wed, 16 Mar 2011 00:18:09 -0700 Message-ID: <20110316071809.25664.81719.stgit@hammer.corenet.prv> In-Reply-To: <20110316071503.25664.55116.stgit@hammer.corenet.prv> References: <20110316071503.25664.55116.stgit@hammer.corenet.prv> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 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.6 (demeter1.kernel.org [140.211.167.41]); Wed, 16 Mar 2011 07:18:16 +0000 (UTC) diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c index 5dad30a..109efbf 100644 --- a/drivers/input/touchscreen/tsc2005.c +++ b/drivers/input/touchscreen/tsc2005.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -661,8 +662,8 @@ static int __devexit tsc2005_remove(struct spi_device *spi) return 0; } -#ifdef CONFIG_PM -static int tsc2005_suspend(struct spi_device *spi, pm_message_t mesg) +#ifdef CONFIG_PM_SLEEP +static int tsc2005_suspend(struct device *dev) { struct spi_device *spi = to_spi_device(dev); struct tsc2005 *ts = spi_get_drvdata(spi); @@ -674,7 +675,7 @@ static int tsc2005_suspend(struct spi_device *spi, pm_message_t mesg) return 0; } -static int tsc2005_resume(struct spi_device *spi) +static int tsc2005_resume(struct device *dev) { struct spi_device *spi = to_spi_device(dev); struct tsc2005 *ts = spi_get_drvdata(spi); @@ -687,17 +688,16 @@ static int tsc2005_resume(struct spi_device *spi) } #endif +static SIMPLE_DEV_PM_OPS(tsc2005_pm_ops, tsc2005_suspend, tsc2005_resume); + static struct spi_driver tsc2005_driver = { - .driver = { - .name = "tsc2005", - .owner = THIS_MODULE, + .driver = { + .name = "tsc2005", + .owner = THIS_MODULE, + .pm = &tsc2005_pm_ops, }, -#ifdef CONFIG_PM - .suspend = tsc2005_suspend, - .resume = tsc2005_resume, -#endif - .probe = tsc2005_probe, - .remove = __devexit_p(tsc2005_remove), + .probe = tsc2005_probe, + .remove = __devexit_p(tsc2005_remove), }; static int __init tsc2005_init(void)