mtd: fsl_upm: use ofpart through generic parsing

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


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

    mtd: fsl_upm: 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/nand/fsl_upm.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/mtd/nand/fsl_upm.c b/drivers/mtd/nand/fsl_upm.c
index 7c782eb..714d831 100644
--- a/drivers/mtd/nand/fsl_upm.c
+++ b/drivers/mtd/nand/fsl_upm.c
@@ -158,6 +158,7 @@ static int __devinit fun_chip_init(struct fsl_upm_nand *fun,
 {
 	int ret;
 	struct device_node *flash_np;
+	struct mtd_part_parser_data ppdata;
 
 	fun->chip.IO_ADDR_R = fun->io_base;
 	fun->chip.IO_ADDR_W = fun->io_base;
@@ -191,15 +192,9 @@ static int __devinit fun_chip_init(struct fsl_upm_nand *fun,
 	if (ret)
 		goto err;
 
-	ret = parse_mtd_partitions(&fun->mtd, NULL, &fun->parts, 0);
+	ppdata.of_node = flash_np;
+	ret = parse_mtd_partitions(&fun->mtd, NULL, &fun->parts, &ppdata);
 
-#ifdef CONFIG_MTD_OF_PARTS
-	if (ret == 0) {
-		ret = of_mtd_parse_partitions(fun->dev, flash_np, &fun->parts);
-		if (ret < 0)
-			goto err;
-	}
-#endif
 	ret = mtd_device_register(&fun->mtd, fun->parts, ret);
 err:
 	of_node_put(flash_np);



More information about the linux-mtd-cvs mailing list