diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2011-05-29 17:02:21 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2011-09-11 08:02:11 -0400 |
commit | 5f4ba9f9251a76753f50a4b9b8f49e6ec83d3d22 (patch) | |
tree | f4c8fa5bc780ecdb24c6b4ec69e722a1f98901cd /drivers/mtd | |
parent | d26c87d64eff271146b40b66c7de8cfeaf956707 (diff) |
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: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/maps/physmap_of.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c index d251d1db129..6a75743f8ea 100644 --- a/drivers/mtd/maps/physmap_of.c +++ b/drivers/mtd/maps/physmap_of.c | |||
@@ -165,7 +165,8 @@ static struct mtd_info * __devinit obsolete_probe(struct platform_device *dev, | |||
165 | specifies the list of partition probers to use. If none is given then the | 165 | specifies the list of partition probers to use. If none is given then the |
166 | default is use. These take precedence over other device tree | 166 | default is use. These take precedence over other device tree |
167 | information. */ | 167 | information. */ |
168 | static const char *part_probe_types_def[] = { "cmdlinepart", "RedBoot", NULL }; | 168 | static const char *part_probe_types_def[] = { "cmdlinepart", "RedBoot", |
169 | "ofpart", NULL }; | ||
169 | static const char ** __devinit of_get_probes(struct device_node *dp) | 170 | static const char ** __devinit of_get_probes(struct device_node *dp) |
170 | { | 171 | { |
171 | const char *cp; | 172 | const char *cp; |
@@ -218,6 +219,7 @@ static int __devinit of_flash_probe(struct platform_device *dev) | |||
218 | int reg_tuple_size; | 219 | int reg_tuple_size; |
219 | struct mtd_info **mtd_list = NULL; | 220 | struct mtd_info **mtd_list = NULL; |
220 | resource_size_t res_size; | 221 | resource_size_t res_size; |
222 | struct mtd_part_parser_data ppdata; | ||
221 | 223 | ||
222 | match = of_match_device(of_flash_match, &dev->dev); | 224 | match = of_match_device(of_flash_match, &dev->dev); |
223 | if (!match) | 225 | if (!match) |
@@ -331,9 +333,10 @@ static int __devinit of_flash_probe(struct platform_device *dev) | |||
331 | if (err) | 333 | if (err) |
332 | goto err_out; | 334 | goto err_out; |
333 | 335 | ||
336 | ppdata.of_node = dp; | ||
334 | part_probe_types = of_get_probes(dp); | 337 | part_probe_types = of_get_probes(dp); |
335 | err = parse_mtd_partitions(info->cmtd, part_probe_types, | 338 | err = parse_mtd_partitions(info->cmtd, part_probe_types, |
336 | &info->parts, 0); | 339 | &info->parts, &ppdata); |
337 | if (err < 0) { | 340 | if (err < 0) { |
338 | of_free_probes(part_probe_types); | 341 | of_free_probes(part_probe_types); |
339 | goto err_out; | 342 | goto err_out; |
@@ -341,12 +344,6 @@ static int __devinit of_flash_probe(struct platform_device *dev) | |||
341 | of_free_probes(part_probe_types); | 344 | of_free_probes(part_probe_types); |
342 | 345 | ||
343 | if (err == 0) { | 346 | if (err == 0) { |
344 | err = of_mtd_parse_partitions(&dev->dev, dp, &info->parts); | ||
345 | if (err < 0) | ||
346 | goto err_out; | ||
347 | } | ||
348 | |||
349 | if (err == 0) { | ||
350 | err = parse_obsolete_partitions(dev, info, dp); | 347 | err = parse_obsolete_partitions(dev, info, dp); |
351 | if (err < 0) | 348 | if (err < 0) |
352 | goto err_out; | 349 | goto err_out; |