From patchwork Sat Apr 6 06:46:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 2401011 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 9A78ADFB7B for ; Sat, 6 Apr 2013 06:46:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754638Ab3DFGq6 (ORCPT ); Sat, 6 Apr 2013 02:46:58 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:61272 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754607Ab3DFGq5 (ORCPT ); Sat, 6 Apr 2013 02:46:57 -0400 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MKT00DYGMU786D0@mailout4.samsung.com> for linux-input@vger.kernel.org; Sat, 06 Apr 2013 15:46:56 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.51]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 0F.E5.05174.0E4CF515; Sat, 06 Apr 2013 15:46:56 +0900 (KST) X-AuditID: cbfee68f-b7f4a6d000001436-93-515fc4e041b0 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 68.E2.13494.FD4CF515; Sat, 06 Apr 2013 15:46:56 +0900 (KST) Received: from DOJG1HAN02 ([12.23.120.99]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MKT00DCHMU72S00@mmp2.samsung.com>; Sat, 06 Apr 2013 15:46:55 +0900 (KST) From: Jingoo Han To: 'Dmitry Torokhov' Cc: 'Dmitry Torokhov' , linux-input@vger.kernel.org, 'Jingoo Han' References: <001d01ce3292$746da5c0$5d48f140$%han@samsung.com> In-reply-to: <001d01ce3292$746da5c0$5d48f140$%han@samsung.com> Subject: [PATCH 2/3] Input: ad7877 - use spi_get_drvdata() and spi_set_drvdata() Date: Sat, 06 Apr 2013 15:46:55 +0900 Message-id: <001e01ce3292$8768f620$963ae260$%han@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac4yknRQID1xMhIOTM+QsPTasOlYCAAAAQ3Q Content-language: ko x-cr-hashedpuzzle: EmCw Hk52 LAK0 McML PJPq TIXd UspJ WHDh W8Cy Z8j0 bvQy dpZl f+n6 iEYh onXQ pu8M; 4; ZABtAGkAdAByAHkALgB0AG8AcgBvAGsAaABvAHYAQABnAG0AYQBpAGwALgBjAG8AbQA7AGQAdABvAHIAQABtAGEAaQBsAC4AcgB1ADsAagBnADEALgBoAGEAbgBAAHMAYQBtAHMAdQBuAGcALgBjAG8AbQA7AGwAaQBuAHUAeAAtAGkAbgBwAHUAdABAAHYAZwBlAHIALgBrAGUAcgBuAGUAbAAuAG8AcgBnAA==; Sosha1_v1; 7; {C3A99913-474F-4547-A0A9-3C54157584D9}; agBnADEALgBoAGEAbgBAAHMAYQBtAHMAdQBuAGcALgBjAG8AbQA=; Sat, 06 Apr 2013 06:46:48 GMT; WwBQAEEAVABDAEgAIAAyAC8AMwBdACAASQBuAHAAdQB0ADoAIABhAGQANwA4ADcANwAgAC0AIAB1AHMAZQAgAHMAcABpAF8AZwBlAHQAXwBkAHIAdgBkAGEAdABhACgAKQAgAGEAbgBkACAAcwBwAGkAXwBzAGUAdABfAGQAcgB2AGQAYQB0AGEAKAApAA== x-cr-puzzleid: {C3A99913-474F-4547-A0A9-3C54157584D9} X-Brightmail-Tracker: H4sIAAAA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LlfTtME0IDXHT tYBpjND1DQmC6zEyQAMJ6xgzembNZi84zFsxZ8kl9gbG6dxdjJwcEgImErM+HmSBsMUkLtxb z9bFyMUhJDCdUeJ662MmCOcXo8SKDYvAqtgE1CS+fDnM3sXIwSEiYCgxY00ViMkskC5x9qAH SIWQgK1E7+sXzCA2p4CdxIEvd1lBbGGBAIkzy/8zgZSzCKhK/HxnDGLyApVfXMgFUsErICjx Y/I9sD3MAloS63ceZ4Kw5SU2r3nLDFIuIaAu8eivLkhYRMBI4sLrO2wQJSIS+168YwS5V0Jg DqvEnUkrGCG+MpXYfOQS+wRGkVlIVsxCsmIWkhWzkMxawMiyilE0tSC5oDgpPddIrzgxt7g0 L10vOT93EyM4PTyT3sG4qsHiEKMAB6MSD6/F7bhAIdbEsuLK3EOMEhzMSiK8ss+BQrwpiZVV qUX58UWlOanFhxiTgf6fyCwlmpwPTF15JfGGxiZmRpZGZhZGJubmpAkrifMebLUOFBJITyxJ zU5NLUgtgtnCxMEp1cBo17Fl4gbjrss9H6zPHfb6Y++srOb/9afN49o3Qa173a11S+LDjLMT qy0ian/EBucbX25QMWOtbbi33/FGXvKk3HP6CusyBP5VqOw+7bDNMiBvQ7XPh6+HDl4+d3yP 6+uV4Us5eO60L19w5XKvVm2hk7aU2F9Z4V65nes/37us+e91Qavq/pdKLMUZiYZazEXFiQD6 d0KHUwMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Use the wrapper functions for getting and setting the driver data using spi_device instead of using dev_{get|set}_drvdata with &spi->dev, so we can directly pass a struct spi_device. Signed-off-by: Jingoo Han --- drivers/input/touchscreen/ad7877.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c index 23fa829b8..f3a174a 100644 --- a/drivers/input/touchscreen/ad7877.c +++ b/drivers/input/touchscreen/ad7877.c @@ -273,7 +273,7 @@ static int ad7877_write(struct spi_device *spi, u16 reg, u16 val) static int ad7877_read_adc(struct spi_device *spi, unsigned command) { - struct ad7877 *ts = dev_get_drvdata(&spi->dev); + struct ad7877 *ts = spi_get_drvdata(spi); struct ser_req *req; int status; int sample; @@ -720,7 +720,7 @@ static int ad7877_probe(struct spi_device *spi) goto err_free_mem; } - dev_set_drvdata(&spi->dev, ts); + spi_set_drvdata(spi, ts); ts->spi = spi; ts->input = input_dev; @@ -806,13 +806,13 @@ err_free_irq: err_free_mem: input_free_device(input_dev); kfree(ts); - dev_set_drvdata(&spi->dev, NULL); + spi_set_drvdata(spi, NULL); return err; } static int ad7877_remove(struct spi_device *spi) { - struct ad7877 *ts = dev_get_drvdata(&spi->dev); + struct ad7877 *ts = spi_get_drvdata(spi); sysfs_remove_group(&spi->dev.kobj, &ad7877_attr_group); @@ -823,7 +823,7 @@ static int ad7877_remove(struct spi_device *spi) kfree(ts); dev_dbg(&spi->dev, "unregistered touchscreen\n"); - dev_set_drvdata(&spi->dev, NULL); + spi_set_drvdata(spi, NULL); return 0; }