From patchwork Mon Feb 18 10:12:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 2156751 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C27ADDF25A for ; Mon, 18 Feb 2013 10:12:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757601Ab3BRKMB (ORCPT ); Mon, 18 Feb 2013 05:12:01 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:18921 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754751Ab3BRKMA (ORCPT ); Mon, 18 Feb 2013 05:12:00 -0500 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MIE00DRCUYU7101@mailout2.samsung.com> for linux-mmc@vger.kernel.org; Mon, 18 Feb 2013 19:11:58 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.45]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id D1.08.06456.E6EF1215; Mon, 18 Feb 2013 19:11:58 +0900 (KST) X-AuditID: cbfee68e-b7fc26d000001938-46-5121fe6ec6a6 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 61.58.03918.E6EF1215; Mon, 18 Feb 2013 19:11:58 +0900 (KST) Received: from [10.90.51.55] by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MIE00FJQUZYFIE0@mmp2.samsung.com> for linux-mmc@vger.kernel.org; Mon, 18 Feb 2013 19:11:58 +0900 (KST) Message-id: <5121FE73.5010206@samsung.com> Date: Mon, 18 Feb 2013 19:12:03 +0900 From: Jaehoon Chung User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-version: 1.0 To: linux-mmc@vger.kernel.org Cc: 'Chris Ball' , Seungwon Jeon , Thomas Abraham , Kyungmin Park Subject: [PATCH 1/2] mmc: dw-mmc: check the host->bus_hz before calling Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrKLMWRmVeSWpSXmKPExsVy+t8zXd28f4qBBs/u6Vgc+d/P6MDo8XmT XABjFJdNSmpOZllqkb5dAldG7/Z25oJPHBV/l9s0MM5l72Lk5JAQMJHoubyCCcIWk7hwbz1b FyMXh5DAMkaJJZt/scAU7X50BSoxnVHi1pK9LBBOO5NE//79YO28AloSM3dNZwOxWQRUJY7O egu2gk1AR2L7t+NgNaICYRIrp19hgagXlPgx+R6YLSIgK/HzzwWwDcwCixgl2r5tAmsWFnCX OPFyKZjNDDRof+s0NghbXmLzmrfMIA0SAs/ZJHpnnGaG2Cwg8W3yIaCpHEAJWYlNB5ghXpCU OLjiBssERpFZSHbPQjJ2FpKxCxiZVzGKphYkFxQnpRcZ6RUn5haX5qXrJefnbmKEBHnfDsab B6wPMSYDrZzILCWanA+MkrySeENjA2NDQ0tDM1NLUwPShJXEeeUvyQQKCaQnlqRmp6YWpBbF F5XmpBYfYmTi4JRqYNROdXnnK7w87W2XhsiVg5Oni/JudP335Ozng30+YWsWrxFf9+rz1D8f /ky/auJlv/Y9m4WCVMChnQtEuHcxCZifcagtMD4WbnolQ/2O77dMhgxG+TXLsxLKW6Pv++/y KjxQfqr4TpSFdJCQwv1dVhWbK0//OafA06yxcaeowW2+czmTeOq4TimxFGckGmoxFxUnAgCe kJE1iAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrEIsWRmVeSWpSXmKPExsVy+t9jQd28f4qBBh+XqFgc+d/P6MDo8XmT XABjVAOjTUZqYkpqkUJqXnJ+SmZeuq2Sd3C8c7ypmYGhrqGlhbmSQl5ibqqtkotPgK5bZg7Q VCWFssScUqBQQGJxsZK+HaYJoSFuuhYwjRG6viFBcD1GBmggYR1jRu/2duaCTxwVf5fbNDDO Ze9i5OSQEDCR2P3oChuELSZx4d56IJuLQ0hgOqPErSV7WSCcdiaJ/v37mUCqeAW0JGbumg7W wSKgKnF01luwSWwCOhLbvx0HqxEVCJNYOf0KC0S9oMSPyffAbBEBWYmffy6AbWAWWMQo0fZt E1izsIC7xImXS8FsZqBB+1unsUHY8hKb17xlnsDINwvJrFlIymYhKVvAyLyKUTS1ILmgOCk9 11CvODG3uDQvXS85P3cTIziGnkntYFzZYHGIUYCDUYmHlyFfMVCINbGsuDL3EKMEB7OSCG/7 HaAQb0piZVVqUX58UWlOavEhxmSgVycyS4km5wPjO68k3tDYxMzI0sjM2MTc2Jg0YSVxXsZT TwKEBNITS1KzU1MLUotgtjBxcEo1MDIc/KTQy6L+KS/9fmRrrO3jxy3LzHa6Tk1Q0Xd+8/TP C79/j2q/ha6x/c2ltcPl+DeWCSeOPd0jv2wR1/fYnkT+rVudmD9+Mz0/52h9rlTWlm9O+5Pu 1Wo61vL0v1xwrn1SbebuyQ47P3qzaG+wfK96dNvub1NY100Q2MAxWzLyZoXdEQMeznwlluKM REMt5qLiRABkxKiL5QIAAA== 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 Check whether host->bus_hz is zero or not. before calling drv_data->setup_clock. Signed-off-by: Jaehoon Chung Signed-off-by: Kyungmin Park --- drivers/mmc/host/dw_mmc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 60063cc..c59078c 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2203,6 +2203,13 @@ int dw_mci_probe(struct dw_mci *host) else 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->setup_clock) { ret = drv_data->setup_clock(host); if (ret) { @@ -2212,13 +2219,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_clk_ciu; - } - host->quirks = host->pdata->quirks; spin_lock_init(&host->lock);