diff options
author | Harvey Hunt <harvey.hunt@imgtec.com> | 2016-01-08 11:45:17 -0500 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2016-01-08 12:44:30 -0500 |
commit | 6c1207b5b8422cdddf467b9fbef922c4c374d382 (patch) | |
tree | ffb28776bdced8aaf94e406df9715ac754fa4860 | |
parent | c66b651ce60bb82d8f6fe8ca35e70f323e3a260c (diff) |
mtd: nand: jz4780: Update ecc correction error codes
Update jz4780_bch_ecc_correct's return codes with appropriate values,
as specified in /include/linux/mtd/nand.h.
Signed-off-by: Harvey Hunt <harvey.hunt@imgtec.com>
Cc: Alex Smith <alex@alex-smith.me.uk>
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-rw-r--r-- | drivers/mtd/nand/jz4780_bch.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mtd/nand/jz4780_bch.c b/drivers/mtd/nand/jz4780_bch.c index 5954fbfa29e9..755499c6650e 100644 --- a/drivers/mtd/nand/jz4780_bch.c +++ b/drivers/mtd/nand/jz4780_bch.c | |||
@@ -210,8 +210,8 @@ EXPORT_SYMBOL(jz4780_bch_calculate); | |||
210 | * Given the raw data and the ECC read from the NAND device, detects and | 210 | * Given the raw data and the ECC read from the NAND device, detects and |
211 | * corrects errors in the data. | 211 | * corrects errors in the data. |
212 | * | 212 | * |
213 | * Return: the number of bit errors corrected, or -1 if there are too many | 213 | * Return: the number of bit errors corrected, -EBADMSG if there are too many |
214 | * errors to correct or we timed out waiting for the controller. | 214 | * errors to correct or -ETIMEDOUT if we timed out waiting for the controller. |
215 | */ | 215 | */ |
216 | int jz4780_bch_correct(struct jz4780_bch *bch, struct jz4780_bch_params *params, | 216 | int jz4780_bch_correct(struct jz4780_bch *bch, struct jz4780_bch_params *params, |
217 | u8 *buf, u8 *ecc_code) | 217 | u8 *buf, u8 *ecc_code) |
@@ -227,13 +227,13 @@ int jz4780_bch_correct(struct jz4780_bch *bch, struct jz4780_bch_params *params, | |||
227 | 227 | ||
228 | if (!jz4780_bch_wait_complete(bch, BCH_BHINT_DECF, ®)) { | 228 | if (!jz4780_bch_wait_complete(bch, BCH_BHINT_DECF, ®)) { |
229 | dev_err(bch->dev, "timed out while correcting data\n"); | 229 | dev_err(bch->dev, "timed out while correcting data\n"); |
230 | ret = -1; | 230 | ret = -ETIMEDOUT; |
231 | goto out; | 231 | goto out; |
232 | } | 232 | } |
233 | 233 | ||
234 | if (reg & BCH_BHINT_UNCOR) { | 234 | if (reg & BCH_BHINT_UNCOR) { |
235 | dev_warn(bch->dev, "uncorrectable ECC error\n"); | 235 | dev_warn(bch->dev, "uncorrectable ECC error\n"); |
236 | ret = -1; | 236 | ret = -EBADMSG; |
237 | goto out; | 237 | goto out; |
238 | } | 238 | } |
239 | 239 | ||