mtd: nand: jz4780: Update ecc correction error codes

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue Jan 12 15:59:32 PST 2016


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=6c1207b5b8422cdddf467b9fbef922c4c374d382
Commit:     6c1207b5b8422cdddf467b9fbef922c4c374d382
Parent:     c66b651ce60bb82d8f6fe8ca35e70f323e3a260c
Author:     Harvey Hunt <harvey.hunt at imgtec.com>
AuthorDate: Fri Jan 8 16:45:17 2016 +0000
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Fri Jan 8 09:44:30 2016 -0800

    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 at imgtec.com>
    Cc: Alex Smith <alex at alex-smith.me.uk>
    Cc: Boris Brezillon <boris.brezillon at free-electrons.com>
    Cc: linux-kernel at vger.kernel.org
    Reviewed-by: Boris Brezillon <boris.brezillon at free-electrons.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/nand/jz4780_bch.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/jz4780_bch.c b/drivers/mtd/nand/jz4780_bch.c
index 5954fbf..755499c 100644
--- a/drivers/mtd/nand/jz4780_bch.c
+++ b/drivers/mtd/nand/jz4780_bch.c
@@ -210,8 +210,8 @@ EXPORT_SYMBOL(jz4780_bch_calculate);
  * Given the raw data and the ECC read from the NAND device, detects and
  * corrects errors in the data.
  *
- * Return: the number of bit errors corrected, or -1 if there are too many
- * errors to correct or we timed out waiting for the controller.
+ * Return: the number of bit errors corrected, -EBADMSG if there are too many
+ * errors to correct or -ETIMEDOUT if we timed out waiting for the controller.
  */
 int jz4780_bch_correct(struct jz4780_bch *bch, struct jz4780_bch_params *params,
 		       u8 *buf, u8 *ecc_code)
@@ -227,13 +227,13 @@ int jz4780_bch_correct(struct jz4780_bch *bch, struct jz4780_bch_params *params,
 
 	if (!jz4780_bch_wait_complete(bch, BCH_BHINT_DECF, &reg)) {
 		dev_err(bch->dev, "timed out while correcting data\n");
-		ret = -1;
+		ret = -ETIMEDOUT;
 		goto out;
 	}
 
 	if (reg & BCH_BHINT_UNCOR) {
 		dev_warn(bch->dev, "uncorrectable ECC error\n");
-		ret = -1;
+		ret = -EBADMSG;
 		goto out;
 	}
 



More information about the linux-mtd-cvs mailing list