From patchwork Tue May 21 17:32:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 245368 X-Patchwork-Delegate: sbabic@denx.de 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 93A472C0096 for ; Wed, 22 May 2013 03:33:53 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5649D4A0BF; Tue, 21 May 2013 19:33:43 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 jkFs8xEaJ69x; Tue, 21 May 2013 19:33:43 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DD7014A095; Tue, 21 May 2013 19:33:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2A1C34A040 for ; Tue, 21 May 2013 19:33:20 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 lSpw+U-c0AaS for ; Tue, 21 May 2013 19:33:15 +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 co9outboundpool.messaging.microsoft.com (co9ehsobe005.messaging.microsoft.com [207.46.163.28]) by theia.denx.de (Postfix) with ESMTPS id 7D8DF4A044 for ; Tue, 21 May 2013 19:33:10 +0200 (CEST) Received: from mail167-co9-R.bigfish.com (10.236.132.230) by CO9EHSOBE006.bigfish.com (10.236.130.69) with Microsoft SMTP Server id 14.1.225.23; Tue, 21 May 2013 17:33:08 +0000 Received: from mail167-co9 (localhost [127.0.0.1]) by mail167-co9-R.bigfish.com (Postfix) with ESMTP id 4A7574C0894; Tue, 21 May 2013 17:33:08 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ah1fc6hzz8275bhz2dh2a8h668h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1d0ch1d2eh1d3fh1155h) Received: from mail167-co9 (localhost.localdomain [127.0.0.1]) by mail167-co9 (MessageSwitch) id 1369157586846829_23706; Tue, 21 May 2013 17:33:06 +0000 (UTC) Received: from CO9EHSMHS005.bigfish.com (unknown [10.236.132.254]) by mail167-co9.bigfish.com (Postfix) with ESMTP id CCCE548005D; Tue, 21 May 2013 17:33:06 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CO9EHSMHS005.bigfish.com (10.236.130.15) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 21 May 2013 17:33:05 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.2.328.11; Tue, 21 May 2013 17:33:44 +0000 Received: from fabio-OptiPlex-7010.am.freescale.net ([10.29.244.124]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r4LHWsxQ022167; Tue, 21 May 2013 10:33:03 -0700 From: Fabio Estevam To: Date: Tue, 21 May 2013 14:32:20 -0300 Message-ID: <1369157542-25734-7-git-send-email-fabio.estevam@freescale.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1369157542-25734-1-git-send-email-fabio.estevam@freescale.com> References: <1369157542-25734-1-git-send-email-fabio.estevam@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com Cc: Fabio Estevam , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 7/9] mx6qarm2: Return error if the SDHC port index is invalid X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de When the SDHC port number index is invalid we should return an error code immediately. Currently we return 'status', which has a value of zero, causing board_mmc_init() to incorrectly return sucess. Fix this by returning -EINVAL instead. Signed-off-by: Fabio Estevam --- board/freescale/mx6qarm2/mx6qarm2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/freescale/mx6qarm2/mx6qarm2.c b/board/freescale/mx6qarm2/mx6qarm2.c index e336746..e3e0b76 100644 --- a/board/freescale/mx6qarm2/mx6qarm2.c +++ b/board/freescale/mx6qarm2/mx6qarm2.c @@ -156,7 +156,7 @@ int board_mmc_init(bd_t *bis) printf("Warning: you configured more USDHC controllers" "(%d) then supported by the board (%d)\n", index + 1, CONFIG_SYS_FSL_USDHC_NUM); - return status; + return -EINVAL; } status |= fsl_esdhc_initialize(bis, &usdhc_cfg[index]);