mtd: nand: fix the partial page write condition
authorhtbegin <hotforest@gmail.com>
Fri, 1 Mar 2013 22:59:27 +0000 (22:59 +0000)
committerScott Wood <scottwood@freescale.com>
Wed, 22 May 2013 21:43:47 +0000 (16:43 -0500)
When writelen is mtd->writesize - 1, it is still a partial page write

Signed-off-by: Tao Hou <hotforest@gmail.com>
Cc: Scott Wood <scottwood@freescale.com>
drivers/mtd/nand/nand_base.c

index a2d06be99fcf4f3f0882671a514b36b4afecb7a3..3d846592ca5192364fa1a24688da3fa98576c293 100644 (file)
@@ -1973,7 +1973,7 @@ static int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
                uint8_t *wbuf = buf;
 
                /* Partial page write ? */
-               if (unlikely(column || writelen < (mtd->writesize - 1))) {
+               if (unlikely(column || writelen < mtd->writesize)) {
                        cached = 0;
                        bytes = min_t(int, bytes - column, (int) writelen);
                        chip->pagebuf = -1;