From patchwork Mon Jun 3 04:41:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 2650681 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id C88F040077 for ; Mon, 3 Jun 2013 04:41:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750820Ab3FCElF (ORCPT ); Mon, 3 Jun 2013 00:41:05 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:28855 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750781Ab3FCElE convert rfc822-to-8bit (ORCPT ); Mon, 3 Jun 2013 00:41:04 -0400 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MNS001NCVNJE5I0@mailout3.samsung.com> for linux-mmc@vger.kernel.org; Mon, 03 Jun 2013 13:41:03 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.51]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 76.FC.08825.F5E1CA15; Mon, 03 Jun 2013 13:41:03 +0900 (KST) X-AuditID: cbfee68e-b7f276d000002279-f9-51ac1e5fec04 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 89.14.28381.F5E1CA15; Mon, 03 Jun 2013 13:41:03 +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 <0MNS00CAGVOF5J20@mmp1.samsung.com>; Mon, 03 Jun 2013 13:41:03 +0900 (KST) From: Jingoo Han To: 'Chris Ball' Cc: linux-mmc@vger.kernel.org, 'Jingoo Han' , =?iso-8859-2?Q?'_Micha=B3_Miros=B3aw_'?= , Guennadi Liakhovetski , Ian Molton Subject: [PATCH V2] mmc: host: use platform_{get,set}_drvdata() Date: Mon, 03 Jun 2013 13:41:03 +0900 Message-id: <001d01ce6014$8d8f8a50$a8ae9ef0$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-2 Content-transfer-encoding: 8BIT X-Mailer: Microsoft Outlook 14.0 Content-language: ko Thread-index: Ac5gFIgr9oqOsLr+QEiAg4MWP19hBQ== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrBIsWRmVeSWpSXmKPExsVy+t8zY914uTWBBp93iFpsf72RzeL9xnlM Fvf3L2C0uLzwEqvFkf/9jBbfnp9idGDz+PAxzuPQlbWMHn/7ulk9ZrXtY/Po27KK0ePzJrkA tigum5TUnMyy1CJ9uwSujFtbJrEX/BevWPXNs4HxkEgXIyeHhICJxNNvJ1ghbDGJC/fWs3Ux cnEICSxjlOh9+IAJpujjpnNMEIlFjBJzr/ZDVf1ilOhv7AFrZxNQk/jy5TA7iC0ioCix5ftx dpAiZoGbjBIfJl8EKxIWsJd4+v8IWBGLgKrEosV7GEFsXgFLidYzm5ghbEGJH5PvsXQxcgA1 60h8nRQBEmYW0JZ48u4C1KkKEjvOvmaEiItI7HvxjhFir57EnRdfmUH2SghcYpfouXSSGWKX gMS3yYfAZkoIyEpsOsAMMUdS4uCKGywTGMVmIdk8C2HzLCSbZyHZtoCRZRWjaGpBckFxUnqR kV5xYm5xaV66XnJ+7iZGSCz27WC8ecD6EGMy0PaJzFKiyfnAWM4riTc0NjOyMDUxNTYytzQj TVhJnFetxTpQSCA9sSQ1OzW1ILUovqg0J7X4ECMTB6dUA6OhFWdM3UlX+/8T5MvDs+e+m7Li R8O5a1y2LuwzmRdueaafqVE6UchMQ6NyF8+HD+XF5Te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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 Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev, so we can directly pass a struct platform_device. Signed-off-by: Jingoo Han Acked-by: Micha? Miros?aw --- Changes since v1: - Fixed the missed counterpart - cb710_slot_to_mmc() in cb710-mmc.h. drivers/mmc/host/cb710-mmc.c | 2 +- drivers/mmc/host/cb710-mmc.h | 2 +- drivers/mmc/host/sh_mobile_sdhi.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/cb710-mmc.c b/drivers/mmc/host/cb710-mmc.c index 777ca20..9d6e2b8 100644 --- a/drivers/mmc/host/cb710-mmc.c +++ b/drivers/mmc/host/cb710-mmc.c @@ -703,7 +703,7 @@ static int cb710_mmc_init(struct platform_device *pdev) if (!mmc) return -ENOMEM; - dev_set_drvdata(&pdev->dev, mmc); + platform_set_drvdata(pdev, mmc); /* harmless (maybe) magic */ pci_read_config_dword(chip->pdev, 0x48, &val); diff --git a/drivers/mmc/host/cb710-mmc.h b/drivers/mmc/host/cb710-mmc.h index e845c77..8984ec8 100644 --- a/drivers/mmc/host/cb710-mmc.h +++ b/drivers/mmc/host/cb710-mmc.h @@ -24,7 +24,7 @@ struct cb710_mmc_reader { static inline struct mmc_host *cb710_slot_to_mmc(struct cb710_slot *slot) { - return dev_get_drvdata(&slot->pdev.dev); + return platform_get_drvdata(&slot->pdev); } static inline struct cb710_slot *cb710_mmc_to_slot(struct mmc_host *mmc) diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c index cc4c872..6a5d90e 100644 --- a/drivers/mmc/host/sh_mobile_sdhi.c +++ b/drivers/mmc/host/sh_mobile_sdhi.c @@ -51,7 +51,7 @@ struct sh_mobile_sdhi { static int sh_mobile_sdhi_clk_enable(struct platform_device *pdev, unsigned int *f) { - struct mmc_host *mmc = dev_get_drvdata(&pdev->dev); + struct mmc_host *mmc = platform_get_drvdata(pdev); struct tmio_mmc_host *host = mmc_priv(mmc); struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data); int ret = clk_enable(priv->clk); @@ -64,7 +64,7 @@ static int sh_mobile_sdhi_clk_enable(struct platform_device *pdev, unsigned int static void sh_mobile_sdhi_clk_disable(struct platform_device *pdev) { - struct mmc_host *mmc = dev_get_drvdata(&pdev->dev); + struct mmc_host *mmc = platform_get_drvdata(pdev); struct tmio_mmc_host *host = mmc_priv(mmc); struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data); clk_disable(priv->clk); @@ -119,7 +119,7 @@ static int sh_mobile_sdhi_write16_hook(struct tmio_mmc_host *host, int addr) static void sh_mobile_sdhi_cd_wakeup(const struct platform_device *pdev) { - mmc_detect_change(dev_get_drvdata(&pdev->dev), msecs_to_jiffies(100)); + mmc_detect_change(platform_get_drvdata(pdev), msecs_to_jiffies(100)); } static const struct sh_mobile_sdhi_ops sdhi_ops = {