diff options
author | Valeriy Glushkov <gvv@lstec.com> | 2009-07-14 13:51:10 +0300 |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2009-07-16 17:52:01 -0500 |
commit | 3ebf70db5452d3d47c316ddef09f40e76553bcba (patch) | |
tree | 9be8c9498b38da809f7320476c5e709adde9848a | |
parent | ed727d394c5ab139033719772dc95dc25cfa14f7 (diff) | |
download | u-boot-imx-3ebf70db5452d3d47c316ddef09f40e76553bcba.zip u-boot-imx-3ebf70db5452d3d47c316ddef09f40e76553bcba.tar.gz u-boot-imx-3ebf70db5452d3d47c316ddef09f40e76553bcba.tar.bz2 |
nand: fixed failed reads on corrected ECC errors in nand_util.c
Signed-off-by: Valeriy Glushkov <gvv@lstec.com>
Signed-off-by: Paulraj, Sandeep <s-paulraj@ti.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
-rw-r--r-- | drivers/mtd/nand/nand_util.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mtd/nand/nand_util.c b/drivers/mtd/nand/nand_util.c index fc16282..694ead6 100644 --- a/drivers/mtd/nand/nand_util.c +++ b/drivers/mtd/nand/nand_util.c @@ -567,10 +567,10 @@ int nand_read_skip_bad(nand_info_t *nand, loff_t offset, size_t *length, if (len_incl_bad == *length) { rval = nand_read (nand, offset, length, buffer); - if (rval != 0) - printf ("NAND read from offset %llx failed %d\n", - offset, rval); - + if (!rval || rval == -EUCLEAN) + return 0; + printf ("NAND read from offset %llx failed %d\n", + offset, rval); return rval; } @@ -591,7 +591,7 @@ int nand_read_skip_bad(nand_info_t *nand, loff_t offset, size_t *length, read_length = nand->erasesize - block_offset; rval = nand_read (nand, offset, &read_length, p_buffer); - if (rval != 0) { + if (rval && rval != -EUCLEAN) { printf ("NAND read from offset %llx failed %d\n", offset, rval); *length -= left_to_read; |