aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/omap2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/nand/omap2.c')
-rw-r--r--drivers/mtd/nand/omap2.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 7545568fce47..ee87325c7712 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -292,11 +292,14 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len)
292 u32 *p = (u32 *)buf; 292 u32 *p = (u32 *)buf;
293 293
294 /* take care of subpage reads */ 294 /* take care of subpage reads */
295 for (; len % 4 != 0; ) { 295 if (len % 4) {
296 *buf++ = __raw_readb(info->nand.IO_ADDR_R); 296 if (info->nand.options & NAND_BUSWIDTH_16)
297 len--; 297 omap_read_buf16(mtd, buf, len % 4);
298 else
299 omap_read_buf8(mtd, buf, len % 4);
300 p = (u32 *) (buf + len % 4);
301 len -= len % 4;
298 } 302 }
299 p = (u32 *) buf;
300 303
301 /* configure and start prefetch transfer */ 304 /* configure and start prefetch transfer */
302 ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x0); 305 ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x0);
@@ -502,7 +505,7 @@ static void omap_write_buf_dma_pref(struct mtd_info *mtd,
502 omap_write_buf_pref(mtd, buf, len); 505 omap_write_buf_pref(mtd, buf, len);
503 else 506 else
504 /* start transfer in DMA mode */ 507 /* start transfer in DMA mode */
505 omap_nand_dma_transfer(mtd, buf, len, 0x1); 508 omap_nand_dma_transfer(mtd, (u_char *) buf, len, 0x1);
506} 509}
507 510
508/** 511/**
@@ -1028,7 +1031,8 @@ out_free_info:
1028static int omap_nand_remove(struct platform_device *pdev) 1031static int omap_nand_remove(struct platform_device *pdev)
1029{ 1032{
1030 struct mtd_info *mtd = platform_get_drvdata(pdev); 1033 struct mtd_info *mtd = platform_get_drvdata(pdev);
1031 struct omap_nand_info *info = mtd->priv; 1034 struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
1035 mtd);
1032 1036
1033 platform_set_drvdata(pdev, NULL); 1037 platform_set_drvdata(pdev, NULL);
1034 if (use_dma) 1038 if (use_dma)