--- zzzz-none-000/linux-4.9.276/drivers/mtd/ofpart.c 2021-07-20 14:21:16.000000000 +0000 +++ falcon-5530-750/linux-4.9.276/drivers/mtd/ofpart.c 2023-04-05 08:19:01.000000000 +0000 @@ -25,9 +25,9 @@ return of_get_property(pp, "compatible", NULL); } -static int parse_ofpart_partitions(struct mtd_info *master, - const struct mtd_partition **pparts, - struct mtd_part_parser_data *data) +static int parse_fixed_partitions(struct mtd_info *master, + const struct mtd_partition **pparts, + struct mtd_part_parser_data *data) { struct mtd_partition *parts; struct device_node *mtd_node; @@ -108,6 +108,7 @@ parts[i].offset = of_read_number(reg, a_cells); parts[i].size = of_read_number(reg + a_cells, s_cells); + parts[i].of_node = pp; partname = of_get_property(pp, "label", &len); if (!partname) @@ -139,9 +140,16 @@ return ret; } +static const struct of_device_id parse_ofpart_match_table[] = { + { .compatible = "fixed-partitions" }, + {}, +}; +MODULE_DEVICE_TABLE(of, parse_ofpart_match_table); + static struct mtd_part_parser ofpart_parser = { - .parse_fn = parse_ofpart_partitions, - .name = "ofpart", + .parse_fn = parse_fixed_partitions, + .name = "fixed-partitions", + .of_match_table = parse_ofpart_match_table, }; static int parse_ofoldpart_partitions(struct mtd_info *master, @@ -229,4 +237,5 @@ * with the same name. Since we provide the ofoldpart parser, we should have * the corresponding alias. */ +MODULE_ALIAS("fixed-partitions"); MODULE_ALIAS("ofoldpart");