]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - board/congatec/cgtqmx6eval/cgtqmx6eval.c
cgtqmx6eval: Improve the error handling
[karo-tx-uboot.git] / board / congatec / cgtqmx6eval / cgtqmx6eval.c
index df4d4bde7212f1c1084c79a081bde58e3bb4f0a5..ea84329db7dad8abe5282dcff5564cdc19510c53 100644 (file)
@@ -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