Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1304720

[PATCH] mtd: nand: jz4780: Update ecc correction error codes

Path csiph.com!au2pb.net!feeder.erje.net!2.us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Harvey Hunt <harvey.hunt@imgtec.com>
Newsgroups linux.kernel
Subject [PATCH] mtd: nand: jz4780: Update ecc correction error codes
Date Fri, 08 Jan 2016 17:50:03 +0100
Message-ID <qOIoG-UX-7@gated-at.bofh.it> (permalink)
X-Original-To <linux-mtd@lists.infradead.org>, <dwmw2@infradead.org>, <computersforpeace@gmail.com>
X-Mailer git-send-email 2.6.4
MIME-Version 1.0
Content-Type text/plain
X-Originating-IP [192.168.154.40]
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 44
Organization linux.* mail to news gateway
X-Original-Cc Harvey Hunt <harvey.hunt@imgtec.com>, Alex Smith <alex@alex-smith.me.uk>, Boris Brezillon <boris.brezillon@free-electrons.com>, <linux-kernel@vger.kernel.org>
X-Original-Date Fri, 8 Jan 2016 16:45:17 +0000
X-Original-Message-ID <1452271517-18993-1-git-send-email-harvey.hunt@imgtec.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1304720

Show key headers only | View raw


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
---
 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;
 	}
 
-- 
2.6.4

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH] mtd: nand: jz4780: Update ecc correction error codes Harvey Hunt <harvey.hunt@imgtec.com> - 2016-01-08 17:50 +0100
  Re: [PATCH] mtd: nand: jz4780: Update ecc correction error codes Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-01-08 18:20 +0100
    Re: [PATCH] mtd: nand: jz4780: Update ecc correction error codes Brian Norris <computersforpeace@gmail.com> - 2016-01-08 18:50 +0100

csiph-web