mtd: fsl_upm: use ofpart through generic parsing
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Sun, 29 May 2011 21:02:23 +0000 (01:02 +0400)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Sun, 11 Sep 2011 12:02:11 +0000 (15:02 +0300)
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>
drivers/mtd/nand/fsl_upm.c

index 7c782ebd0f312b49c2034d04ab11da75c837dda6..714d8318c6ade5647796d73771d3c898e6670b6d 100644 (file)
@@ -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);