omap_hsmmc: Do dma cleanup also with data CRC errors
Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 576bfa7..5ff2ca2 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -332,9 +332,9 @@
/*
* DMA clean up for command errors
*/
-static void mmc_dma_cleanup(struct mmc_omap_host *host)
+static void mmc_dma_cleanup(struct mmc_omap_host *host, int errno)
{
- host->data->error = -ETIMEDOUT;
+ host->data->error = errno;
if (host->use_dma && host->dma_ch != -1) {
dma_unmap_sg(mmc_dev(host->mmc), host->data->sg, host->dma_len,
@@ -439,7 +439,7 @@
end_cmd = 1;
}
if (host->data) {
- mmc_dma_cleanup(host);
+ mmc_dma_cleanup(host, -ETIMEDOUT);
mmc_omap_reset_controller_fsm(host, SRD);
}
}
@@ -447,9 +447,9 @@
(status & DATA_CRC)) {
if (host->data) {
if (status & DATA_TIMEOUT)
- mmc_dma_cleanup(host);
+ mmc_dma_cleanup(host, -ETIMEDOUT);
else
- host->data->error = -EILSEQ;
+ mmc_dma_cleanup(host, -EILSEQ);
mmc_omap_reset_controller_fsm(host, SRD);
end_trans = 1;
}