mtd: Support for 4GB partitions
This patch implements correct way of creating partitions on mtd devices with size >= 4GB. Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com> Signed-off-by: Grigory Milev <g.milev@sam-solutions.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
1ee640765a
commit
76a88c0227
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue