Patchwork [U-Boot,6/9] mx53smd: Return error if the SDHC port index is invalid

mail settings
Submitter Fabio Estevam
Date May 21, 2013, 5:32 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/245373/
State Changes Requested
Delegated to: Stefano Babic
Headers show


Fabio Estevam - May 21, 2013, 5:32 p.m.
When the SDHC port number index is invalid we should return an error code 

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/mx53smd/mx53smd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/board/freescale/mx53smd/mx53smd.c b/board/freescale/mx53smd/mx53smd.c
index d04f44f..a6a6bbe 100644
--- a/board/freescale/mx53smd/mx53smd.c
+++ b/board/freescale/mx53smd/mx53smd.c
@@ -137,7 +137,7 @@  int board_mmc_init(bd_t *bis)
 			printf("Warning: you configured more ESDHC controller"
 				"(%d) as supported by the board(1)\n",
-			return status;
+			return -EINVAL;
 		status |= fsl_esdhc_initialize(bis, &esdhc_cfg[index]);