16 #include <linux/module.h>
20 #include <linux/slab.h>
23 static int parse_ofpart_partitions(
struct mtd_info *master,
49 *pparts = kzalloc(nr_parts *
sizeof(**pparts),
GFP_KERNEL);
71 (*pparts)[
i].name = (
char *)partname;
92 .parse_fn = parse_ofpart_partitions,
96 static int parse_ofoldpart_partitions(
struct mtd_info *master,
101 int i,
plen, nr_parts;
118 pr_warning(
"Device tree uses obsolete partition map binding: %s\n",
121 nr_parts = plen /
sizeof(
part[0]);
123 *pparts = kzalloc(nr_parts *
sizeof(*(*pparts)),
GFP_KERNEL);
129 for (i = 0; i < nr_parts; i++) {
136 if (names && (plen > 0)) {
137 int len =
strlen(names) + 1;
139 (*pparts)[
i].name = (
char *)names;
143 (*pparts)[
i].name =
"unnamed";
154 .parse_fn = parse_ofoldpart_partitions,
158 static int __init ofpart_parser_init(
void)