aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Kapranov <kirill.kapranov@compulab.co.il>2021-10-09 23:49:59 +0300
committerJaehoon Chung <jh80.chung@samsung.com>2021-10-29 18:22:32 +0900
commit44645f87de513468a8c8082d057704df0495d7a4 (patch)
treeb9c8f040c1c0c9ad9770e46db32ac58bb2ed474f
parent0d453c84bae95174ca3bd94c72a46112580b24c8 (diff)
downloadu-boot-44645f87de513468a8c8082d057704df0495d7a4.zip
u-boot-44645f87de513468a8c8082d057704df0495d7a4.tar.gz
u-boot-44645f87de513468a8c8082d057704df0495d7a4.tar.bz2
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 <kirill.kapranov@compulab.co.il> Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Cc: Ye Li <ye.li@nxp.com> Reviewed-by: Marek BehĂșn <marek.behun@nic.cz> Tested-by: Marek BehĂșn <marek.behun@nic.cz> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
-rw-r--r--drivers/mmc/mmc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index ba54b19..4d9871d 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;
}