summaryrefslogtreecommitdiff
path: root/include/linux/mtd
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2020-09-30 01:01:08 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2020-11-30 09:27:32 +0100
commit3c0fe36abebee55821badaa9d6cecd03799f7843 (patch)
treeaf49ac5fef58f27190c57d8386ed205ea16a3f99 /include/linux/mtd
parent8c5c209218564a180e8b90fb12d29f72485c6c72 (diff)
mtd: nand: ecc-bch: Stop exporting the private structure
The NAND BCH control structure has nothing to do outside of this driver, all users of the nand_bch_init/free() functions just save it to chip->ecc.priv so do it in this driver directly and return a regular error code instead. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200929230124.31491-5-miquel.raynal@bootlin.com
Diffstat (limited to 'include/linux/mtd')
-rw-r--r--include/linux/mtd/nand-ecc-sw-bch.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/include/linux/mtd/nand-ecc-sw-bch.h b/include/linux/mtd/nand-ecc-sw-bch.h
index 1e1ee3af82b1..b62b8bd4669f 100644
--- a/include/linux/mtd/nand-ecc-sw-bch.h
+++ b/include/linux/mtd/nand-ecc-sw-bch.h
@@ -10,7 +10,6 @@
struct mtd_info;
struct nand_chip;
-struct nand_bch_control;
#if IS_ENABLED(CONFIG_MTD_NAND_ECC_SW_BCH)
@@ -30,11 +29,11 @@ int nand_bch_correct_data(struct nand_chip *chip, u_char *dat,
/*
* Initialize BCH encoder/decoder
*/
-struct nand_bch_control *nand_bch_init(struct mtd_info *mtd);
+int nand_bch_init(struct nand_chip *chip);
/*
* Release BCH encoder/decoder resources
*/
-void nand_bch_free(struct nand_bch_control *nbc);
+void nand_bch_free(struct nand_chip *chip);
#else /* !CONFIG_MTD_NAND_ECC_SW_BCH */
@@ -54,12 +53,12 @@ nand_bch_correct_data(struct nand_chip *chip, unsigned char *buf,
return -ENOTSUPP;
}
-static inline struct nand_bch_control *nand_bch_init(struct mtd_info *mtd)
+static inline int nand_bch_init(struct nand_chip *chip)
{
- return NULL;
+ return -ENOTSUPP;
}
-static inline void nand_bch_free(struct nand_bch_control *nbc) {}
+static inline void nand_bch_free(struct nand_chip *chip) {}
#endif /* CONFIG_MTD_NAND_ECC_SW_BCH */