diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2015-07-23 11:02:22 -0300 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2015-07-26 12:21:58 +0200 |
commit | 516a863ef43f443ca1d878bf6d829875e337f3db (patch) | |
tree | 1ec06bf82e63ee0950717533bf7d61bd0ee103dc /board/congatec/cgtqmx6eval | |
parent | 6b3496f7babd0d1b1c30eb1b444246fc7b733a3b (diff) | |
download | u-boot-imx-516a863ef43f443ca1d878bf6d829875e337f3db.zip u-boot-imx-516a863ef43f443ca1d878bf6d829875e337f3db.tar.gz u-boot-imx-516a863ef43f443ca1d878bf6d829875e337f3db.tar.bz2 |
cgtqmx6eval: Improve the error handling
Perfoming an OR operation on the error is not a good approach.
Return the error immediately for each ESDHC instance instead.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'board/congatec/cgtqmx6eval')
-rw-r--r-- | board/congatec/cgtqmx6eval/cgtqmx6eval.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/board/congatec/cgtqmx6eval/cgtqmx6eval.c b/board/congatec/cgtqmx6eval/cgtqmx6eval.c index eb6395a..0f43d3c 100644 --- a/board/congatec/cgtqmx6eval/cgtqmx6eval.c +++ b/board/congatec/cgtqmx6eval/cgtqmx6eval.c @@ -98,6 +98,7 @@ int board_mmc_getcd(struct mmc *mmc) int board_mmc_init(bd_t *bis) { s32 status = 0; + int i; usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK); usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC4_CLK); @@ -107,10 +108,13 @@ int board_mmc_init(bd_t *bis) imx_iomux_v3_setup_multiple_pads( usdhc4_pads, ARRAY_SIZE(usdhc4_pads)); - status = fsl_esdhc_initialize(bis, &usdhc_cfg[0]) | - fsl_esdhc_initialize(bis, &usdhc_cfg[1]); + for (i = 0; i < ARRAY_SIZE(usdhc_cfg); i++) { + status = fsl_esdhc_initialize(bis, &usdhc_cfg[i]); + if (status) + return status; + } - return status; + return 0; } #endif |