summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/fsmc_nand.c
diff options
context:
space:
mode:
authorBoris Brezillon2017-11-30 18:01:29 +0100
committerBoris Brezillon2017-12-14 13:34:12 +0100
commit97d90da8a886949f09bb4754843fb0b504956ad2 (patch)
tree717e10487d3c8352d5529e64ed42fef59f6e5367 /drivers/mtd/nand/fsmc_nand.c
parentmtd: nand: use usual return values for the ->erase() hook (diff)
downloadkernel-qcow2-linux-97d90da8a886949f09bb4754843fb0b504956ad2.tar.gz
kernel-qcow2-linux-97d90da8a886949f09bb4754843fb0b504956ad2.tar.xz
kernel-qcow2-linux-97d90da8a886949f09bb4754843fb0b504956ad2.zip
mtd: nand: provide several helpers to do common NAND operations
This is part of the process of removing direct calls to ->cmdfunc() outside of the core in order to introduce a better interface to execute NAND operations. Here we provide several helpers and make use of them to remove all direct calls to ->cmdfunc(). This way, we can easily modify those helpers to make use of the new ->exec_op() interface when available. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> [miquel.raynal@free-electrons.com: rebased and fixed some conflicts] Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com> Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'drivers/mtd/nand/fsmc_nand.c')
-rw-r--r--drivers/mtd/nand/fsmc_nand.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index eac15d9bf49e..b44e5c6545e0 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -697,7 +697,7 @@ static int fsmc_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
unsigned int max_bitflips = 0;
for (i = 0, s = 0; s < eccsteps; s++, i += eccbytes, p += eccsize) {
- chip->cmdfunc(mtd, NAND_CMD_READ0, s * eccsize, page);
+ nand_read_page_op(chip, page, s * eccsize, NULL, 0);
chip->ecc.hwctl(mtd, NAND_ECC_READ);
chip->read_buf(mtd, p, eccsize);
@@ -720,8 +720,7 @@ static int fsmc_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
if (chip->options & NAND_BUSWIDTH_16)
len = roundup(len, 2);
- chip->cmdfunc(mtd, NAND_CMD_READOOB, off, page);
- chip->read_buf(mtd, oob + j, len);
+ nand_read_oob_op(chip, page, off, oob + j, len);
j += len;
}