1
0
Fork 0

mtd: spinand: Propagate ECC information to the MTD structure

[ Upstream commit 3507273d5a ]

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: 7529df4652 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
5.4-rM2-2.2.x-imx-squashed
Miquel Raynal 2020-05-13 15:10:29 +02:00 committed by Greg Kroah-Hartman
parent e3637eb6a3
commit 725b0bb0f9
1 changed files with 4 additions and 0 deletions

View File

@ -1049,6 +1049,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: