Skip to content

Commit

Permalink
mtd: docg4: ecc.read_page() returns 0 on uncorrectable errors
Browse files Browse the repository at this point in the history
Currently the docg4's ecc.read_page() method returns -EBADMSG when
uncorrectable bitflips occur.  This is wrong; 0 should be returned in
this case.  An error code should only be returned by this method in the
case of a hardware error (probably -EIO).

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
Acked-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
Mike Dunn authored and David Woodhouse committed Sep 29, 2012
1 parent 61de9da commit 5bf3d66
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/mtd/nand/docg4.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,8 @@ static int read_page(struct mtd_info *mtd, struct nand_chip *nand,
}

writew(0, docptr + DOC_DATAEND);
if (bits_corrected == -EBADMSG) /* uncorrectable errors */
return 0;
return bits_corrected;
}

Expand Down

0 comments on commit 5bf3d66

Please sign in to comment.