diff options
author | Mike Dunn <mikedunn@newsguy.com> | 2012-09-11 11:50:50 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-09-29 10:54:11 -0400 |
commit | 5bf3d66a933efb71fa6db08a5043a617b6eadb4a (patch) | |
tree | 3aa65355aedf87e6e3ef71926351adaaf7d500c5 | |
parent | 61de9da657e8c52606d45ae67dfa187111bf9b55 (diff) |
mtd: docg4: ecc.read_page() returns 0 on uncorrectable errors
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>
-rw-r--r-- | drivers/mtd/nand/docg4.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mtd/nand/docg4.c b/drivers/mtd/nand/docg4.c index 793921e56f8e..799da5d1c857 100644 --- a/drivers/mtd/nand/docg4.c +++ b/drivers/mtd/nand/docg4.c | |||
@@ -776,6 +776,8 @@ static int read_page(struct mtd_info *mtd, struct nand_chip *nand, | |||
776 | } | 776 | } |
777 | 777 | ||
778 | writew(0, docptr + DOC_DATAEND); | 778 | writew(0, docptr + DOC_DATAEND); |
779 | if (bits_corrected == -EBADMSG) /* uncorrectable errors */ | ||
780 | return 0; | ||
779 | return bits_corrected; | 781 | return bits_corrected; |
780 | } | 782 | } |
781 | 783 | ||