summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/raw/docg4.c
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@bootlin.com>2018-09-06 14:05:21 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2018-10-03 11:12:25 +0200
commit767eb6fbdedb7d8b9c7a87d640a8bc8091eba002 (patch)
tree4cfde7b9eeb634080e423cf65d3679d8716c8299 /drivers/mtd/nand/raw/docg4.c
parentmtd: rawnand: Pass a nand_chip object to ecc->read_xxx() hooks (diff)
downloadlinux-767eb6fbdedb7d8b9c7a87d640a8bc8091eba002.tar.xz
linux-767eb6fbdedb7d8b9c7a87d640a8bc8091eba002.zip
mtd: rawnand: Pass a nand_chip object to ecc->write_xxx() hooks
Let's make the raw NAND API consistent by patching all helpers and hooks to take a nand_chip object instead of an mtd_info one or remove the mtd_info object when both are passed. Let's tackle all ecc->write_xxx() hooks at once. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Diffstat (limited to 'drivers/mtd/nand/raw/docg4.c')
-rw-r--r--drivers/mtd/nand/raw/docg4.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/mtd/nand/raw/docg4.c b/drivers/mtd/nand/raw/docg4.c
index ebaa479ffcb2..37935fd04020 100644
--- a/drivers/mtd/nand/raw/docg4.c
+++ b/drivers/mtd/nand/raw/docg4.c
@@ -1007,20 +1007,19 @@ static int write_page(struct mtd_info *mtd, struct nand_chip *nand,
return nand_prog_page_end_op(nand);
}
-static int docg4_write_page_raw(struct mtd_info *mtd, struct nand_chip *nand,
- const uint8_t *buf, int oob_required, int page)
+static int docg4_write_page_raw(struct nand_chip *nand, const uint8_t *buf,
+ int oob_required, int page)
{
- return write_page(mtd, nand, buf, page, false);
+ return write_page(nand_to_mtd(nand), nand, buf, page, false);
}
-static int docg4_write_page(struct mtd_info *mtd, struct nand_chip *nand,
- const uint8_t *buf, int oob_required, int page)
+static int docg4_write_page(struct nand_chip *nand, const uint8_t *buf,
+ int oob_required, int page)
{
- return write_page(mtd, nand, buf, page, true);
+ return write_page(nand_to_mtd(nand), nand, buf, page, true);
}
-static int docg4_write_oob(struct mtd_info *mtd, struct nand_chip *nand,
- int page)
+static int docg4_write_oob(struct nand_chip *nand, int page)
{
/*
* Writing oob-only is not really supported, because MLC nand must write
@@ -1144,7 +1143,7 @@ static int docg4_block_markbad(struct mtd_info *mtd, loff_t ofs)
/* write first page of block */
write_page_prologue(mtd, g4_addr);
- docg4_write_page(mtd, nand, buf, 1, page);
+ docg4_write_page(nand, buf, 1, page);
ret = pageprog(mtd);
kfree(buf);