From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755009AbcAHRO2 (ORCPT ); Fri, 8 Jan 2016 12:14:28 -0500 Received: from down.free-electrons.com ([37.187.137.238]:40213 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753209AbcAHRO0 (ORCPT ); Fri, 8 Jan 2016 12:14:26 -0500 Date: Fri, 8 Jan 2016 18:14:22 +0100 From: Boris Brezillon To: Harvey Hunt Cc: , , , Alex Smith , Subject: Re: [PATCH] mtd: nand: jz4780: Update ecc correction error codes Message-ID: <20160108181422.4b94ffbd@bbrezillon> In-Reply-To: <1452271517-18993-1-git-send-email-harvey.hunt@imgtec.com> References: <1452271517-18993-1-git-send-email-harvey.hunt@imgtec.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 8 Jan 2016 16:45:17 +0000 Harvey Hunt wrote: > Update jz4780_bch_ecc_correct's return codes with appropriate values, > as specified in /include/linux/mtd/nand.h. Oh, nice catch. Reviewed-by: Boris Brezillon Thanks, Boris > > Signed-off-by: Harvey Hunt > Cc: Alex Smith > Cc: Boris Brezillon > 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, ®)) { > 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; > } > -- Boris Brezillon, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com