[U-Boot] [PATCH 3/9] mx51evk: Return error if the SDHC port index is invalid

Fabio Estevam fabio.estevam at freescale.com
Tue May 21 19:32:16 CEST 2013


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 <fabio.estevam at freescale.com>
---
 board/freescale/mx51evk/mx51evk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c
index 369da6d..80749eb 100644
--- a/board/freescale/mx51evk/mx51evk.c
+++ b/board/freescale/mx51evk/mx51evk.c
@@ -356,7 +356,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




More information about the U-Boot mailing list