summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJongman Heo <jongman.heo@gmail.com>2012-06-03 21:32:13 +0000
committerAndy Fleming <afleming@freescale.com>2012-09-05 17:32:41 -0500
commit5b0c942f8919ed962699a44e0abb4f8a599c52c1 (patch)
treee529d3e6b1440627deb1a48d8357890a97d51ce5
parenta6f0c4faa4c65a7b7048b12c9d180d7e1aad1721 (diff)
downloadu-boot-imx-5b0c942f8919ed962699a44e0abb4f8a599c52c1.zip
u-boot-imx-5b0c942f8919ed962699a44e0abb4f8a599c52c1.tar.gz
u-boot-imx-5b0c942f8919ed962699a44e0abb4f8a599c52c1.tar.bz2
mmc: fix wrong timeout check in mmc_send_status()
(!timeout) condition check in mmc_send_status() can never be met, because do-while loop ends up with negative timeout value, -1. Fix the check to handle TIMEOUT case correctly. Signed-off-by: Jongman Heo <jongman.heo@gmail.com> Signed-off-by: Andy Fleming <afleming@freescale.com>
-rw-r--r--drivers/mmc/mmc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index fa673cf..89b674bb 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -236,7 +236,7 @@ int mmc_send_status(struct mmc *mmc, int timeout)
status = (cmd.response[0] & MMC_STATUS_CURR_STATE) >> 9;
printf("CURR STATE:%d\n", status);
#endif
- if (!timeout) {
+ if (timeout <= 0) {
printf("Timeout waiting card ready\n");
return TIMEOUT;
}