summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/raw/omap2.c
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 /drivers/mtd/nand/raw/omap2.c
parent8c5c209218564a180e8b90fb12d29f72485c6c72 (diff)
downloadlinux-3c0fe36abebee55821badaa9d6cecd03799f7843.tar.bz2
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 'drivers/mtd/nand/raw/omap2.c')
-rw-r--r--drivers/mtd/nand/raw/omap2.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/mtd/nand/raw/omap2.c b/drivers/mtd/nand/raw/omap2.c
index 0ef209e1cd87..6aab57336690 100644
--- a/drivers/mtd/nand/raw/omap2.c
+++ b/drivers/mtd/nand/raw/omap2.c
@@ -2047,10 +2047,10 @@ static int omap_nand_attach_chip(struct nand_chip *chip)
/* Reserve one byte for the OMAP marker */
oobbytes_per_step = chip->ecc.bytes + 1;
/* Software BCH library is used for locating errors */
- chip->ecc.priv = nand_bch_init(mtd);
- if (!chip->ecc.priv) {
+ err = nand_bch_init(chip);
+ if (err) {
dev_err(dev, "Unable to use BCH library\n");
- return -EINVAL;
+ return err;
}
break;
@@ -2089,10 +2089,10 @@ static int omap_nand_attach_chip(struct nand_chip *chip)
/* Reserve one byte for the OMAP marker */
oobbytes_per_step = chip->ecc.bytes + 1;
/* Software BCH library is used for locating errors */
- chip->ecc.priv = nand_bch_init(mtd);
- if (!chip->ecc.priv) {
+ err = nand_bch_init(chip);
+ if (err) {
dev_err(dev, "unable to use BCH library\n");
- return -EINVAL;
+ return err;
}
break;
@@ -2272,7 +2272,7 @@ return_error:
if (!IS_ERR_OR_NULL(info->dma))
dma_release_channel(info->dma);
if (nand_chip->ecc.priv) {
- nand_bch_free(nand_chip->ecc.priv);
+ nand_bch_free(nand_chip);
nand_chip->ecc.priv = NULL;
}
return err;
@@ -2286,7 +2286,7 @@ static int omap_nand_remove(struct platform_device *pdev)
int ret;
if (nand_chip->ecc.priv) {
- nand_bch_free(nand_chip->ecc.priv);
+ nand_bch_free(nand_chip);
nand_chip->ecc.priv = NULL;
}
if (info->dma)