From patchwork Wed Jan 8 01:49:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 3451081 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 651E9C02DC for ; Wed, 8 Jan 2014 01:49:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 97C8420136 for ; Wed, 8 Jan 2014 01:49:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BE7702012F for ; Wed, 8 Jan 2014 01:49:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753994AbaAHBtf (ORCPT ); Tue, 7 Jan 2014 20:49:35 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:59909 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753749AbaAHBte (ORCPT ); Tue, 7 Jan 2014 20:49:34 -0500 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MZ200KP97QFARA0@mailout1.samsung.com> for linux-mmc@vger.kernel.org; Wed, 08 Jan 2014 10:49:27 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.48]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id 89.86.10364.7AEACC25; Wed, 08 Jan 2014 10:49:27 +0900 (KST) X-AuditID: cbfee690-b7f266d00000287c-30-52ccaea7b876 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id FF.6D.28157.6AEACC25; Wed, 08 Jan 2014 10:49:27 +0900 (KST) Received: from DOJG1HAN03 ([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 <0MZ200KT67QESR80@mmp2.samsung.com>; Wed, 08 Jan 2014 10:49:26 +0900 (KST) From: Jingoo Han To: 'Jiri Kosina' Cc: trivial@kernel.org, 'Chris Ball' , linux-mmc@vger.kernel.org, 'Sonic Zhang' , 'Jingoo Han' Subject: [PATCH 1/3] mmc: mmc_spi: use spi_get_drvdata() and spi_set_drvdata() Date: Wed, 08 Jan 2014 10:49:26 +0900 Message-id: <000001cf0c13$dcea0570$96be1050$%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: Ac8ME9ZoPCFpmDDXTKipAHxsatQZYw== Content-language: ko x-cr-hashedpuzzle: CBDc DUJ4 DeRx EuPM FRbq Mcnt SnX9 lDF1 llVx vExd ypMF 23Dc 3YwF 9DZx AAMxFw== AAfZ9Q==; 6; YwBoAHIAaQBzAEAAcAByAGkAbgB0AGYALgBuAGUAdAA7AGoAZwAxAC4AaABhAG4AQABzAGEAbQBzAHUAbgBnAC4AYwBvAG0AOwBqAGsAbwBzAGkAbgBhAEAAcwB1AHMAZQAuAGMAegA7AGwAaQBuAHUAeAAtAG0AbQBjAEAAdgBnAGUAcgAuAGsAZQByAG4AZQBsAC4AbwByAGcAOwBzAG8AbgBpAGMALgB6AGgAYQBuAGcAQABhAG4AYQBsAG8AZwAuAGMAbwBtADsAdAByAGkAdgBpAGEAbABAAGsAZQByAG4AZQBsAC4AbwByAGcA; Sosha1_v1; 7; {2E09FD49-ABFD-4AFC-ABF9-6C05EF83315C}; agBnADEALgBoAGEAbgBAAHMAYQBtAHMAdQBuAGcALgBjAG8AbQA=; Wed, 08 Jan 2014 01:49:15 GMT; WwBQAEEAVABDA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AAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrAKsWRmVeSWpSXmKPExsVy+t9jQd3l684EGayaxGwx4fJ2RovLCy+x Wuyes5jF4sj/fkaLO1ub2Sze77/M5MDm8eqqo8emVZ1sHjdeLWTy6NuyitHjzIIj7B6fN8kF sEU1MNpkpCampBYppOYl56dk5qXbKnkHxzvHm5oZGOoaWlqYKynkJeam2iq5+AToumXmAJ2h pFCWmFMKFApILC5W0rfDNCE0xE3XAqYxQtc3JAiux8gADSSsY8y4u3svS0ELT8XJtleMDYyf ObsYOTkkBEwk5jS/YoWwxSQu3FvP1sXIxSEkMJ1R4tHrh1DOLyCn4zpYFZuAmsSXL4fZQWwR AWWJDee6wYqYBRYxSkzo2McEkhAW8JNYe/86mM0ioCqx4dBNRhCbV8BW4svJN0wQtqDEj8n3 WEBsZgEtifU7jzNB2PISm9e8Ze5i5AA6SV3i0V9diF16Eg3L/7JDlIhI7HvxjhFkr4TAF1aJ u/03mCFeMJWYt/4D0wRGoVlIVsxCsmIWkhWzkMxawMiyilE0tSC5oDgpPddIrzgxt7g0L10v OT93EyM4PTyT3sG4qsHiEKMAB6MSD+8NtTNBQqyJZcWVuYcYJTiYlUR4j3UDhXhTEiurUovy 44tKc1KLDzEmA0NgIrOUaHI+MHXllcQbGpuYGVkamVkYmZibkyasJM57sNU6UEggPbEkNTs1 tSC1CGYLEwenVAOjZl9tv977rPtzPqvzFu5xsl1Vzeh0d6tALrOY6jT5D8smK2wyffpl+vuA LF8b7fBv+rw67ys2m8tP0TO7+c6vPuhtScxXVtatTFMlTyrHmRyee+QAJ4t+Tr78vjvhP2X3 mInNKJ7zfNsW1zsBsl+Ozn5S2/Dqkb16+TGDcAFmjkNHHu37KcmlxFKckWioxVxUnAgAOXcV 3FMDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Sonic Zhang --- drivers/mmc/host/mmc_spi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c index 0a87e56..40770a5 100644 --- a/drivers/mmc/host/mmc_spi.c +++ b/drivers/mmc/host/mmc_spi.c @@ -1386,7 +1386,7 @@ static int mmc_spi_probe(struct spi_device *spi) host->powerup_msecs = 250; } - dev_set_drvdata(&spi->dev, mmc); + spi_set_drvdata(spi, mmc); /* preallocate dma buffers */ host->data = kmalloc(sizeof(*host->data), GFP_KERNEL); @@ -1472,7 +1472,7 @@ fail_glue_init: fail_nobuf1: mmc_free_host(mmc); mmc_spi_put_pdata(spi); - dev_set_drvdata(&spi->dev, NULL); + spi_set_drvdata(spi, NULL); nomem: kfree(ones); @@ -1482,7 +1482,7 @@ nomem: static int mmc_spi_remove(struct spi_device *spi) { - struct mmc_host *mmc = dev_get_drvdata(&spi->dev); + struct mmc_host *mmc = spi_get_drvdata(spi); struct mmc_spi_host *host; if (mmc) { @@ -1507,7 +1507,7 @@ static int mmc_spi_remove(struct spi_device *spi) spi->max_speed_hz = mmc->f_max; mmc_free_host(mmc); mmc_spi_put_pdata(spi); - dev_set_drvdata(&spi->dev, NULL); + spi_set_drvdata(spi, NULL); } return 0; }