--- zzzz-none-000/linux-4.9.276/drivers/mtd/maps/physmap_of.c 2021-07-20 14:21:16.000000000 +0000 +++ falcon-5530-750/linux-4.9.276/drivers/mtd/maps/physmap_of.c 2023-04-05 08:19:01.000000000 +0000 @@ -104,47 +104,9 @@ static const char * const part_probe_types_def[] = { "cmdlinepart", "RedBoot", "ofpart", "ofoldpart", NULL }; -static const char * const *of_get_probes(struct device_node *dp) -{ - const char *cp; - int cplen; - unsigned int l; - unsigned int count; - const char **res; - - cp = of_get_property(dp, "linux,part-probe", &cplen); - if (cp == NULL) - return part_probe_types_def; - - count = 0; - for (l = 0; l != cplen; l++) - if (cp[l] == 0) - count++; - - res = kzalloc((count + 1)*sizeof(*res), GFP_KERNEL); - if (!res) - return NULL; - count = 0; - while (cplen > 0) { - res[count] = cp; - l = strlen(cp) + 1; - cp += l; - cplen -= l; - count++; - } - return res; -} - -static void of_free_probes(const char * const *probes) -{ - if (probes != part_probe_types_def) - kfree(probes); -} - static const struct of_device_id of_flash_match[]; static int of_flash_probe(struct platform_device *dev) { - const char * const *part_probe_types; const struct of_device_id *match; struct device_node *dp = dev->dev.of_node; struct resource res; @@ -300,14 +262,8 @@ info->cmtd->dev.parent = &dev->dev; mtd_set_of_node(info->cmtd, dp); - part_probe_types = of_get_probes(dp); - if (!part_probe_types) { - err = -ENOMEM; - goto err_out; - } - mtd_device_parse_register(info->cmtd, part_probe_types, NULL, - NULL, 0); - of_free_probes(part_probe_types); + mtd_device_parse_register(info->cmtd, part_probe_types_def, NULL, + NULL, 0); kfree(mtd_list);