]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mmc: do not send cmd13 if the parameter 'send_status' is 0 for __mmc_switch
authorHaibo Chen <haibo.chen@nxp.com>
Tue, 22 Sep 2020 10:11:42 +0000 (18:11 +0800)
committerPeng Fan <peng.fan@nxp.com>
Mon, 12 Oct 2020 07:48:13 +0000 (15:48 +0800)
According to the code logic in __mmc_switch, if the parameter 'send_status'
is zero, no need to send cmd13, just wait the stated timeout time, then
can return directly.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
drivers/mmc/mmc.c

index 8502503d361cfec1b04f2aa6c6ac5c9ecce7c302..7783535d09536383ac68cfe0fdf007ecaeabb0cd 100644 (file)
@@ -805,8 +805,10 @@ static int __mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value,
         * capable of polling by using mmc_wait_dat0, then rely on waiting the
         * stated timeout to be sufficient.
         */
-       if (ret == -ENOSYS && !send_status)
+       if (ret == -ENOSYS && !send_status) {
                mdelay(timeout_ms);
+               return 0;
+       }
 
        /* Finally wait until the card is ready or indicates a failure
         * to switch. It doesn't hurt to use CMD13 here even if send_status