Patchwork [04/17] mtd: fsl_elbc_nand: 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-5-git-send-email-dbaryshkov@gmail.com>
Download mbox | patch
Permalink /patch/99756/
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/fsl_elbc_nand.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

Patch

diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
index f3384fa..5236840 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -842,7 +842,7 @@  static int __devinit fsl_elbc_nand_probe(struct platform_device *pdev)
 	struct resource res;
 	struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl;
 	static const char *part_probe_types[]
-		= { "cmdlinepart", "RedBoot", NULL };
+		= { "cmdlinepart", "RedBoot", "ofpart", NULL };
 	struct mtd_partition *parts;
 	int ret;
 	int bank;
@@ -910,6 +910,7 @@  static int __devinit fsl_elbc_nand_probe(struct platform_device *pdev)
 		goto err;
 	}
 
+	priv->mtd.node = pdev->dev.of_node;
 	priv->mtd.name = kasprintf(GFP_KERNEL, "%x.flash", (unsigned)res.start);
 	if (!priv->mtd.name) {
 		ret = -ENOMEM;
@@ -938,12 +939,6 @@  static int __devinit fsl_elbc_nand_probe(struct platform_device *pdev)
 	if (ret < 0)
 		goto err;
 
-	if (ret == 0) {
-		ret = of_mtd_parse_partitions(priv->dev, node, &parts);
-		if (ret < 0)
-			goto err;
-	}
-
 	mtd_device_register(&priv->mtd, parts, ret);
 
 	printk(KERN_INFO "eLBC NAND device at 0x%llx, bank %d\n",