diff options
author | Boris BREZILLON <boris.brezillon@free-electrons.com> | 2015-12-30 20:32:03 +0100 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2016-01-07 03:45:46 +0100 |
commit | 6e9411923b8f4c0e568cbae0f35b7ee4eb989914 (patch) | |
tree | ec7bf6355c95b14fd19794119d7fd5fbfb9e0186 /drivers/mtd/nand/nand_bch.c | |
parent | doc: dt: mtd: new binding for jz4780-{nand,bch} (diff) | |
download | linux-6e9411923b8f4c0e568cbae0f35b7ee4eb989914.tar.xz linux-6e9411923b8f4c0e568cbae0f35b7ee4eb989914.zip |
mtd: nand: return consistent error codes in ecc.correct() implementations
The error code returned by the ecc.correct() are not consistent over the
all implementations.
Document the expected behavior in include/linux/mtd/nand.h and fix
offending implementations.
[Brian: this looks like a bugfix for the ECC reporting in the bf5xx_nand
driver, but we haven't seen any testing results for it]
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Tested-by: Franklin S Cooper Jr. <fcooper@ti.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd/nand/nand_bch.c')
-rw-r--r-- | drivers/mtd/nand/nand_bch.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/nand/nand_bch.c b/drivers/mtd/nand/nand_bch.c index e5758d885943..a87c1b628dfc 100644 --- a/drivers/mtd/nand/nand_bch.c +++ b/drivers/mtd/nand/nand_bch.c @@ -98,7 +98,7 @@ int nand_bch_correct_data(struct mtd_info *mtd, unsigned char *buf, } } else if (count < 0) { printk(KERN_ERR "ecc unrecoverable error\n"); - count = -1; + count = -EBADMSG; } return count; } |