From patchwork Mon Dec 22 12:12:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alim Akhtar X-Patchwork-Id: 5527311 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 189BCBEEA8 for ; Mon, 22 Dec 2014 12:20:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 42EA420121 for ; Mon, 22 Dec 2014 12:20:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 542522010C for ; Mon, 22 Dec 2014 12:19:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754503AbaLVMT6 (ORCPT ); Mon, 22 Dec 2014 07:19:58 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:15468 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754401AbaLVMT6 (ORCPT ); Mon, 22 Dec 2014 07:19:58 -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 <0NGZ006GNGX8G500@mailout3.samsung.com> for linux-mmc@vger.kernel.org; Mon, 22 Dec 2014 21:19:57 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.48]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id DA.0E.17016.A6C08945; Mon, 22 Dec 2014 21:19:54 +0900 (KST) X-AuditID: cbfee68d-f79296d000004278-43-54980c6a4405 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id BE.DA.09430.A6C08945; Mon, 22 Dec 2014 21:19:54 +0900 (KST) Received: from chromebld-server.sisodomain.com ([107.108.73.106]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NGZ00D8BGVL9860@mmp2.samsung.com>; Mon, 22 Dec 2014 21:19:54 +0900 (KST) From: Alim Akhtar To: linux-mmc@vger.kernel.org Cc: chris@printf.net, ulf.hansson@linaro.org, jh80.chung@samsung.com, tgih.jun@samsung.com, dianders@chromium.org, alim.akhtar@gmail.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 2/3] mmc: dw_mmc: exynos: don't use if clock isn't available Date: Mon, 22 Dec 2014 17:42:03 +0530 Message-id: <1419250324-11743-3-git-send-email-alim.akhtar@samsung.com> X-Mailer: git-send-email 2.2.0 In-reply-to: <1419250324-11743-1-git-send-email-alim.akhtar@samsung.com> References: <1419250324-11743-1-git-send-email-alim.akhtar@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBLMWRmVeSWpSXmKPExsVy+t8zA90snhkhBgs3a1osvVVtMeHydkaL s8sOslnc+NXGarHp8TVWiyP/+xktPty/yGxxfG24A4fH7IaLLB47Z91l97hzbQ+bx+Yl9R43 Xi1k8ujbsorR4/MmuQD2KC6blNSczLLUIn27BK6MGxv72Qu2c1UcvZXWwHiao4uRk0NCwERi xsHvzBC2mMSFe+vZuhi5OIQEljFKbFnSwwRTtPDHbajEdEaJ5TMOMkM4E5gkOn5eYAOpYhPQ lrg7fQtYh4iArMTPPxfAOpgFNjFKrPj8kxUkISzgLzGx9R4jiM0ioCrxedFjsGZeAXeJQ3ff s0Gsk5PYcusRO4jNKeAhcXnOA7ChQkA1z/dcB9ssIbCMXeJ29zJWiEECEt8mH2LpYuQASshK bDoA9Y+kxMEVN1gmMAovYGRYxSiaWpBcUJyUXmSoV5yYW1yal66XnJ+7iRESAb07GG8fsD7E KMDBqMTDy5E2PUSINbGsu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6pLpPqPzg+d4eQq8HdN2iJVbz7d zfFioTayfIyyt8+FcZbXfz/jJXKqXYbjd0TUQifNKRK/W92OaZ/onHVZWImlOCPRUIu5qDgR ACIGyarFAgAA 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=-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 From: Seungwon Jeon Add checking whether the clock is valid. Signed-off-by: Seungwon Jeon Acked-by: Jaehoon Chung Signed-off-by: Alim Akhtar --- drivers/mmc/host/dw_mmc-exynos.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c index 509365c..556663f 100644 --- a/drivers/mmc/host/dw_mmc-exynos.c +++ b/drivers/mmc/host/dw_mmc-exynos.c @@ -127,9 +127,9 @@ 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); - host->bus_hz = rate / (priv->ciu_div + 1); + host->bus_hz /= (priv->ciu_div + 1); + return 0; } @@ -232,8 +232,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 */