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

Message ID 1369157542-25734-9-git-send-email-fabio.estevam@freescale.com
State Changes Requested
Delegated to: Stefano Babic
Headers show

Commit Message

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


diff --git a/board/freescale/mx6qsabresd/mx6qsabresd.c b/board/freescale/mx6qsabresd/mx6qsabresd.c
index 2529826..094382b 100644
--- a/board/freescale/mx6qsabresd/mx6qsabresd.c
+++ b/board/freescale/mx6qsabresd/mx6qsabresd.c
@@ -198,7 +198,7 @@  int board_mmc_init(bd_t *bis)
 			printf("Warning: you configured more USDHC controllers"
 			       "(%d) then supported by the board (%d)\n",
 			       i + 1, CONFIG_SYS_FSL_USDHC_NUM);
-			return status;
+			return -EINVAL;
 		status |= fsl_esdhc_initialize(bis, &usdhc_cfg[i]);