[PATCH v3 3/9] mtd: nand: ecc-hamming: Populate the public nsteps field

Miquel Raynal miquel.raynal at bootlin.com
Wed Jan 27 15:30:14 EST 2021


Advertize the actual number of steps that will actually be used by the
driver by populating the public field.

Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>
---
 drivers/mtd/nand/ecc-sw-hamming.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/nand/ecc-sw-hamming.c b/drivers/mtd/nand/ecc-sw-hamming.c
index 6334d1d7735d..5144775e5a59 100644
--- a/drivers/mtd/nand/ecc-sw-hamming.c
+++ b/drivers/mtd/nand/ecc-sw-hamming.c
@@ -513,6 +513,7 @@ int nand_ecc_sw_hamming_init_ctx(struct nand_device *nand)
 	}
 
 	nand->ecc.ctx.priv = engine_conf;
+	nand->ecc.ctx.nsteps = mtd->writesize / conf->step_size;
 	nand->ecc.ctx.total = engine_conf->nsteps * engine_conf->code_size;
 
 	return 0;
-- 
2.20.1




More information about the linux-mtd mailing list