From patchwork Fri Mar 21 14:03:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seungwon Jeon X-Patchwork-Id: 3874541 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 B21EDBF540 for ; Fri, 21 Mar 2014 14:03:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EEE4A2028D for ; Fri, 21 Mar 2014 14:03:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C0B3A20279 for ; Fri, 21 Mar 2014 14:03:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754274AbaCUODX (ORCPT ); Fri, 21 Mar 2014 10:03:23 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:26890 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752867AbaCUODW (ORCPT ); Fri, 21 Mar 2014 10:03:22 -0400 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N2S00CTNHPLJAD0@mailout2.samsung.com>; Fri, 21 Mar 2014 23:03:21 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.49]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id 1D.B9.10364.9A64C235; Fri, 21 Mar 2014 23:03:21 +0900 (KST) X-AuditID: cbfee690-b7f266d00000287c-7e-532c46a902ed Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id B0.37.28157.9A64C235; Fri, 21 Mar 2014 23:03:21 +0900 (KST) Received: from DOTGIHJUN01 ([12.36.185.168]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N2S00D4KHPL5C90@mmp2.samsung.com>; Fri, 21 Mar 2014 23:03:21 +0900 (KST) From: Seungwon Jeon To: linux-samsung-soc@vger.kernel.org, linux-mmc@vger.kernel.org Cc: 'Chris Ball' , 'Kukjin Kim' , 'Jaehoon Chung' , 'Ulf Hansson' , 'Alim Akhtar' Subject: [PATCH 2/7] mmc: dw_mmc: exynos: don't use if clock isn't available Date: Fri, 21 Mar 2014 23:03:21 +0900 Message-id: <001c01cf450e$51ba0d40$f52e27c0$%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: Ac9FDlGXBwGRChrwTgu7M7VJED3oXQ== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrAIsWRmVeSWpSXmKPExsVy+t8zQ92VbjrBBh+2ils8mLeNzWLC5e2M Fjd+tbFa9C64ymZx5H8/o8WM8/uYLI6vDXdg97hzbQ+bx41XC5k8+rasYvT4vEkugCWKyyYl NSezLLVI3y6BK2PW0l7Ggh+cFXv3fGJqYJzA0cXIySEhYCLxevtdZghbTOLCvfVsXYxcHEIC yxglFt+fygZTdKzpG1RiOqPEj5sf2CGcP4wSa6ZOYwSpYhPQkvj75g3YKBEBB4l31y8wgdjM AicYJeYtNu5i5OAQFvCROLHWGiTMIqAqcelpAyuIzStgK7H78R8oW1Dix+R7LCDlzALqElOm 5EJMkZfYvOYtM0hYAij86K8uxCI9ifbdN5ghSkQk9r14xwhx8il2iSWnwiA2CUh8m3yIBaJV VmLTAah3JSUOrrjBMoFRbBaSvbMQ9s5CsncWkgULGFlWMYqmFiQXFCelF5noFSfmFpfmpesl 5+duYoTE3oQdjPcOWB9iTAbaPpF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n8sLJ48Yq3EYv cx+vT/SyDpfrjavjOLA94emC+JvrDR7+lxJTvDQrel7I5cQr/xuVouO2zZ03cUGpdumSx0U3 GRL2uX2pWKy4wWam6jYlluKMREMt5qLiRAArV4aiMQMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected 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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 Adds checking whether the clock is valid. Signed-off-by: Seungwon Jeon --- drivers/mmc/host/dw_mmc-exynos.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c index a67e784..89aa019 100644 --- a/drivers/mmc/host/dw_mmc-exynos.c +++ b/drivers/mmc/host/dw_mmc-exynos.c @@ -117,7 +117,12 @@ static int dw_mci_exynos_priv_init(struct dw_mci *host) static int dw_mci_exynos_setup_clock(struct dw_mci *host) { struct dw_mci_exynos_priv_data *priv = host->priv; - unsigned long rate = clk_get_rate(host->ciu_clk); + unsigned long rate; + + if (IS_ERR(host->ciu_clk)) + rate = host->bus_hz; + else + rate = clk_get_rate(host->ciu_clk); host->bus_hz = rate / (priv->ciu_div + 1); return 0; @@ -196,8 +201,11 @@ static void dw_mci_exynos_set_ios(struct dw_mci *host, struct mmc_ios *ios) mci_writel(host, CLKSEL, priv->sdr_timing); } - /* Don't care if wanted clock is zero */ - if (!wanted) + /* + * Don't care if wanted clock is zero or + * ciu clock is unavailable + */ + if (!wanted || IS_ERR(host->ciu_clk)) return; /* Guaranteed minimum frequency for cclkin */