drivers: mmc: check mmc_reset_to_idle return
authorYann Gautier <yann.gautier@st.com>
Thu, 29 Nov 2018 14:43:37 +0000 (15:43 +0100)
committerYann Gautier <yann.gautier@st.com>
Tue, 4 Dec 2018 09:38:41 +0000 (10:38 +0100)
Signed-off-by: Yann Gautier <yann.gautier@st.com>
drivers/mmc/mmc.c

index 02bf770e559e40c01b869217904317c7b14e2129..4160003c8f6150dfbe69bcbef89b2d16d1a3320c 100644 (file)
@@ -386,7 +386,10 @@ static int mmc_send_op_cond(void)
        int ret, n;
        unsigned int resp_data[4];
 
-       mmc_reset_to_idle();
+       ret = mmc_reset_to_idle();
+       if (ret != 0) {
+               return ret;
+       };
 
        for (n = 0; n < SEND_OP_COND_MAX_RETRIES; n++) {
                ret = mmc_send_cmd(MMC_CMD(1), OCR_SECTOR_MODE |
@@ -416,7 +419,10 @@ static int mmc_enumerate(unsigned int clk, unsigned int bus_width)
 
        ops->init();
 
-       mmc_reset_to_idle();
+       ret = mmc_reset_to_idle();
+       if (ret != 0) {
+               return ret;
+       };
 
        if (mmc_dev_info->mmc_dev_type == MMC_IS_EMMC) {
                ret = mmc_send_op_cond();