diff options
-rw-r--r-- | drivers/mtd/nand/omap2.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index 16120e2dd4a3..7df303aed8a4 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c | |||
@@ -295,11 +295,14 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len) | |||
295 | u32 *p = (u32 *)buf; | 295 | u32 *p = (u32 *)buf; |
296 | 296 | ||
297 | /* take care of subpage reads */ | 297 | /* take care of subpage reads */ |
298 | for (; len % 4 != 0; ) { | 298 | if (len % 4) { |
299 | *buf++ = __raw_readb(info->nand.IO_ADDR_R); | 299 | if (info->nand.options & NAND_BUSWIDTH_16) |
300 | len--; | 300 | omap_read_buf16(mtd, buf, len % 4); |
301 | else | ||
302 | omap_read_buf8(mtd, buf, len % 4); | ||
303 | p = (u32 *) (buf + len % 4); | ||
304 | len -= len % 4; | ||
301 | } | 305 | } |
302 | p = (u32 *) buf; | ||
303 | 306 | ||
304 | /* configure and start prefetch transfer */ | 307 | /* configure and start prefetch transfer */ |
305 | ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x0); | 308 | ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x0); |