mtd: omap2 fix prefetch mode read issue
[deliverable/linux.git] / drivers / mtd / nand / omap2.c
index 16120e2dd4a3d6229a2e4a3de6cea991436f8201..7df303aed8a44db682db1fa844746eb816e454cb 100644 (file)
@@ -295,11 +295,14 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len)
        u32 *p = (u32 *)buf;
 
        /* take care of subpage reads */
-       for (; len % 4 != 0; ) {
-               *buf++ = __raw_readb(info->nand.IO_ADDR_R);
-               len--;
+       if (len % 4) {
+               if (info->nand.options & NAND_BUSWIDTH_16)
+                       omap_read_buf16(mtd, buf, len % 4);
+               else
+                       omap_read_buf8(mtd, buf, len % 4);
+               p = (u32 *) (buf + len % 4);
+               len -= len % 4;
        }
-       p = (u32 *) buf;
 
        /* configure and start prefetch transfer */
        ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x0);
This page took 0.026987 seconds and 5 git commands to generate.