From patchwork Fri Aug 30 09:47:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuvaraj CD X-Patchwork-Id: 2851843 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 495179F2F4 for ; Fri, 30 Aug 2013 09:48:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9C87720253 for ; Fri, 30 Aug 2013 09:48:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0925820250 for ; Fri, 30 Aug 2013 09:48:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754702Ab3H3JsD (ORCPT ); Fri, 30 Aug 2013 05:48:03 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:40628 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753358Ab3H3JsD (ORCPT ); Fri, 30 Aug 2013 05:48:03 -0400 Received: by mail-pa0-f50.google.com with SMTP id fb10so2125362pad.9 for ; Fri, 30 Aug 2013 02:48:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3wiFui1Y2HxSpiDWAxj1cqh9pwR+4Iq1EsJ/dAm9uAI=; b=loVL62N72uzzRhaGdSqhZMCIBJ/1eJ2p05byce6HgM05gLr5uoY25lzZnQf1+WIv/8 AtVeqT4Lot8jGnGN1ou6m//CQL8ULKglrzPUBAKXdeI+19TgPB9SoUGy89dg+w6YqqIq Cs87G/c7u9qfIa2vqZu52qa/Er0m0rbxb2G0F3jrdJTREFVzzG2NoRoj8n2Lc5TVJxNq V/8Zr4ITTzFJhAiHArA84InluvfNgrLLEnxqj6pOGLZN2O9fNJmwgyGT7p2L605W48bK CsFuzXLeZljJUA/uDXNktoa7crnTfEFOOUVBuNRTRcG6K9FMHd5a6xSO1sLXHnBwvsZl Cm7A== X-Received: by 10.66.157.165 with SMTP id wn5mr9624710pab.169.1377856082303; Fri, 30 Aug 2013 02:48:02 -0700 (PDT) Received: from yuvaraj-ubuntu.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id lm2sm46712834pab.2.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 30 Aug 2013 02:48:01 -0700 (PDT) From: Yuvaraj Kumar C D To: linux-mmc@vger.kernel.org, linux-samsung-soc@vger.kernel.org, cjb@laptop.org, jh80.chung@samsung.com, tgih.jun@samsung.com Cc: ks.giri@samsung.com, t.figa@samsung.com, alim.akhtar@samsung.com, dianders@chromium.org, Yuvaraj Kumar C D Subject: [RFC V4 1/4] mmc: dw_mmc: exynos: move the exynos private init Date: Fri, 30 Aug 2013 15:17:40 +0530 Message-Id: <1377856063-3391-2-git-send-email-yuvaraj.cd@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1377856063-3391-1-git-send-email-yuvaraj.cd@samsung.com> References: <1377856063-3391-1-git-send-email-yuvaraj.cd@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Currently platform specific private data initialisation is done by dw_mci_exynos_priv_init and dw_mci_exynos_parse_dt.As we already have separate platform specific device tree parser dw_mci_exynos_parse_dt, move the dw_mci_exynos_priv_init code to dw_mci_exynos_parse_dt. We can use the dw_mci_exynos_priv_init to do some actual platform specific initialisation of SMU and etc. changes since V3: none changes since V2: none changes since V1: none Signed-off-by: Yuvaraj Kumar C D --- drivers/mmc/host/dw_mmc-exynos.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c index 9990f98..19c845b 100644 --- a/drivers/mmc/host/dw_mmc-exynos.c +++ b/drivers/mmc/host/dw_mmc-exynos.c @@ -72,22 +72,8 @@ static struct dw_mci_exynos_compatible { static int dw_mci_exynos_priv_init(struct dw_mci *host) { - struct dw_mci_exynos_priv_data *priv; - int idx; - - priv = devm_kzalloc(host->dev, sizeof(*priv), GFP_KERNEL); - if (!priv) { - dev_err(host->dev, "mem alloc failed for private data\n"); - return -ENOMEM; - } - - for (idx = 0; idx < ARRAY_SIZE(exynos_compat); idx++) { - if (of_device_is_compatible(host->dev->of_node, - exynos_compat[idx].compatible)) - priv->ctrl_type = exynos_compat[idx].ctrl_type; - } + struct dw_mci_exynos_priv_data *priv = host->priv; - host->priv = priv; return 0; } @@ -177,12 +163,24 @@ static void dw_mci_exynos_set_ios(struct dw_mci *host, struct mmc_ios *ios) static int dw_mci_exynos_parse_dt(struct dw_mci *host) { - struct dw_mci_exynos_priv_data *priv = host->priv; + struct dw_mci_exynos_priv_data *priv; struct device_node *np = host->dev->of_node; u32 timing[2]; u32 div = 0; + int idx; 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; + } + + for (idx = 0; idx < ARRAY_SIZE(exynos_compat); idx++) { + if (of_device_is_compatible(np, exynos_compat[idx].compatible)) + priv->ctrl_type = exynos_compat[idx].ctrl_type; + } + of_property_read_u32(np, "samsung,dw-mshc-ciu-div", &div); priv->ciu_div = div; @@ -199,6 +197,7 @@ static int dw_mci_exynos_parse_dt(struct dw_mci *host) return ret; priv->ddr_timing = SDMMC_CLKSEL_TIMING(timing[0], timing[1], div); + host->priv = priv; return 0; }