]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mmc: jz4740: Fix handling of read errors.
authorPaul Cercueil <paul@crapouillou.net>
Sun, 9 Jun 2013 19:10:02 +0000 (21:10 +0200)
committerChris Ball <cjb@laptop.org>
Thu, 27 Jun 2013 16:39:12 +0000 (12:39 -0400)
For no reason, the code handling write errors was implemented while
the code handling read errors was missing.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/jz4740_mmc.c

index b31359da4a757d51405b87202a93b05b2ba97b5c..3f86592e97a248791ae490ad299fb6ce3c168daf 100644 (file)
@@ -231,6 +231,14 @@ static void jz4740_mmc_transfer_check_state(struct jz4740_mmc_host *host,
                        host->req->cmd->error = -EIO;
                        data->error = -EIO;
                }
+       } else if (status & JZ_MMC_STATUS_READ_ERROR_MASK) {
+               if (status & (JZ_MMC_STATUS_TIMEOUT_READ)) {
+                       host->req->cmd->error = -ETIMEDOUT;
+                       data->error = -ETIMEDOUT;
+               } else {
+                       host->req->cmd->error = -EIO;
+                       data->error = -EIO;
+               }
        }
 }