diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-07-08 22:29:39 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-07-10 19:07:33 +0200 |
commit | 4987f61ee22bd231aea7c23eb35942b9d1f18226 (patch) | |
tree | 59de6992397d344163916a6ffccce588afd30770 /drivers/mtd | |
parent | 75821bdef50fa7f14111ac0e24da2fb5b2af5d30 (diff) | |
download | barebox-4987f61ee22bd231aea7c23eb35942b9d1f18226.tar.gz barebox-4987f61ee22bd231aea7c23eb35942b9d1f18226.tar.xz |
mtd: fix bad block ioctls
Since this commit we interpret the argument to the bad block ioctls
as a pointer to a 64bit number:
|commit e71c34366808bbe3ce0b166d8710749513af6d81
|Author: Sascha Hauer <s.hauer@pengutronix.de>
|Date: Fri Oct 14 11:57:55 2011 +0200
|
| mtd: fix arguments to bad block ioctls
|
| In the Kernel the mtd ioctls expect a pointer to the offset, whereas
| barebox interprets the pointer itself as an offset. Since we want
| to add 64bit support for file sizes a pointer may not be sufficient,
| so align with the kernel and convert it to a pointer to the offset.
|
| Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This missed some places, fix them aswell.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/nand-bb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/nand/nand-bb.c b/drivers/mtd/nand/nand-bb.c index d27274924a..5b06a9e653 100644 --- a/drivers/mtd/nand/nand-bb.c +++ b/drivers/mtd/nand/nand-bb.c @@ -216,7 +216,7 @@ static int nand_bb_calc_size(struct nand_bb *bb) static loff_t nand_bb_lseek(struct cdev *cdev, loff_t __offset) { struct nand_bb *bb = cdev->priv; - unsigned long raw_pos = 0; + loff_t raw_pos = 0; uint32_t offset = __offset; int ret; @@ -226,7 +226,7 @@ static loff_t nand_bb_lseek(struct cdev *cdev, loff_t __offset) while (raw_pos < bb->raw_size) { off_t now = min(offset, bb->info.erasesize); - ret = cdev_ioctl(bb->cdev_parent, MEMGETBADBLOCK, (void *)raw_pos); + ret = cdev_ioctl(bb->cdev_parent, MEMGETBADBLOCK, &raw_pos); if (ret < 0) return ret; if (!ret) { |