projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
96489c1
)
mtd: nand: Add a new helper to retrieve the ECC context
author
Miquel Raynal
<miquel.raynal@bootlin.com>
Thu, 16 Dec 2021 11:16:39 +0000
(12:16 +0100)
committer
Miquel Raynal
<miquel.raynal@bootlin.com>
Sun, 23 Jan 2022 11:36:23 +0000
(12:36 +0100)
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: Miquel Raynal <miquel.raynal@bootlin.com>
Link:
https://lore.kernel.org/linux-mtd/20211216111654.238086-14-miquel.raynal@bootlin.com
include/linux/mtd/nand.h
patch
|
blob
|
history
diff --git
a/include/linux/mtd/nand.h
b/include/linux/mtd/nand.h
index 4ddd20fe9c9e1d90792481fc85e0adb84294e969..b617efa0a881b586b59942284b47e80c1584861a 100644
(file)
--- a/
include/linux/mtd/nand.h
+++ b/
include/linux/mtd/nand.h
@@
-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);
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 */
enum nand_bbt_block_status {
NAND_BBT_BLOCK_STATUS_UNKNOWN,