aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mmc/host/mmci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 4b8dcd5b2a01..b6fd6dcb41e7 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -283,13 +283,13 @@ mmci_data_irq(struct mmci_host *host, struct mmc_data *data,
283 u32 remain, success; 283 u32 remain, success;
284 284
285 /* Calculate how far we are into the transfer */ 285 /* Calculate how far we are into the transfer */
286 remain = readl(host->base + MMCIDATACNT) << 2; 286 remain = readl(host->base + MMCIDATACNT);
287 success = data->blksz * data->blocks - remain; 287 success = data->blksz * data->blocks - remain;
288 288
289 dev_dbg(mmc_dev(host->mmc), "MCI ERROR IRQ (status %08x)\n", status); 289 dev_dbg(mmc_dev(host->mmc), "MCI ERROR IRQ (status %08x)\n", status);
290 if (status & MCI_DATACRCFAIL) { 290 if (status & MCI_DATACRCFAIL) {
291 /* Last block was not successful */ 291 /* Last block was not successful */
292 host->data_xfered = ((success / data->blksz) - 1 * data->blksz); 292 host->data_xfered = ((success - 1) / data->blksz) * data->blksz;
293 data->error = -EILSEQ; 293 data->error = -EILSEQ;
294 } else if (status & MCI_DATATIMEOUT) { 294 } else if (status & MCI_DATATIMEOUT) {
295 host->data_xfered = success; 295 host->data_xfered = success;