aboutsummaryrefslogtreecommitdiff
path: root/libflash
diff options
context:
space:
mode:
authorCyril Bur <cyril.bur@au1.ibm.com>2016-11-08 17:08:41 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-11-08 17:37:06 +1100
commite5720d3fe94f5b85c374520b89fb8fbb2143df94 (patch)
tree31b0e18382244697381d05a01eb90a55aba65095 /libflash
parent71f77880462e72b9888237ae8f1fbdf36da2ef0e (diff)
downloadskiboot-e5720d3fe94f5b85c374520b89fb8fbb2143df94.zip
skiboot-e5720d3fe94f5b85c374520b89fb8fbb2143df94.tar.gz
skiboot-e5720d3fe94f5b85c374520b89fb8fbb2143df94.tar.bz2
libflash/file: Use 64bit ioctl() to erase from MTD
While we'll 'never' have flash chips larger than 32bit, work was recently done to blocklevel for it to be 64bit compatible for other backends. Since there is a 64bit ioctl() lets use it. There is currently no known case where 32bit is not sufficient but this doesn't mean someone might not do something strange in the future. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libflash')
-rw-r--r--libflash/file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libflash/file.c b/libflash/file.c
index 946726c..5f074cf 100644
--- a/libflash/file.c
+++ b/libflash/file.c
@@ -130,12 +130,12 @@ static int file_erase(struct blocklevel_device *bl, uint64_t dst, uint64_t len)
static int mtd_erase(struct blocklevel_device *bl, uint64_t dst, uint64_t len)
{
struct file_data *file_data = container_of(bl, struct file_data, bl);
- struct erase_info_user erase_info = {
+ struct erase_info_user64 erase_info = {
.start = dst,
.length = len
};
- if (ioctl(file_data->fd, MEMERASE, &erase_info) == -1)
+ if (ioctl(file_data->fd, MEMERASE64, &erase_info) == -1)
return FLASH_ERR_PARM_ERROR;
return 0;