浏览代码

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>
Jongman Heo 13 年之前
父节点
当前提交
5b0c942f89
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/mmc/mmc.c

+ 1 - 1
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;
 	}