From patchwork Fri Aug 30 15:12:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seungwon Jeon X-Patchwork-Id: 2852112 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 7EAEBC0AB5 for ; Fri, 30 Aug 2013 15:12:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D676320488 for ; Fri, 30 Aug 2013 15:12:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A1E032018D for ; Fri, 30 Aug 2013 15:12:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755603Ab3H3PMN (ORCPT ); Fri, 30 Aug 2013 11:12:13 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:20179 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752794Ab3H3PMM (ORCPT ); Fri, 30 Aug 2013 11:12:12 -0400 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MSC00HHGNKBWSA0@mailout4.samsung.com> for linux-mmc@vger.kernel.org; Sat, 31 Aug 2013 00:12:11 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.51]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id B0.1D.29948.B46B0225; Sat, 31 Aug 2013 00:12:11 +0900 (KST) X-AuditID: cbfee691-b7f4a6d0000074fc-96-5220b64b7d5f Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id AD.31.09055.B46B0225; Sat, 31 Aug 2013 00:12:11 +0900 (KST) Received: from DOTGIHJUN01 ([12.23.118.161]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MSC002U3NKA4300@mmp1.samsung.com>; Sat, 31 Aug 2013 00:12:11 +0900 (KST) From: Seungwon Jeon To: linux-mmc@vger.kernel.org Cc: 'Chris Ball' , 'Jaehoon Chung' References: In-reply-to: Subject: [PATCH 06/22] mmc: dw_mmc: socfpga: move socfpga private init Date: Sat, 31 Aug 2013 00:12:10 +0900 Message-id: <000901cea593$4ce8e4f0$e6baaed0$%jun@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac03z3aCvVFr8FaITt2vKVQKst76fw3OcIrwS9fJ1BAByUIdcA== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrAIsWRmVeSWpSXmKPExsVy+t8zY13vbQpBBpsP81hsf72RzeLGrzZW iyP/+xkdmD0OXVnL6NG3ZRWjx+dNcgHMUVw2Kak5mWWpRfp2CVwZa6ZfYy+4L1Lx9eQhlgbG XYJdjJwcEgImEq2f/rNC2GISF+6tZ+ti5OIQEljGKLFlTQMrTNF/oCaIxCJGieePPkM5fxgl Ol6eYAapYhPQkvj75g2YLSIgK/HzzwU2EJtZwFvi1fw1jF2MHEAN3BKrm4NAwpwCPBLr/nQy g4SFBdwkDt6MAQmzCKhKTN6zgh3E5hWwlbi6dx4rhC0o8WPyPRaQcmYBdYkpU3IhhstLbF7z FmyKBFD40V9diP1OEmebDjJClIhI7HvxjhHkYAmBfewSC26sYYZYJSDxbfIhFoheWYlNB5gh vpWUOLjiBssERolZSBbPQlg8C8niWUg2LGBkWcUomlqQXFCclF5kqlecmFtcmpeul5yfu4kR EnsTdzDeP2B9iDEZaPtEZinR5Hxg7OaVxB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55sbtuHJS9mpV03yD9X9vz48dLnzdKsPSEXXQLVvkWetVhmx4X1/7Ason/FjXX+Sce /Kcrsk+JpTgj0VCLuag4EQCPBJs9MAMAAA== 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=-9.0 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 From: Yuvaraj Kumar C D Currently platform specific private data initialization is done by dw_mci_socfpga_priv_init and dw_mci_socfpga_parse_dt. As we already have separate platform specific device tree parser dw_mci_socfpga_parse_dt, move the dw_mci_socfpga_priv_init code to dw_mci_socfpga_parse_dt. We can use the dw_mci_socfpga_priv_init to do some actual platform specific initialization. Signed-off-by: Yuvaraj Kumar C D Tested-by: Alim Akhtar Tested-by: Jaehoon Chung Acked-by: Seungwon Jeon --- drivers/mmc/host/dw_mmc-socfpga.c | 30 ++++++++++++++---------------- 1 files changed, 14 insertions(+), 16 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-socfpga.c b/drivers/mmc/host/dw_mmc-socfpga.c index 14b5961..4d7b999 100644 --- a/drivers/mmc/host/dw_mmc-socfpga.c +++ b/drivers/mmc/host/dw_mmc-socfpga.c @@ -38,21 +38,6 @@ struct dw_mci_socfpga_priv_data { static int dw_mci_socfpga_priv_init(struct dw_mci *host) { - struct dw_mci_socfpga_priv_data *priv; - - priv = devm_kzalloc(host->dev, sizeof(*priv), GFP_KERNEL); - if (!priv) { - dev_err(host->dev, "mem alloc failed for private data\n"); - return -ENOMEM; - } - - priv->sysreg = syscon_regmap_lookup_by_compatible("altr,sys-mgr"); - if (IS_ERR(priv->sysreg)) { - dev_err(host->dev, "regmap for altr,sys-mgr lookup failed.\n"); - return PTR_ERR(priv->sysreg); - } - host->priv = priv; - return 0; } @@ -79,12 +64,24 @@ static void dw_mci_socfpga_prepare_command(struct dw_mci *host, u32 *cmdr) static int dw_mci_socfpga_parse_dt(struct dw_mci *host) { - struct dw_mci_socfpga_priv_data *priv = host->priv; + struct dw_mci_socfpga_priv_data *priv; struct device_node *np = host->dev->of_node; u32 timing[2]; u32 div = 0; int ret; + priv = devm_kzalloc(host->dev, sizeof(*priv), GFP_KERNEL); + if (!priv) { + dev_err(host->dev, "mem alloc failed for private data\n"); + return -ENOMEM; + } + + priv->sysreg = syscon_regmap_lookup_by_compatible("altr,sys-mgr"); + if (IS_ERR(priv->sysreg)) { + dev_err(host->dev, "regmap for altr,sys-mgr lookup failed.\n"); + return PTR_ERR(priv->sysreg); + } + ret = of_property_read_u32(np, "altr,dw-mshc-ciu-div", &div); if (ret) dev_info(host->dev, "No dw-mshc-ciu-div specified, assuming 1"); @@ -96,6 +93,7 @@ static int dw_mci_socfpga_parse_dt(struct dw_mci *host) return ret; priv->hs_timing = SYSMGR_SDMMC_CTRL_SET(timing[0], timing[1]); + host->priv = priv; return 0; }