From: Fabio Estevam Date: Tue, 21 May 2013 14:32:15 -0300 Subject: [U-Boot] [PATCH 2/9] mx53loco: Return error if the SDHC port index is invalid In-Reply-To: <1369157542-25734-1-git-send-email-fabio.estevam@freescale.com> References: <1369157542-25734-1-git-send-email-fabio.estevam@freescale.com> Message-ID: <1369157542-25734-2-git-send-email-fabio.estevam@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@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/mx53loco/mx53loco.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c index 10e9d36..f1b2c40 100644 --- a/board/freescale/mx53loco/mx53loco.c +++ b/board/freescale/mx53loco/mx53loco.c @@ -204,7 +204,7 @@ int board_mmc_init(bd_t *bis) printf("Warning: you configured more ESDHC controller" "(%d) as supported by the board(2)\n", CONFIG_SYS_FSL_ESDHC_NUM); - return status; + return -EINVAL; } status |= fsl_esdhc_initialize(bis, &esdhc_cfg[index]); } -- 1.8.1.2