From patchwork Wed Mar 16 07:12:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 638651 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 p2G7D9eh031995 for ; Wed, 16 Mar 2011 07:13:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751933Ab1CPHM7 (ORCPT ); Wed, 16 Mar 2011 03:12:59 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:51071 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751990Ab1CPHM6 (ORCPT ); Wed, 16 Mar 2011 03:12:58 -0400 Received: by iwn34 with SMTP id 34so1376394iwn.19 for ; Wed, 16 Mar 2011 00:12:58 -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=huEV//4CGpPzkl3j/u6Uj12RyLllORK6zlUkC0o2cdw=; b=FG6RTwcpLctk+B1Bu4uUo0UsmdmFyZ7bYLsqbMrkFioS2QTQ44tDFUvZi6/ZzpTYKf ek8frDDnlDr9JNLahUjyMtCjsKBInrsL61zYHwxqyquwwYna5AMH8QximS/9fQN2Agip hAIKWLJJMlsuxjCntDZ+kkex2Mz9AsHIfWDGI= 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=UBt9vn5hEvdrG8PPZfvrgUwSUr5rlJbuk2s/NMk2mT1r7ti3CCpe5uSb5ecCrjzrMb RUUF5IGJczwoQb70FLNFIRZ2KtUCkwMVqotqDinCoo4sjsVZLuXekSuQimho/FW0LRHY +4Sb9aEpXNcL3ol/DEbmdQ8+Rq89acAKTOntA= Received: by 10.42.66.143 with SMTP id p15mr476916ici.296.1300259578346; Wed, 16 Mar 2011 00:12:58 -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 wf3sm382558icb.9.2011.03.16.00.12.56 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 16 Mar 2011 00:12:57 -0700 (PDT) From: Dmitry Torokhov Subject: [PATCH 01/17] Input: tsc2005 - use spi_get/set_drvdata() 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:12:54 -0700 Message-ID: <20110316071254.25081.85318.stgit@hammer.corenet.prv> In-Reply-To: <20110316071246.25081.27438.stgit@hammer.corenet.prv> References: <20110316071246.25081.27438.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:13:09 +0000 (UTC) diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c index f95f968..5dad30a 100644 --- a/drivers/input/touchscreen/tsc2005.c +++ b/drivers/input/touchscreen/tsc2005.c @@ -366,7 +366,8 @@ static void tsc2005_enable(struct tsc2005 *ts) static ssize_t tsc2005_disable_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct tsc2005 *ts = dev_get_drvdata(dev); + struct spi_device *spi = to_spi_device(dev); + struct tsc2005 *ts = spi_get_drvdata(spi); return sprintf(buf, "%u\n", ts->disabled); } @@ -375,7 +376,8 @@ static ssize_t tsc2005_disable_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct tsc2005 *ts = dev_get_drvdata(dev); + struct spi_device *spi = to_spi_device(dev); + struct tsc2005 *ts = spi_get_drvdata(spi); unsigned long res; int i; @@ -401,7 +403,8 @@ static ssize_t tsc2005_selftest_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct tsc2005 *ts = dev_get_drvdata(dev); + struct spi_device *spi = to_spi_device(dev); + struct tsc2005 *ts = spi_get_drvdata(spi); u16 temp_high; u16 temp_high_orig; u16 temp_high_test; @@ -620,7 +623,7 @@ static int __devinit tsc2005_probe(struct spi_device *spi) if (ts == NULL) return -ENOMEM; - dev_set_drvdata(&spi->dev, ts); + spi_set_drvdata(spi, ts); ts->spi = spi; spi->dev.power.power_state = PMSG_ON; spi->mode = SPI_MODE_0; @@ -637,7 +640,7 @@ static int __devinit tsc2005_probe(struct spi_device *spi) static int __devexit tsc2005_remove(struct spi_device *spi) { - struct tsc2005 *ts = dev_get_drvdata(&spi->dev); + struct tsc2005 *ts = spi_get_drvdata(spi); mutex_lock(&ts->mutex); tsc2005_disable(ts); @@ -661,7 +664,8 @@ static int __devexit tsc2005_remove(struct spi_device *spi) #ifdef CONFIG_PM static int tsc2005_suspend(struct spi_device *spi, pm_message_t mesg) { - struct tsc2005 *ts = dev_get_drvdata(&spi->dev); + struct spi_device *spi = to_spi_device(dev); + struct tsc2005 *ts = spi_get_drvdata(spi); mutex_lock(&ts->mutex); tsc2005_disable(ts); @@ -672,7 +676,8 @@ static int tsc2005_suspend(struct spi_device *spi, pm_message_t mesg) static int tsc2005_resume(struct spi_device *spi) { - struct tsc2005 *ts = dev_get_drvdata(&spi->dev); + struct spi_device *spi = to_spi_device(dev); + struct tsc2005 *ts = spi_get_drvdata(spi); mutex_lock(&ts->mutex); tsc2005_enable(ts);