mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 13:11:31 +00:00
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>
This commit is contained in:
parent
49a4c7476f
commit
2077e348c2
1 changed files with 6 additions and 6 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue