All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Harvey Hunt <harvey.hunt@imgtec.com>
Cc: <linux-mtd@lists.infradead.org>, <dwmw2@infradead.org>,
	<computersforpeace@gmail.com>, Alex Smith <alex@alex-smith.me.uk>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mtd: nand: jz4780: Update ecc correction error codes
Date: Fri, 8 Jan 2016 18:14:22 +0100	[thread overview]
Message-ID: <20160108181422.4b94ffbd@bbrezillon> (raw)
In-Reply-To: <1452271517-18993-1-git-send-email-harvey.hunt@imgtec.com>

On Fri, 8 Jan 2016 16:45:17 +0000
Harvey Hunt <harvey.hunt@imgtec.com> 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 <boris.brezillon@free-electrons.com>

Thanks,

Boris

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



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2016-01-08 17:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-08 16:45 [PATCH] mtd: nand: jz4780: Update ecc correction error codes Harvey Hunt
2016-01-08 17:14 ` Boris Brezillon [this message]
2016-01-08 17:48   ` Brian Norris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160108181422.4b94ffbd@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=alex@alex-smith.me.uk \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=harvey.hunt@imgtec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.