]> git.sur5r.net Git - u-boot/commitdiff
nand_util: correct YAFFS image write function
authorLiu, Wentao <wentao.liu@intel.com>
Tue, 17 Jan 2012 19:55:02 +0000 (19:55 +0000)
committerScott Wood <scott@tyr.buserror.net>
Fri, 18 May 2012 23:08:45 +0000 (18:08 -0500)
In function nand_write_skip_bad(),for YAFFS filesystem part,
write_oob() will return 0 when success, so when rval equals 0,
it should continue to write the next page, and no break.

Signed-off-by: Wentao, Liu <wentao.liu@intel.com>
Acked-by: Lei Wen <leiwen@marvell.com>
Signed-off-by: Scott Wood <scott@tyr.buserror.net>
drivers/mtd/nand/nand_util.c

index 60c778e637018ef350a4c021359ba55b2016032c..7ed8b1891ce69663ff084005649c865579a85b71 100644 (file)
@@ -564,7 +564,7 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
                                ops.oobbuf = ops.datbuf + pagesize;
 
                                rval = nand->write_oob(nand, offset, &ops);
-                               if (!rval)
+                               if (rval != 0)
                                        break;
 
                                offset += pagesize;