From: htbegin Date: Fri, 1 Mar 2013 22:59:27 +0000 (+0000) Subject: mtd: nand: fix the partial page write condition X-Git-Tag: v2013.07-rc1~49^2~3 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=070fd8e5295185546801a0f11ea5edd22833a02b;p=oweals%2Fu-boot.git 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 Cc: Scott Wood --- diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index a2d06be99f..3d846592ca 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/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; /* 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;