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.este...@freescale.com> --- board/wandboard/wandboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c index bb98352..70e070c 100644 --- a/board/wandboard/wandboard.c +++ b/board/wandboard/wandboard.c @@ -164,7 +164,7 @@ int board_mmc_init(bd_t *bis) printf("Warning: you configured more USDHC controllers" "(%d) then supported by the board (%d)\n", index + 1, CONFIG_SYS_FSL_USDHC_NUM); - return status; + return -EINVAL; } status |= fsl_esdhc_initialize(bis, &usdhc_cfg[index]); -- 1.8.1.2 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot