Patchwork [07/17] mtd: ndfc: use ofpart through generic parsing

login
register
mail settings
Submitter Dmitry Eremin-Solenikov
Date June 9, 2011, 2:22 p.m.
Message ID <1307629388-24769-8-git-send-email-dbaryshkov@gmail.com>
Download mbox | patch
Permalink /patch/99758/
State New
Headers show

Comments

Dmitry Eremin-Solenikov - June 9, 2011, 2:22 p.m.
Convert the driver to use ofpart partitions parsing through the generic
parse_mtd_partitions().

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 drivers/mtd/nand/ndfc.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

Patch

diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c
index 70c04ff..1ae94f0 100644
--- a/drivers/mtd/nand/ndfc.c
+++ b/drivers/mtd/nand/ndfc.c
@@ -188,6 +188,7 @@  static int ndfc_chip_init(struct ndfc_controller *ndfc,
 	if (!flash_np)
 		return -ENODEV;
 
+	ndfc->mtd.node = flash_np;
 	ndfc->mtd.name = kasprintf(GFP_KERNEL, "%s.%s",
 			dev_name(&ndfc->ofdev->dev), flash_np->name);
 	if (!ndfc->mtd.name) {
@@ -203,13 +204,6 @@  static int ndfc_chip_init(struct ndfc_controller *ndfc,
 	if (ret < 0)
 		goto err;
 
-	if (ret == 0) {
-		ret = of_mtd_parse_partitions(&ndfc->ofdev->dev, flash_np,
-					      &ndfc->parts);
-		if (ret < 0)
-			goto err;
-	}
-
 	ret = mtd_device_register(&ndfc->mtd, ndfc->parts, ret);
 
 err: