From: Kirill Kapranov Date: Sat, 9 Oct 2021 20:49:59 +0000 (+0300) Subject: mmc: Fix mmc_switch excessive timeout X-Git-Url: http://git.dujemihanovic.xyz/login.html?a=commitdiff_plain;h=44645f87de513468a8c8082d057704df0495d7a4;p=u-boot.git mmc: Fix mmc_switch excessive timeout Fix branching to avoid premature falling back on a long timeout instead of continuation of the initialization attempt. Clear of the comment to avoid the ambiguity. Signed-off-by: Kirill Kapranov Cc: Pantelis Antoniou Cc: Ye Li Reviewed-by: Marek BehĂșn Tested-by: Marek BehĂșn Signed-off-by: Jaehoon Chung --- diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index ba54b19c14..4d9871d69f 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -819,11 +819,11 @@ static int __mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value, return ret; /* - * In cases when not allowed to poll by using CMD13 or because we aren't + * In cases when neiter allowed to poll by using CMD13 nor we are * 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; }