summaryrefslogtreecommitdiff
path: root/include/linux/mtd
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2021-01-27 21:30:15 +0100
committerMiquel Raynal <miquel.raynal@bootlin.com>2021-03-11 09:37:28 +0100
commite3554b10babd8ee1cf43bfc840ef4657eb1d12aa (patch)
tree9c306d55f482f20149526b65583553b1471f7629 /include/linux/mtd
parent12e0df0c6f60baf10f6ecb78a086bf1048ad9d8b (diff)
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
Diffstat (limited to 'include/linux/mtd')
-rw-r--r--include/linux/mtd/nand.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 632becb13b46..8a0116396689 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -588,6 +588,16 @@ nanddev_get_ecc_conf(struct nand_device *nand)
}
/**
+ * nanddev_get_ecc_nsteps() - Extract the number of ECC steps
+ * @nand: NAND device
+ */
+static inline unsigned int
+nanddev_get_ecc_nsteps(struct nand_device *nand)
+{
+ return nand->ecc.ctx.nsteps;
+}
+
+/**
* nanddev_get_ecc_requirements() - Extract the ECC requirements from a NAND
* device
* @nand: NAND device