1
0
Fork 0

mmc: jz4740: Fix handling of read errors.

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>
hifive-unleashed-5.1
Paul Cercueil 2013-06-09 21:10:02 +02:00 committed by Chris Ball
parent 331947932d
commit 8a489aa10c
1 changed files with 8 additions and 0 deletions

View 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;
}
}
}