diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2018-01-17 12:32:08 +0100 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@bootlin.com> | 2018-02-12 23:35:28 +0100 |
commit | 1af0b3147448954c50e555496b80d94a0800a5e4 (patch) | |
tree | 8ab8a0beac118d78f627309e5fada67328805eb0 | |
parent | 040bd3f6a3aa51a7182bba4243428e9df8507146 (diff) |
mtd: nand: mxc: Add buffer argument to copy_spare
With following patches we will have to copy the spare data to/from
other buffers, so add the buffer as argument to copy_spare().
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
-rw-r--r-- | drivers/mtd/nand/mxc_nand.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index 019c58579dbc..ab9cd45237d3 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c @@ -262,14 +262,14 @@ static void memcpy16_toio(void __iomem *trg, const void *src, int size) * holds a page in natural order, i.e. writesize bytes data + oobsize bytes * spare) and the NFC buffer. */ -static void copy_spare(struct mtd_info *mtd, bool bfrom) +static void copy_spare(struct mtd_info *mtd, bool bfrom, void *buf) { struct nand_chip *this = mtd_to_nand(mtd); struct mxc_nand_host *host = nand_get_controller_data(this); u16 i, oob_chunk_size; u16 num_chunks = mtd->writesize / 512; - u8 *d = host->data_buf + mtd->writesize; + u8 *d = buf; u8 __iomem *s = host->spare0; u16 sparebuf_size = host->devtype_data->spare_len; @@ -1295,7 +1295,7 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command, memcpy32_fromio(host->data_buf, host->main_area0, mtd->writesize); - copy_spare(mtd, true); + copy_spare(mtd, true, host->data_buf + mtd->writesize); break; case NAND_CMD_SEQIN: @@ -1314,7 +1314,7 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command, case NAND_CMD_PAGEPROG: memcpy32_toio(host->main_area0, host->data_buf, mtd->writesize); - copy_spare(mtd, false); + copy_spare(mtd, false, host->data_buf + mtd->writesize); host->devtype_data->send_page(mtd, NFC_INPUT); host->devtype_data->send_cmd(host, command, true); WARN_ONCE(column != -1 || page_addr != -1, |