diff options
author | Jan Luebbe <jlu@pengutronix.de> | 2012-07-12 11:46:02 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-07-16 11:08:47 +0200 |
commit | c410817f1929c3ad85d7ce2cfe2c9e714b8b994c (patch) | |
tree | b48f544d6aaa943d4a10f8fdc9d25ae85a5c7cd6 /drivers/mtd | |
parent | 4987f61ee22bd231aea7c23eb35942b9d1f18226 (diff) | |
download | barebox-c410817f1929c3ad85d7ce2cfe2c9e714b8b994c.tar.gz barebox-c410817f1929c3ad85d7ce2cfe2c9e714b8b994c.tar.xz |
mtd: fix 'write: Invalid argument' while writing to nand-bb devices
The 'off_t cur_ofs' variable was missed during the 64 bit conversion.
For the MEMGETBADBLOCK ioctl, a pointer to a loff_t is needed.
Also adjust the debug format strings.
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/nand-bb.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/nand/nand-bb.c b/drivers/mtd/nand/nand-bb.c index 5b06a9e653..519337e0ef 100644 --- a/drivers/mtd/nand/nand-bb.c +++ b/drivers/mtd/nand/nand-bb.c @@ -60,7 +60,7 @@ static ssize_t nand_bb_read(struct cdev *cdev, void *buf, size_t count, struct cdev *parent = bb->cdev_parent; int ret, bytes = 0, now; - debug("%s %d %d\n", __func__, offset, count); + debug("%s 0x%08llx %d\n", __func__, offset, count); while(count) { ret = cdev_ioctl(parent, MEMGETBADBLOCK, &bb->offset); @@ -96,7 +96,7 @@ static int nand_bb_write_buf(struct nand_bb *bb, size_t count) int ret, now; struct cdev *parent = bb->cdev_parent; void *buf = bb->writebuf; - off_t cur_ofs = bb->offset & ~(BB_WRITEBUF_SIZE - 1); + loff_t cur_ofs = bb->offset & ~(BB_WRITEBUF_SIZE - 1); while (count) { ret = cdev_ioctl(parent, MEMGETBADBLOCK, &cur_ofs); @@ -104,7 +104,7 @@ static int nand_bb_write_buf(struct nand_bb *bb, size_t count) return ret; if (ret) { - debug("skipping bad block at 0x%08x\n", cur_ofs); + debug("skipping bad block at 0x%08llx\n", cur_ofs); bb->offset += bb->info.erasesize; cur_ofs += bb->info.erasesize; continue; |