From patchwork Wed Mar 26 11:31:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seungwon Jeon X-Patchwork-Id: 3892841 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 2CF90BF540 for ; Wed, 26 Mar 2014 11:31:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5F89A20172 for ; Wed, 26 Mar 2014 11:31:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C3D2320222 for ; Wed, 26 Mar 2014 11:31:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751674AbaCZLbK (ORCPT ); Wed, 26 Mar 2014 07:31:10 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:54304 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751614AbaCZLbI (ORCPT ); Wed, 26 Mar 2014 07:31:08 -0400 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N31004UOJZVQH20@mailout4.samsung.com>; Wed, 26 Mar 2014 20:31:07 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.50]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id B1.3A.12635.B7AB2335; Wed, 26 Mar 2014 20:31:07 +0900 (KST) X-AuditID: cbfee68d-b7fcd6d00000315b-be-5332ba7be621 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 4F.6E.28157.B7AB2335; Wed, 26 Mar 2014 20:31:07 +0900 (KST) Received: from DOTGIHJUN01 ([12.36.185.168]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N31003LYJZV3N50@mmp1.samsung.com>; Wed, 26 Mar 2014 20:31:07 +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' References: In-reply-to: Subject: [PATCH v2 2/7] mmc: dw_mmc: exynos: don't use if clock isn't available Date: Wed, 26 Mar 2014 20:31:06 +0900 Message-id: <000201cf48e6$e05f8cb0$a11ea610$%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: Ac9FDjtZo1aMTMCOStGdx+bxiO4TmwD1P6hw Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJIsWRmVeSWpSXmKPExsVy+t8zI93qXUbBBg2f5SwezNvGZjHh8nZG ixu/2lgtehdcZbM48r+f0WLG+X1MFsfXhjuwe9y5tofN48arhUwefVtWMXp83iQXwBLFZZOS mpNZllqkb5fAlfH22WTWgsWcFR+OPGdpYDzO3sXIySEhYCKx8eMXZghbTOLCvfVsXYxcHEIC yxglDnQ8ZoIp+rDkJStEYhGjxK0dC1kgnD+MEkevbWUFqWIT0JL4++YN2CgRAQeJd9cvgHUz C5xglJi32LiLkQOogVtidXMQSJhTgEdi3Z9OsHJhAX+J+RvfgdksAqoS9+7dZgSxeQVsJRZv b2SFsAUlfky+xwIyhllAXWLKlFyI6fISm9e8ZQYJSwCFH/3VhTjASKK9YSIzRImIxL4X7xhB LpYQuMcuMfvwcUaIVQIS3yYfYoHolZXYdAAaDpISB1fcYJnAKDELyeJZCItnIVk8C8mGBYws qxhFUwuSC4q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+2nrPLiv4dnQDW2RDSGP2lJD0qS9iVxvpX59zN3iW RjzLkS52Dk/GrtSH2lKat3jEpCIqK4qUK8/nv1/xZ7sKzzrmClvPvafqhCZvTRDTmMUvvCS/ x6WCwU5qgtczhqyAg/EKhtcPZGxfzsW3/PpUl9QSBSWW4oxEQy3mouJEAIZjAHdJAwAA 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.3 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 Add checking whether the clock is valid. Signed-off-by: Seungwon Jeon Acked-by: Jaehoon Chung --- drivers/mmc/host/dw_mmc-exynos.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c index a67e784..a2d06c5 100644 --- a/drivers/mmc/host/dw_mmc-exynos.c +++ b/drivers/mmc/host/dw_mmc-exynos.c @@ -117,9 +117,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; } @@ -196,8 +196,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 */