Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7a71903 authored by Miquel Raynal's avatar Miquel Raynal Committed by Greg Kroah-Hartman
Browse files

mtd: spinand: Propagate ECC information to the MTD structure



[ Upstream commit 3507273d5a4d3c2e46f9d3f9ed9449805f5dff07 ]

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: 7529df46 ("mtd: nand: Add core infrastructure to support SPI NANDs")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 657a03ff
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1045,6 +1045,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: