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

Submitted by Fabio Estevam on May 21, 2013, 5:32 p.m.


Message ID 1369157542-25734-5-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/mx53evk/mx53evk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

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