Bladeren bron

mtd: nand: fix the partial page write condition

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>
htbegin 12 jaren geleden
bovenliggende
commit
070fd8e529
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  1. 1 1
      drivers/mtd/nand/nand_base.c

+ 1 - 1
drivers/mtd/nand/nand_base.c

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