From patchwork Wed Oct 2 08:35:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 2973461 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 88D6D9F88A for ; Wed, 2 Oct 2013 08:35:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F357B20397 for ; Wed, 2 Oct 2013 08:35:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7D8632012C for ; Wed, 2 Oct 2013 08:35:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753364Ab3JBIfw (ORCPT ); Wed, 2 Oct 2013 04:35:52 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:29669 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753340Ab3JBIfs (ORCPT ); Wed, 2 Oct 2013 04:35:48 -0400 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MU100JIY971RA50@mailout1.samsung.com> for linux-mmc@vger.kernel.org; Wed, 02 Oct 2013 17:35:46 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.49]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 70.0C.29948.2EADB425; Wed, 02 Oct 2013 17:35:46 +0900 (KST) X-AuditID: cbfee691-b7f4a6d0000074fc-7e-524bdae200b6 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 31.5C.05832.2EADB425; Wed, 02 Oct 2013 17:35:46 +0900 (KST) Received: from DOJG1HAN03 ([12.23.120.99]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MU100FOC97MQV00@mmp1.samsung.com>; Wed, 02 Oct 2013 17:35:46 +0900 (KST) From: Jingoo Han To: 'Chris Ball' Cc: linux-mmc@vger.kernel.org, 'Sonic Zhang' , 'Jingoo Han' Subject: [PATCH 1/2] mmc: mmc_spi: use spi_get_drvdata() and spi_set_drvdata() Date: Wed, 02 Oct 2013 17:35:45 +0900 Message-id: <000201cebf4a$63a313c0$2ae93b40$%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: Ac6/SmN2xOjEtwR+RzmoTMiMFSTXmQ== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrCIsWRmVeSWpSXmKPExsVy+t8zQ91Ht7yDDF7OELDY/nojm8XlhZdY LY7872e0uLO1mc2BxePVVUePQ1fWMnr0bVnF6PF5k1wASxSXTUpqTmZZapG+XQJXxt3de1kK WngqTra9Ymxg/MzZxcjBISFgIvHoI0cXIyeQKSZx4d56ti5GLg4hgWWMEkt3bmeHSJhInH56 DSqxiFHiUN8rFgjnF6PEup1f2ECq2ATUJL58OQzWISKgKLHl+3Ewm1kgW2Ju53dWEFtYwE/i 6bynLCA2i4CqxOO/TxhBbF4BW4lP+7ayQNiCEj8m32OB6NWSWL/zOBOELS+xec1bZoir1SUe /dWFWKUncfBlJxtEiYjEvhfvGEFukxDYxC4xv3ESM8QuAYlvkw+xQPTKSmw6wAzxmKTEwRU3 WCYwis1CsnkWks2zkGyehWTFAkaWVYyiqQXJBcVJ6UWmesWJucWleel6yfm5mxghMTZxB+P9 A9aHGJOB1k9klhJNzgfGaF5JvKGxmZGFqYmpsZG5pRlpwkrivOot1oF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R1WnIC/3Z+Z/vZJPrS8+fCi9VXroSJfK3eeyZ+lxJL cUaioRZzUXEiAOb0jOElAwAA 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=-7.6 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; }