1 --- a/drivers/mtd/mtdpart.c
2 +++ b/drivers/mtd/mtdpart.c
3 @@ -641,6 +641,37 @@ int mtd_del_partition(struct mtd_info *m
5 EXPORT_SYMBOL_GPL(mtd_del_partition);
8 +run_parsers_by_type(struct mtd_part *slave, enum mtd_parser_type type)
10 + struct mtd_partition *parts;
14 + nr_parts = parse_mtd_partitions_by_type(&slave->mtd, type, &parts,
19 + if (WARN_ON(!parts))
22 + for (i = 0; i < nr_parts; i++) {
23 + /* adjust partition offsets */
24 + parts[i].offset += slave->offset;
26 + __mtd_add_partition(slave->master,
38 static inline unsigned long
39 mtd_pad_erasesize(struct mtd_info *mtd, int offset, int len)
41 @@ -686,6 +717,12 @@ static void split_uimage(struct mtd_info
43 static void split_firmware(struct mtd_info *master, struct mtd_part *part)
47 + ret = run_parsers_by_type(part, MTD_PARSER_TYPE_FIRMWARE);
51 if (config_enabled(CONFIG_MTD_UIMAGE_SPLIT))
52 split_uimage(master, part);
54 @@ -702,6 +739,12 @@ static void mtd_partition_split(struct m
58 + if (!strcmp(part->mtd.name, "rootfs")) {
59 + run_parsers_by_type(part, MTD_PARSER_TYPE_ROOTFS);
64 if (!strcmp(part->mtd.name, SPLIT_FIRMWARE_NAME) &&
65 config_enabled(CONFIG_MTD_SPLIT_FIRMWARE))
66 split_firmware(master, part);
67 --- a/include/linux/mtd/partitions.h
68 +++ b/include/linux/mtd/partitions.h
69 @@ -70,6 +70,8 @@ struct mtd_part_parser_data {
71 enum mtd_parser_type {
72 MTD_PARSER_TYPE_DEVICE = 0,
73 + MTD_PARSER_TYPE_ROOTFS,
74 + MTD_PARSER_TYPE_FIRMWARE,
77 struct mtd_part_parser {