Skip to content

Commit e3554b1

Browse files
committed
mtd: nand: Add a helper to retrieve the number of ECC steps
This operation is very common and deserves a helper. It of course only works after the ECC engine initialization. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Tested-by: Adam Ford <aford173@gmail.com> #logicpd Torpedo Link: https://lore.kernel.org/linux-mtd/20210127203020.9574-5-miquel.raynal@bootlin.com
1 parent 12e0df0 commit e3554b1

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎include/linux/mtd/nand.h‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,16 @@ nanddev_get_ecc_conf(struct nand_device *nand)
587587
return &nand->ecc.ctx.conf;
588588
}
589589

590+
/**
591+
* nanddev_get_ecc_nsteps() - Extract the number of ECC steps
592+
* @nand: NAND device
593+
*/
594+
static inline unsigned int
595+
nanddev_get_ecc_nsteps(struct nand_device *nand)
596+
{
597+
return nand->ecc.ctx.nsteps;
598+
}
599+
590600
/**
591601
* nanddev_get_ecc_requirements() - Extract the ECC requirements from a NAND
592602
* device

0 commit comments

Comments
 (0)