aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mtd/nand/atmel_nand.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index f254fa636afc..e9fdbe46b247 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -280,7 +280,8 @@ static void atmel_read_buf(struct mtd_info *mtd, u8 *buf, int len)
280 struct nand_chip *chip = mtd->priv; 280 struct nand_chip *chip = mtd->priv;
281 struct atmel_nand_host *host = chip->priv; 281 struct atmel_nand_host *host = chip->priv;
282 282
283 if (use_dma && len >= mtd->oobsize) 283 if (use_dma && len > mtd->oobsize)
284 /* only use DMA for bigger than oob size: better performances */
284 if (atmel_nand_dma_op(mtd, buf, len, 1) == 0) 285 if (atmel_nand_dma_op(mtd, buf, len, 1) == 0)
285 return; 286 return;
286 287
@@ -295,7 +296,8 @@ static void atmel_write_buf(struct mtd_info *mtd, const u8 *buf, int len)
295 struct nand_chip *chip = mtd->priv; 296 struct nand_chip *chip = mtd->priv;
296 struct atmel_nand_host *host = chip->priv; 297 struct atmel_nand_host *host = chip->priv;
297 298
298 if (use_dma && len >= mtd->oobsize) 299 if (use_dma && len > mtd->oobsize)
300 /* only use DMA for bigger than oob size: better performances */
299 if (atmel_nand_dma_op(mtd, (void *)buf, len, 0) == 0) 301 if (atmel_nand_dma_op(mtd, (void *)buf, len, 0) == 0)
300 return; 302 return;
301 303