aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/raw/nand_bbt.c
diff options
context:
space:
mode:
authorBoris Brezillon <bbrezillon@kernel.org>2018-10-28 15:27:55 +0100
committerMiquel Raynal <miquel.raynal@bootlin.com>2019-04-08 10:21:13 +0200
commiteeab717483e5fb529c8001d36fbda14011905e5f (patch)
tree370fe60ea2de0ee3d6847dad53ba2abeea8c1b71 /drivers/mtd/nand/raw/nand_bbt.c
parentmtd: rawnand: Initialize the nand_device object (diff)
downloadlinux-dev-eeab717483e5fb529c8001d36fbda14011905e5f.tar.xz
linux-dev-eeab717483e5fb529c8001d36fbda14011905e5f.zip
mtd: rawnand: Provide a helper to get chip->data_buf
We plan to move cache related fields to a pagecache struct in nand_chip but some drivers access ->pagebuf directly to invalidate the cache before they start using ->data_buf. Let's provide an helper that returns a pointer to ->data_buf after invalidating the cache. Signed-off-by: Boris Brezillon <bbrezillon@kernel.org> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Diffstat (limited to 'drivers/mtd/nand/raw/nand_bbt.c')
-rw-r--r--drivers/mtd/nand/raw/nand_bbt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/nand/raw/nand_bbt.c b/drivers/mtd/nand/raw/nand_bbt.c
index 19a2b563acdf..fff803695b2d 100644
--- a/drivers/mtd/nand/raw/nand_bbt.c
+++ b/drivers/mtd/nand/raw/nand_bbt.c
@@ -901,7 +901,9 @@ static int write_bbt(struct nand_chip *this, uint8_t *buf,
static inline int nand_memory_bbt(struct nand_chip *this,
struct nand_bbt_descr *bd)
{
- return create_bbt(this, this->data_buf, bd, -1);
+ u8 *pagebuf = nand_get_data_buf(this);
+
+ return create_bbt(this, pagebuf, bd, -1);
}
/**