mtd: omap2.c: use mtd_device_parse_register

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


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=69c85f1f66888e0ad532f8bb37db81ca1e7e56f0
Commit:     69c85f1f66888e0ad532f8bb37db81ca1e7e56f0
Parent:     d4ed8f1222d5ada9da402cf312dc64e39c705da9
Author:     Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
AuthorDate: Thu Jun 2 18:00:55 2011 +0400
Committer:  Artem Bityutskiy <artem.bityutskiy at intel.com>
CommitDate: Sun Sep 11 15:02:09 2011 +0300

    mtd: omap2.c: use mtd_device_parse_register
    
    Replace custom invocations of parse_mtd_partitions and mtd_device_register
    with common mtd_device_parse_register call. This would bring: standard
    handling of all errors, fallback to default partitions, etc.
    
    Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
---
 drivers/mtd/nand/omap2.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 8783c08..c5e33fd 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -112,7 +112,6 @@ struct omap_nand_info {
 	struct nand_hw_control		controller;
 	struct omap_nand_platform_data	*pdata;
 	struct mtd_info			mtd;
-	struct mtd_partition		*parts;
 	struct nand_chip		nand;
 	struct platform_device		*pdev;
 
@@ -1101,13 +1100,8 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
 		goto out_release_mem_region;
 	}
 
-	err = parse_mtd_partitions(&info->mtd, NULL, &info->parts, 0);
-	if (err > 0)
-		mtd_device_register(&info->mtd, info->parts, err);
-	else if (pdata->parts)
-		mtd_device_register(&info->mtd, pdata->parts, pdata->nr_parts);
-	else
-		mtd_device_register(&info->mtd, NULL, 0);
+	mtd_device_parse_register(&info->mtd, NULL, 0,
+			pdata->parts, pdata->nr_parts);
 
 	platform_set_drvdata(pdev, &info->mtd);
 



More information about the linux-mtd-cvs mailing list