diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2016-02-08 14:23:12 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-02-09 09:32:29 +0100 |
commit | 81737c1d436add87e26a22dca9dd750b9655de01 (patch) | |
tree | fc85417cd52a3967c970a57ab95352d33baae6e8 /include/driver.h | |
parent | e0ae56c00864b0c1dc77b34d26c4e59096ad5403 (diff) | |
download | barebox-81737c1d436add87e26a22dca9dd750b9655de01.tar.gz barebox-81737c1d436add87e26a22dca9dd750b9655de01.tar.xz |
mtd: Fix erasing of devices >4GiB
When a device >4GiB is erased, not only the offset can be bigger
than 4GiB, but also the size. This happens with the simplest command
to erase a device: erase /dev/nand0. Make the size argument a 64bit
type to make this work.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/driver.h')
-rw-r--r-- | include/driver.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/driver.h b/include/driver.h index 31c673452f..ce8c966734 100644 --- a/include/driver.h +++ b/include/driver.h @@ -425,7 +425,7 @@ struct file_operations { int (*open)(struct cdev*, unsigned long flags); int (*close)(struct cdev*); int (*flush)(struct cdev*); - int (*erase)(struct cdev*, size_t count, loff_t offset); + int (*erase)(struct cdev*, loff_t count, loff_t offset); int (*protect)(struct cdev*, size_t count, loff_t offset, int prot); int (*memmap)(struct cdev*, void **map, int flags); }; @@ -470,7 +470,7 @@ int cdev_flush(struct cdev *cdev); ssize_t cdev_read(struct cdev *cdev, void *buf, size_t count, loff_t offset, ulong flags); ssize_t cdev_write(struct cdev *cdev, const void *buf, size_t count, loff_t offset, ulong flags); int cdev_ioctl(struct cdev *cdev, int cmd, void *buf); -int cdev_erase(struct cdev *cdev, size_t count, loff_t offset); +int cdev_erase(struct cdev *cdev, loff_t count, loff_t offset); #define DEVFS_PARTITION_FIXED (1U << 0) #define DEVFS_PARTITION_READONLY (1U << 1) |