diff options
author | Aaron Sierra <asierra@xes-inc.com> | 2015-01-14 23:41:31 (GMT) |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2015-02-02 05:10:58 (GMT) |
commit | e0377cdebaf3913bff693c9eea17ff6eb4d7abc8 (patch) | |
tree | 4af65d7984f566492e043f4376757fbcf726c03d /drivers/mtd/nand/nandsim.c | |
parent | 240181fd0ffa69cac08d6b06c94e843707370f5f (diff) | |
download | linux-e0377cdebaf3913bff693c9eea17ff6eb4d7abc8.tar.xz |
mtd: nand: Request strength instead of bytes for soft BCH
Previously, we requested that drivers pass ecc.size and ecc.bytes when
using NAND_ECC_SOFT_BCH. However, a driver is likely to only know the ECC
strength required for its NAND, so each driver would need to perform a
strength-to-bytes calculation.
Avoid duplicating this calculation in each driver by asking drivers to
pass ecc.size and ecc.strength so that the strength-to-bytes calculation
need only be implemented once.
This reverts/generalizes this commit:
mtd: nand: Base BCH ECC bytes on required strength
Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd/nand/nandsim.c')
-rw-r--r-- | drivers/mtd/nand/nandsim.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index a8fa8da..f232427 100644 --- a/drivers/mtd/nand/nandsim.c +++ b/drivers/mtd/nand/nandsim.c @@ -2337,6 +2337,7 @@ static int __init ns_init_module(void) } chip->ecc.mode = NAND_ECC_SOFT_BCH; chip->ecc.size = 512; + chip->ecc.strength = bch; chip->ecc.bytes = eccbytes; NS_INFO("using %u-bit/%u bytes BCH ECC\n", bch, chip->ecc.size); } |