From: Jongman Heo Date: Sun, 3 Jun 2012 21:32:13 +0000 (+0000) Subject: mmc: fix wrong timeout check in mmc_send_status() X-Git-Tag: v2012.10-rc1~44^2~14 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5b0c942f8919ed962699a44e0abb4f8a599c52c1;p=u-boot 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 Signed-off-by: Andy Fleming --- diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index fa673cf2c6..89b674bb4b 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; }