diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2020-05-13 15:10:29 +0200 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2020-05-18 22:02:05 +0200 |
commit | 3507273d5a4d3c2e46f9d3f9ed9449805f5dff07 (patch) | |
tree | e296a5269bf3795040379b7b97d9e1afb7d95429 /drivers/mtd | |
parent | Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/... (diff) | |
download | linux-3507273d5a4d3c2e46f9d3f9ed9449805f5dff07.tar.xz linux-3507273d5a4d3c2e46f9d3f9ed9449805f5dff07.zip |
mtd: spinand: Propagate ECC information to the MTD structure
This is done by default in the raw NAND core (nand_base.c) but was
missing in the SPI-NAND core. Without these two lines the ecc_strength
and ecc_step_size values are not exported to the user through sysfs.
Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs")
Cc: stable@vger.kernel.org
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/spi/core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index b6bb358b96ce..e2c382ffc5b6 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -1089,6 +1089,10 @@ static int spinand_init(struct spinand_device *spinand) mtd->oobavail = ret; + /* Propagate ECC information to mtd_info */ + mtd->ecc_strength = nand->eccreq.strength; + mtd->ecc_step_size = nand->eccreq.step_size; + return 0; err_cleanup_nanddev: |