From patchwork Thu Aug 25 07:07:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 662679 X-Patchwork-Delegate: jh80.chung@samsung.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3sKZxY3g8Zz9sCy for ; Thu, 25 Aug 2016 17:07:29 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b=x1G237sS; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9341EA75F3; Thu, 25 Aug 2016 09:06:48 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R5vTE63VXV3A; Thu, 25 Aug 2016 09:06:48 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 888E6A75F5; Thu, 25 Aug 2016 09:06:28 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E800C4BD3D for ; Thu, 25 Aug 2016 09:06:05 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1-KA5G8Hc1Jy for ; Thu, 25 Aug 2016 09:06:05 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76]) by theia.denx.de (Postfix) with ESMTPS id 2813C4BDBD for ; Thu, 25 Aug 2016 09:06:00 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id u7P75YOw012634; Thu, 25 Aug 2016 16:05:35 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com u7P75YOw012634 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1472108735; bh=Yp1gbCgMewtTWmvx8daz4pLBwotKDpuIATYHR5qVzV4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x1G237sS2kuI0vP0s/bDZUaX2XoE4lZR+Zc5LKOsrH7gY9SPqmUXkvJcnW6UH2fZH CA8gPDfe69z57LFzH4XvZp6g9hJQhE2XZjAmhaPcEcYeAfv44Cc6OpNiDeqv9yznvb M0xFJlfuVu1YJV0tBT93FzAuQjePGnCDX2OLHyzCOW6KuxRIbkuuM+Kw/x2R/axqtm pZi3goAOgRry6UlwlKoG3uqHuNi1qbhcbJrpbdfx3PD+pEFKZtTPnQh5arPkDpBcix bLy8d78qbhD6xwR6qLSuyibOaYVadzxuEiContL616lVuqpYb1iVdRDkhxFnnLlRlK PPw9yC9og7m/Q== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 25 Aug 2016 16:07:35 +0900 Message-Id: <1472108859-19262-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1472108859-19262-1-git-send-email-yamada.masahiro@socionext.com> References: <1472108859-19262-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH v2 2/6] mmc: sdhci: move error message to more relevant place X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" "Hardware doesn't specify base clock frequency" may not be only the error case of sdhci_setup_cfg(). It is better to print this where the corresponding error is triggered. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/mmc/sdhci.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index 91cc8b2..d886777 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -536,8 +536,11 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host, SDHCI_CLOCK_BASE_SHIFT; cfg->f_max *= 1000000; } - if (cfg->f_max == 0) + if (cfg->f_max == 0) { + printf("%s: Hardware doesn't specify base clock frequency\n", + __func__); return -EINVAL; + } if (min_clk) cfg->f_min = min_clk; else { @@ -577,6 +580,8 @@ int sdhci_bind(struct udevice *dev, struct mmc *mmc, struct mmc_config *cfg) #else int add_sdhci(struct sdhci_host *host, u32 max_clk, u32 min_clk) { + int ret; + #ifdef CONFIG_MMC_SDMA unsigned int caps; @@ -588,11 +593,9 @@ int add_sdhci(struct sdhci_host *host, u32 max_clk, u32 min_clk) } #endif - if (sdhci_setup_cfg(&host->cfg, host, max_clk, min_clk)) { - printf("%s: Hardware doesn't specify base clock frequency\n", - __func__); - return -EINVAL; - } + ret = sdhci_setup_cfg(&host->cfg, host, max_clk, min_clk); + if (ret) + return ret; if (host->quirks & SDHCI_QUIRK_BROKEN_VOLTAGE) host->cfg.voltages |= host->voltages;