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: 5527331 Return-Path: X-Original-To: patchwork-linux-arm@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 63ED89F30B for ; Mon, 22 Dec 2014 12:22:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1736620121 for ; Mon, 22 Dec 2014 12:22:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3CC39200F3 for ; Mon, 22 Dec 2014 12:22:34 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y31y7-0003NF-Ih; Mon, 22 Dec 2014 12:20:11 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y31xw-0002gD-7o for linux-arm-kernel@lists.infradead.org; Mon, 22 Dec 2014 12:20:01 +0000 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-arm-kernel@lists.infradead.org; Mon, 22 Dec 2014 21:19:56 +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 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 KMDBqMTDy5E2PUS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tOPkt6pLpPqPzg+d4eQq8HdN2iJVbz7d zfFioTayfIyyt8+FcZbXfz/jJXKqXYbjd0TUQifNKRK/W92OaZ/onHVZWImlOCPRUIu5qDgR ACIGyarFAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141222_042000_431403_E068C948 X-CRM114-Status: GOOD ( 11.36 ) X-Spam-Score: -5.0 (-----) Cc: ulf.hansson@linaro.org, tgih.jun@samsung.com, chris@printf.net, dianders@chromium.org, jh80.chung@samsung.com, alim.akhtar@gmail.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 */