summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2008-11-25 10:47:02 -0600
committerScott Wood <scottwood@freescale.com>2008-11-25 10:47:02 -0600
commit2077e348c2a84901022ad95311b47b70361e6daa (patch)
treeb8ff7aad19b026a94731c501ccc13596c728b020 /drivers/mtd
parent49a4c7476f5f7c67dc8159537d9fbcdcfa91afb8 (diff)
downloadu-boot-imx-2077e348c2a84901022ad95311b47b70361e6daa.zip
u-boot-imx-2077e348c2a84901022ad95311b47b70361e6daa.tar.gz
u-boot-imx-2077e348c2a84901022ad95311b47b70361e6daa.tar.bz2
NAND: Fix misplaced return statement in nand_{read,write}_skip_bad().
This caused the operation to be needlessly repeated if there were no bad blocks and no errors. Signed-off-by: Valeriy Glushkov <gvv@lstec.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/nand_util.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/mtd/nand/nand_util.c b/drivers/mtd/nand/nand_util.c
index 149af83..d86c987 100644
--- a/drivers/mtd/nand/nand_util.c
+++ b/drivers/mtd/nand/nand_util.c
@@ -487,11 +487,11 @@ int nand_write_skip_bad(nand_info_t *nand, size_t offset, size_t *length,
if (len_incl_bad == *length) {
rval = nand_write (nand, offset, length, buffer);
- if (rval != 0) {
+ if (rval != 0)
printf ("NAND write to offset %x failed %d\n",
offset, rval);
- return rval;
- }
+
+ return rval;
}
while (left_to_write > 0) {
@@ -557,11 +557,11 @@ int nand_read_skip_bad(nand_info_t *nand, size_t offset, size_t *length,
if (len_incl_bad == *length) {
rval = nand_read (nand, offset, length, buffer);
- if (rval != 0) {
+ if (rval != 0)
printf ("NAND read from offset %x failed %d\n",
offset, rval);
- return rval;
- }
+
+ return rval;
}
while (left_to_read > 0) {