From 76a88c0227a74c48828b8d307f0afab2b2537aec Mon Sep 17 00:00:00 2001 From: Dmitry Lavnikevich Date: Mon, 10 Mar 2014 14:39:50 +0300 Subject: mtd: Support for 4GB partitions This patch implements correct way of creating partitions on mtd devices with size >= 4GB. Signed-off-by: Dmitry Lavnikevich Signed-off-by: Grigory Milev Signed-off-by: Sascha Hauer --- commands/partition.c | 4 ++-- drivers/mtd/partition.c | 4 ++-- include/linux/mtd/mtd.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/commands/partition.c b/commands/partition.c index f8257222a9..44b91d1a13 100644 --- a/commands/partition.c +++ b/commands/partition.c @@ -59,11 +59,11 @@ static int mtd_part_do_parse_one(char *devname, const char *partstr, size = SIZE_REMAINING; end = (char *)partstr + 1; } else { - size = strtoul_suffix(partstr, &end, 0); + size = strtoull_suffix(partstr, &end, 0); } if (*end == '@') - *offset = strtoul_suffix(end+1, &end, 0); + *offset = strtoull_suffix(end+1, &end, 0); if (size == SIZE_REMAINING) size = devsize - *offset; diff --git a/drivers/mtd/partition.c b/drivers/mtd/partition.c index 351c5831b0..720c2adab3 100644 --- a/drivers/mtd/partition.c +++ b/drivers/mtd/partition.c @@ -75,8 +75,8 @@ static int mtd_part_block_markbad(struct mtd_info *mtd, loff_t ofs) return res; } -struct mtd_info *mtd_add_partition(struct mtd_info *mtd, off_t offset, size_t size, - unsigned long flags, const char *name) +struct mtd_info *mtd_add_partition(struct mtd_info *mtd, off_t offset, + uint64_t size, unsigned long flags, const char *name) { struct mtd_info *part; int start = 0, end = 0, i; diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 970cdb02fa..c63b514f44 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -280,8 +280,8 @@ struct mtd_notifier { struct list_head list; }; -struct mtd_info *mtd_add_partition(struct mtd_info *mtd, off_t offset, size_t size, - unsigned long flags, const char *name); +struct mtd_info *mtd_add_partition(struct mtd_info *mtd, off_t offset, + uint64_t size, unsigned long flags, const char *name); int mtd_del_partition(struct mtd_info *mtd); extern void register_mtd_user (struct mtd_notifier *new); -- cgit v1.2.3