From patchwork Sat Jul 31 14:45:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frans Meulenbroeks X-Patchwork-Id: 71801 X-Patchwork-Delegate: afleming@freescale.com Return-Path: X-Original-To: wd@gemini.denx.de Delivered-To: wd@gemini.denx.de Received: from diddl.denx.de (diddl.denx.de [10.0.0.6]) by gemini.denx.de (Postfix) with ESMTP id B22AE152398 for ; Sat, 31 Jul 2010 16:48:59 +0200 (CEST) Received: from diddl.denx.de (localhost.localdomain [127.0.0.1]) by diddl.denx.de (Postfix) with ESMTP id 8EF5030CF534 for ; Sat, 31 Jul 2010 16:48:59 +0200 (CEST) Received: from pop.mnet-online.de by diddl.denx.de with POP3 (fetchmail-6.3.17) for (single-drop); Sat, 31 Jul 2010 16:48:59 +0200 (CEST) Received: from murder ([192.168.8.180]) by backend2 (Cyrus v2.2.12) with LMTPA; Sat, 31 Jul 2010 16:46:02 +0200 X-Sieve: CMU Sieve 2.2 Received: from mail.m-online.net (localhost [127.0.0.1]) by frontend1.mail.m-online.net (Cyrus v2.2.12) with LMTPA; Sat, 31 Jul 2010 16:46:01 +0200 Received: from scanner-3.m-online.net (unknown [192.168.6.168]) by mail.m-online.net (Postfix) with ESMTP id A67F71C003ED; Sat, 31 Jul 2010 16:46:01 +0200 (CEST) Received: from mxin-2.m-online.net ([192.168.1.21]) by scanner-3.m-online.net (scanner-3.m-online.net [192.168.6.168]) (amavisd-new, port 10026) with ESMTP id 00412-06; Sat, 31 Jul 2010 16:46:00 +0200 (CEST) Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by mxin-2.m-online.net (Postfix) with ESMTP id 56A83468D61; Sat, 31 Jul 2010 16:45:58 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CA890281A9; Sat, 31 Jul 2010 16:45:44 +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 lnMaOv0d6uM2; Sat, 31 Jul 2010 16:45:44 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DF3932817D; Sat, 31 Jul 2010 16:45:37 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0CBAD2815C for ; Sat, 31 Jul 2010 16:45:34 +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 Vj48EL+9MpOr for ; Sat, 31 Jul 2010 16:45:32 +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 mail-ey0-f172.google.com (mail-ey0-f172.google.com [209.85.215.172]) by theia.denx.de (Postfix) with ESMTP id 0662A2812F for ; Sat, 31 Jul 2010 16:45:30 +0200 (CEST) Received: by eyb7 with SMTP id 7so885517eyb.3 for ; Sat, 31 Jul 2010 07:45:30 -0700 (PDT) Received: by 10.14.22.10 with SMTP id s10mr1555663ees.95.1280587529743; Sat, 31 Jul 2010 07:45:29 -0700 (PDT) Received: from localhost.localdomain (j200125.upc-j.chello.nl [24.132.200.125]) by mx.google.com with ESMTPS id a48sm5237801eei.12.2010.07.31.07.45.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 31 Jul 2010 07:45:29 -0700 (PDT) From: Frans Meulenbroeks To: galak@kernel.crashing.org, Mingkai.hu@freescale.com, Fleming Andy-AFLEMING , u-boot@lists.denx.de, sbabic@denx.de Date: Sat, 31 Jul 2010 16:45:18 +0200 Message-Id: <1280587518-2097-2-git-send-email-fransmeulenbroeks@gmail.com> X-Mailer: git-send-email 1.6.4.2 In-Reply-To: <1280587518-2097-1-git-send-email-fransmeulenbroeks@gmail.com> References: <1280587518-2097-1-git-send-email-fransmeulenbroeks@gmail.com> Subject: [U-Boot] [PATCH 2/2] drivers/mmc/fsl_esdhc.c: reordered tests X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de X-Virus-Scanned: by amavisd-new at m-online.net As DATA_ERROR includes the value IRQSTAT_DTOE, a timeout error would yield the first error return instead of TIMEOUT. By swapping the test TIMEOUTs are reported as such An alternate solution would be to remove the IRQSTAT_DTOE from the DATA_ERROR define but as that one might be less desired I've opted for the simplest solution Signed-off-by: Frans Meulenbroeks --- drivers/mmc/fsl_esdhc.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index f982a69..4d04920 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -305,11 +305,11 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) do { irqstat = esdhc_read32(®s->irqstat); - if (irqstat & DATA_ERR) - return COMM_ERR; - if (irqstat & IRQSTAT_DTOE) return TIMEOUT; + + if (irqstat & DATA_ERR) + return COMM_ERR; } while (!(irqstat & IRQSTAT_TC) && (esdhc_read32(®s->prsstat) & PRSSTAT_DLA)); #endif