提交 cda32a61 编写于 作者: M Miquel Raynal

mtd: nand: Add a new helper to retrieve the ECC context

Introduce nand_to_ecc_ctx() which will allow to easily jump to the
private pointer of an ECC context given a NAND device. This is very
handy, from the prepare or finish ECC hook, to get the internal context
out of the NAND device object.
Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20211216111654.238086-14-miquel.raynal@bootlin.com
上级 96489c1c
...@@ -990,6 +990,11 @@ int nanddev_markbad(struct nand_device *nand, const struct nand_pos *pos); ...@@ -990,6 +990,11 @@ int nanddev_markbad(struct nand_device *nand, const struct nand_pos *pos);
int nanddev_ecc_engine_init(struct nand_device *nand); int nanddev_ecc_engine_init(struct nand_device *nand);
void nanddev_ecc_engine_cleanup(struct nand_device *nand); void nanddev_ecc_engine_cleanup(struct nand_device *nand);
static inline void *nand_to_ecc_ctx(struct nand_device *nand)
{
return nand->ecc.ctx.priv;
}
/* BBT related functions */ /* BBT related functions */
enum nand_bbt_block_status { enum nand_bbt_block_status {
NAND_BBT_BLOCK_STATUS_UNKNOWN, NAND_BBT_BLOCK_STATUS_UNKNOWN,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册