aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/mmci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/host/mmci.c')
-rw-r--r--drivers/mmc/host/mmci.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 95244a7e7353..626ac083f4e0 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -213,9 +213,10 @@ static int mmci_pio_read(struct mmci_host *host, char *buffer, unsigned int rema
213 void __iomem *base = host->base; 213 void __iomem *base = host->base;
214 char *ptr = buffer; 214 char *ptr = buffer;
215 u32 status; 215 u32 status;
216 int host_remain = host->size;
216 217
217 do { 218 do {
218 int count = host->size - (readl(base + MMCIFIFOCNT) << 2); 219 int count = host_remain - (readl(base + MMCIFIFOCNT) << 2);
219 220
220 if (count > remain) 221 if (count > remain)
221 count = remain; 222 count = remain;
@@ -227,6 +228,7 @@ static int mmci_pio_read(struct mmci_host *host, char *buffer, unsigned int rema
227 228
228 ptr += count; 229 ptr += count;
229 remain -= count; 230 remain -= count;
231 host_remain -= count;
230 232
231 if (remain == 0) 233 if (remain == 0)
232 break; 234 break;