From patchwork Mon Feb 3 11:20:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 3568901 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 E72979F2F5 for ; Mon, 3 Feb 2014 11:20:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 28510201E9 for ; Mon, 3 Feb 2014 11:20:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 48DC5201D5 for ; Mon, 3 Feb 2014 11:20:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750849AbaBCLUN (ORCPT ); Mon, 3 Feb 2014 06:20:13 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:11262 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750716AbaBCLUM (ORCPT ); Mon, 3 Feb 2014 06:20:12 -0500 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N0F002W03HMU4D0@mailout1.samsung.com> for linux-mmc@vger.kernel.org; Mon, 03 Feb 2014 20:20:10 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.116]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id A3.53.14803.A6B7FE25; Mon, 03 Feb 2014 20:20:10 +0900 (KST) X-AuditID: cbfee691-b7efc6d0000039d3-44-52ef7b6a4d2d Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 33.D1.28157.A6B7FE25; Mon, 03 Feb 2014 20:20:10 +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 <0N0F001UF3HM1350@mmp1.samsung.com>; Mon, 03 Feb 2014 20:20:10 +0900 (KST) Message-id: <52EF7B6A.6040901@samsung.com> Date: Mon, 03 Feb 2014 20:20:10 +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 v3 3/8] 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+NgFmpnkeLIzCtJLcpLzFFi42JZI2JSoptV/T7IYNoPU4vtrzeyWRz5389o 8eH+RWYHZo9DV9YyevRtWcXo8XmTXABzFJdNSmpOZllqkb5dAlfGzIfzWQru8ldMW7ORpYFx F08XIyeHhICJxOZpF5ggbDGJC/fWs3UxcnEICSxllDh75AsbTNG3hX9ZIBKLGCVmX29jhXBe M0qc+7yFHaSKV0BL4uWrhYxdjBwcLAKqEueemoGE2QR0JLZ/Ow62QVQgTGLqiassEOWCEj8m 32MBKRcRsJZo/i0LEmYWcJd4efweWLmwgJvEj6PX2CHiOhL7W6exQdjyEpvXvGUGOUFCoJtd YsabvWBFLAICEt8mHwKbKSEgK7HpADPE/ZISB1fcYJnAKDILyeZZSMbOQjJ2ASPzKkbR1ILk guKk9CJTveLE3OLSvHS95PzcTYzASDj979nEHYz3D1gfYkwGWjmRWUo0OR8YSXkl8YbGZkYW piamxkbmlmakCSuJ86Y/SgoSEkhPLEnNTk0tSC2KLyrNSS0+xMjEwSnVwKh3NvnGOqHmfWEa h5ltvva+dnRP9mLfLbn2SZzy+znTTmi9e/TK94RQ5pFVl1g8Z/zjStO96L1ym8LxrO3Ky1YG 60hE/9n4lPEz05yrDYr6j1tuLX0x3StaUN32saAA9yXBSfHdDXd8lBvuJ6asm2iaVio/+8W1 I2fmllxr7bkWzvxa/UXXC0ElluKMREMt5qLiRABBSPqImgIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCIsWRmVeSWpSXmKPExsVy+t9jAd2s6vdBBpuv6llsf72RzeLI/35G iw/3LzI7MHscurKW0aNvyypGj8+b5AKYoxoYbTJSE1NSixRS85LzUzLz0m2VvIPjneNNzQwM dQ0tLcyVFPISc1NtlVx8AnTdMnOANikplCXmlAKFAhKLi5X07TBNCA1x07WAaYzQ9Q0Jgusx MkADCWsYM2Y+nM9ScJe/YtqajSwNjLt4uhg5OSQETCS+LfzLAmGLSVy4t56ti5GLQ0hgEaPE 7OttrBDOa0aJc5+3sINU8QpoSbx8tZCxi5GDg0VAVeLcUzOQMJuAjsT2b8eZQGxRgTCJqSeu skCUC0r8mHyPBaRcRMBaovm3LEiYWcBd4uXxe2DlwgJuEj+OXmOHiOtI7G+dxgZhy0tsXvOW eQIj3ywkk2YhKZuFpGwBI/MqRtHUguSC4qT0XCO94sTc4tK8dL3k/NxNjOA4eya9g3FVg8Uh RgEORiUe3o6974KEWBPLiitzDzFKcDArifCmVb4PEuJNSaysSi3Kjy8qzUktPsSYDPTnRGYp 0eR8YArIK4k3NDYxM7I0Mje0MDI2J01YSZz3YKt1oJBAemJJanZqakFqEcwWJg5OqQbGor8T l/csybtus+zxVM5FnJ9+nd3lsk+m8+vV7NdrvliefvTl3d/p99cuXLQi88Hz96yS0w2YTr36 up6dXXjp++cdPyPSPfueczo6ParIYJS3armyg13it0rYbGnJpH2Nq8uDnlQry1769nySR/Wc v22aj7eoiqixr3O5O61MIFj4wzqLqRVM25RYijMSDbWYi4oTAVlC8Tr3AgAA 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.4 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 --- 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 | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 8193e21..e7357b8 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) { @@ -2445,8 +2452,8 @@ int dw_mci_probe(struct dw_mci *host) if (drv_data && drv_data->setup_clock) { ret = drv_data->setup_clock(host); if (ret) { - dev_err(host->dev, - "implementation specific clock setup failed\n"); + dev_err(host->dev, "implementation specific " + "clock setup failed\n"); goto err_clk_ciu; } } @@ -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);