From patchwork Tue Jan 21 10:16:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 3516161 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 424B4C02DC for ; Tue, 21 Jan 2014 10:16:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 351E22010E for ; Tue, 21 Jan 2014 10:16:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 246D920155 for ; Tue, 21 Jan 2014 10:16:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753900AbaAUKQe (ORCPT ); Tue, 21 Jan 2014 05:16:34 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:12979 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754031AbaAUKQd (ORCPT ); Tue, 21 Jan 2014 05:16:33 -0500 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 <0MZQ00LTNXVKTK60@mailout4.samsung.com> for linux-mmc@vger.kernel.org; Tue, 21 Jan 2014 19:16:32 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.116]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id E8.6E.14803.0094ED25; Tue, 21 Jan 2014 19:16:32 +0900 (KST) X-AuditID: cbfee691-b7efc6d0000039d3-39-52de49007b7b Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id AE.73.29263.0094ED25; Tue, 21 Jan 2014 19:16:32 +0900 (KST) Received: from [10.252.81.186] by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MZQ00J5FXVJ7PA0@mmp1.samsung.com>; Tue, 21 Jan 2014 19:16:31 +0900 (KST) Message-id: <52DE4918.9080701@samsung.com> Date: Tue, 21 Jan 2014 19:16:56 +0900 From: Jaehoon Chung User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-version: 1.0 To: "linux-mmc@vger.kernel.org" Cc: Chris Ball , Seungwon Jeon Subject: [PATCH 3/7] mmc: dw_mmc: replace the bus_hz checking point Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupgkeLIzCtJLcpLzFFi42JZI2JSosvgeS/I4F0Tv8WEy9sZLY7872e0 +HD/IrMDs8eNVwuZPPq2rGL0+LxJLoA5issmJTUnsyy1SN8ugStj+dL77AVfeCu2/l3C2MDY zt3FyMkhIWAi8fHaETYIW0ziwr31QDYXh5DAUkaJaydfs8AU7TwzgQUisYhR4tKLPcwQzmtG iVnLnjGCVPEKaEm8ObaVHcRmEVCVeLr7PZjNJqAjsf3bcSYQW1QgTGLqiassEPWCEj8m3wOy OThEBKwlmn/LgoSZBdwlpny8BdYqLOAssWPDI2aIuI7E/tZpbBC2vMTmNW/BbpAQaGeX+Pln ERvEXgGJb5MPgc2UEJCV2HSAGeIBSYmDK26wTGAUmYVk8ywkY2chGbuAkXkVo2hqQXJBcVJ6 kalecWJucWleul5yfu4mRmAsnP73bOIOxvsHrA8xJgOtnMgsJZqcD4ylvJJ4Q2MzIwtTE1Nj I3NLM9KElcR50x8lBQkJpCeWpGanphakFsUXleakFh9iZOLglGpgnNDw4WlQ0kWvNcJTfhvb V7b+ebuId/1Wr0XRvCrsdw7vt4xlvPD40HXWE9pmFxNzbksI3Fp0Jb8/sLXYc9Zab8ddJU9i HJ1Osjlzbvqxa+eh+Y9t9M/yuHEm8mzYbeVc7R3x2lGygOnzeY7+GRbpL4WZoruSF0ufYLkn p2n46ciXY9mOF0yClFiKMxINtZiLihMBiejcT5sCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKIsWRmVeSWpSXmKPExsVy+t9jAV0Gz3tBBhsXc1hMuLyd0eLI/35G iw/3LzI7MHvceLWQyaNvyypGj8+b5AKYoxoYbTJSE1NSixRS85LzUzLz0m2VvIPjneNNzQwM dQ0tLcyVFPISc1NtlVx8AnTdMnOANikplCXmlAKFAhKLi5X07TBNCA1x07WAaYzQ9Q0Jgusx MkADCWsYM5Yvvc9e8IW3YuvfJYwNjO3cXYycHBICJhI7z0xggbDFJC7cW8/WxcjFISSwiFHi 0os9zBDOa0aJWcueMYJU8QpoSbw5tpUdxGYRUJV4uvs9mM0moCOx/dtxJhBbVCBMYuqJqywQ 9YISPybfA7I5OEQErCWaf8uChJkF3CWmfLwF1ios4CyxY8MjZoi4jsT+1mlsELa8xOY1b5kn MPLNQjJpFpKyWUjKFjAyr2IUTS1ILihOSs811CtOzC0uzUvXS87P3cQIjrRnUjsYVzZYHGIU 4GBU4uGt3Hg3SIg1say4MvcQowQHs5II7zHHe0FCvCmJlVWpRfnxRaU5qcWHGJOBHp3ILCWa nA9MAnkl8YbGJmZGlkbmhhZGxuakCSuJ8x5otQ4UEkhPLEnNTk0tSC2C2cLEwSnVwHj6R1FK 9DT2htp0SekQqaQywVK2wryPM35xPGI/m9BrVsy7v489OWAD46R3IXrrl51g3JM3b09Ufl3h FvsNBclxcsVH580+8fi9/LLcq8rbJn1veF84Z8K18A1OpWJ3an9IihY5GuUfcds4Q5TxUgFv Y1nqpEfG54pPHOqumKfL7uBwbWZwshJLcUaioRZzUXEiAIxCSIb4AgAA 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.5 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 It's right that check immediately whether host->bus_hz is assigned or not. Signed-off-by: Jaehoon Chung --- drivers/mmc/host/dw_mmc.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index c915293..3970fc3 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2115,7 +2115,6 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) const struct dw_mci_drv_data *drv_data = host->drv_data; int ctrl_id, ret; u32 freq[2]; - u8 bus_width; mmc = mmc_alloc_host(sizeof(struct dw_mci_slot), host->dev); if (!mmc) @@ -2428,12 +2427,19 @@ int dw_mci_probe(struct dw_mci *host) ret = clk_set_rate(host->ciu_clk, host->pdata->bus_hz); if (ret) dev_warn(host->dev, - "Unable to set bus rate to %ul\n", + "Unable to set bus rate to %uHz\n", host->pdata->bus_hz); } host->bus_hz = clk_get_rate(host->ciu_clk); } + if (!host->bus_hz) { + dev_err(host->dev, + "Platform data must supply bus speed\n"); + ret = -ENODEV; + goto err_clk_ciu; + } + if (drv_data && drv_data->init) { ret = drv_data->init(host); if (ret) { @@ -2470,13 +2476,6 @@ int dw_mci_probe(struct dw_mci *host) } } - if (!host->bus_hz) { - dev_err(host->dev, - "Platform data must supply bus speed\n"); - ret = -ENODEV; - goto err_regulator; - } - host->quirks = host->pdata->quirks; spin_lock_init(&host->lock); @@ -2620,8 +2619,6 @@ err_workqueue: err_dmaunmap: if (host->use_dma && host->dma_ops->exit) host->dma_ops->exit(host); - -err_regulator: if (host->vmmc) regulator_disable(host->vmmc);