mtd: physmap_of: use ofpart through generic parsing

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Nov 7 11:59:19 EST 2011


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=5f4ba9f9251a76753f50a4b9b8f49e6ec83d3d22
Commit:     5f4ba9f9251a76753f50a4b9b8f49e6ec83d3d22
Parent:     d26c87d64eff271146b40b66c7de8cfeaf956707
Author:     Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
AuthorDate: Mon May 30 01:02:21 2011 +0400
Committer:  Artem Bityutskiy <artem.bityutskiy at intel.com>
CommitDate: Sun Sep 11 15:02:11 2011 +0300

    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 at gmail.com>
    Signed-off-by: Artem Bityutskiy <dedekind1 at gmail.com>
---
 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 d251d1d..6a75743 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,
    specifies the list of partition probers to use. If none is given then the
    default is use. These take precedence over other device tree
    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)
 {
 	const char *cp;
@@ -218,6 +219,7 @@ static int __devinit of_flash_probe(struct platform_device *dev)
 	int reg_tuple_size;
 	struct mtd_info **mtd_list = NULL;
 	resource_size_t res_size;
+	struct mtd_part_parser_data ppdata;
 
 	match = of_match_device(of_flash_match, &dev->dev);
 	if (!match)
@@ -331,9 +333,10 @@ static int __devinit of_flash_probe(struct platform_device *dev)
 	if (err)
 		goto err_out;
 
+	ppdata.of_node = dp;
 	part_probe_types = of_get_probes(dp);
 	err = parse_mtd_partitions(info->cmtd, part_probe_types,
-				   &info->parts, 0);
+				   &info->parts, &ppdata);
 	if (err < 0) {
 		of_free_probes(part_probe_types);
 		goto err_out;
@@ -341,12 +344,6 @@ static int __devinit of_flash_probe(struct platform_device *dev)
 	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) {
 		err = parse_obsolete_partitions(dev, info, dp);
 		if (err < 0)
 			goto err_out;



More information about the linux-mtd-cvs mailing list