提交 5f4ba9f9 编写于 作者: D Dmitry Eremin-Solenikov 提交者: Artem Bityutskiy

mtd: physmap_of: use ofpart through generic parsing

Convert the driver to use ofpart partitions parsing through the generic
parse_mtd_partitions().
Signed-off-by: NDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: NArtem Bityutskiy <dedekind1@gmail.com>
上级 d26c87d6
...@@ -165,7 +165,8 @@ static struct mtd_info * __devinit obsolete_probe(struct platform_device *dev, ...@@ -165,7 +165,8 @@ static struct mtd_info * __devinit obsolete_probe(struct platform_device *dev,
specifies the list of partition probers to use. If none is given then the specifies the list of partition probers to use. If none is given then the
default is use. These take precedence over other device tree default is use. These take precedence over other device tree
information. */ information. */
static const char *part_probe_types_def[] = { "cmdlinepart", "RedBoot", NULL }; static const char *part_probe_types_def[] = { "cmdlinepart", "RedBoot",
"ofpart", NULL };
static const char ** __devinit of_get_probes(struct device_node *dp) static const char ** __devinit of_get_probes(struct device_node *dp)
{ {
const char *cp; const char *cp;
...@@ -218,6 +219,7 @@ static int __devinit of_flash_probe(struct platform_device *dev) ...@@ -218,6 +219,7 @@ static int __devinit of_flash_probe(struct platform_device *dev)
int reg_tuple_size; int reg_tuple_size;
struct mtd_info **mtd_list = NULL; struct mtd_info **mtd_list = NULL;
resource_size_t res_size; resource_size_t res_size;
struct mtd_part_parser_data ppdata;
match = of_match_device(of_flash_match, &dev->dev); match = of_match_device(of_flash_match, &dev->dev);
if (!match) if (!match)
...@@ -331,21 +333,16 @@ static int __devinit of_flash_probe(struct platform_device *dev) ...@@ -331,21 +333,16 @@ static int __devinit of_flash_probe(struct platform_device *dev)
if (err) if (err)
goto err_out; goto err_out;
ppdata.of_node = dp;
part_probe_types = of_get_probes(dp); part_probe_types = of_get_probes(dp);
err = parse_mtd_partitions(info->cmtd, part_probe_types, err = parse_mtd_partitions(info->cmtd, part_probe_types,
&info->parts, 0); &info->parts, &ppdata);
if (err < 0) { if (err < 0) {
of_free_probes(part_probe_types); of_free_probes(part_probe_types);
goto err_out; goto err_out;
} }
of_free_probes(part_probe_types); of_free_probes(part_probe_types);
if (err == 0) {
err = of_mtd_parse_partitions(&dev->dev, dp, &info->parts);
if (err < 0)
goto err_out;
}
if (err == 0) { if (err == 0) {
err = parse_obsolete_partitions(dev, info, dp); err = parse_obsolete_partitions(dev, info, dp);
if (err < 0) if (err < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册