From patchwork Mon Mar 3 02:36:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 3750691 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 0ECA49F35F for ; Mon, 3 Mar 2014 02:36:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1F8852038C for ; Mon, 3 Mar 2014 02:36:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CEE6820395 for ; Mon, 3 Mar 2014 02:36:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752060AbaCCCgU (ORCPT ); Sun, 2 Mar 2014 21:36:20 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:16029 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751883AbaCCCgT (ORCPT ); Sun, 2 Mar 2014 21:36:19 -0500 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N1U002L89WHIWB0@mailout3.samsung.com> for linux-mmc@vger.kernel.org; Mon, 03 Mar 2014 11:36:17 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.116]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 4E.78.12635.1AAE3135; Mon, 03 Mar 2014 11:36:17 +0900 (KST) X-AuditID: cbfee68d-b7fcd6d00000315b-da-5313eaa1a52a Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 92.56.28157.1AAE3135; Mon, 03 Mar 2014 11:36:17 +0900 (KST) Received: from [10.252.81.186] by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N1U00GGA9WG1JQ0@mmp2.samsung.com>; Mon, 03 Mar 2014 11:36:16 +0900 (KST) Message-id: <5313EABA.8020103@samsung.com> Date: Mon, 03 Mar 2014 11:36:42 +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 , Ulf Hansson , Seungwon Jeon Subject: [PATCH v4 2/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+NgFupnkeLIzCtJLcpLzFFi42JZI2JSorvwlXCwwcz1ihYTLm9ntDjyv5/R 4sP9i8wWx9eGO7B43Lm2h83jxquFTB59W1YxenzeJBfAEsVlk5Kak1mWWqRvl8CV0bP7AlvB Et6K/VesGxiPcnUxcnJICJhInFzaxA5hi0lcuLeerYuRi0NIYCmjxOcJl5hhiu43zGeBSExn lFj+qhnKec0o8eX7LxaQKl4BLYnX126ygtgsAqoSc299BbPZBHQktn87zgRiiwqESUw9cRWq XlDix+R7QDYHh4iAtUTzb1mQMLNAvsT3vTPZQGxhATeJMy/3sEDEdST2t05jg7DlJTaveQt1 XD+7xKTPphBrBSS+TT4ENlJCQFZi0wGoEkmJgytusExgFJmFZPEsJFNnIZm6gJF5FaNoakFy QXFSepGhXnFibnFpXrpecn7uJkZgZJz+96x3B+PtA9aHGJOBVk5klhJNzgdGVl5JvKGxmZGF qYmpsZG5pRlpwkrivEkPk4KEBNITS1KzU1MLUovii0pzUosPMTJxcEo1MNpUNkz+zqevvn3+ l1tlaS+4Mqujnh6b23D/QprLKdP9H9/HJm5n/hIv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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=-6.9 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 Acked-by: Ulf Hansson --- Changelog V4: - Fixed the compile warning. Changelog V3: - Maintained original place for the drv_data->setup_clock Changelog V2: - When drv_data->setup_clock is present, set to bus_hz with it. drivers/mmc/host/dw_mmc.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 8193e21..3970fc3 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2427,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) { @@ -2469,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); @@ -2619,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);