mtd: pxa3xx_nand.c: use mtd_device_parse_register

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


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

    mtd: pxa3xx_nand.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/pxa3xx_nand.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 5c3af2f..b7db1b2 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -1133,8 +1133,6 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
 {
 	struct pxa3xx_nand_platform_data *pdata;
 	struct pxa3xx_nand_info *info;
-	struct mtd_partition *parts;
-	int nr_parts;
 
 	pdata = pdev->dev.platform_data;
 	if (!pdata) {
@@ -1152,13 +1150,8 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
-
-	nr_parts = parse_mtd_partitions(info->mtd, NULL, &parts, 0);
-
-	if (nr_parts)
-		return mtd_device_register(info->mtd, parts, nr_parts);
-
-	return mtd_device_register(info->mtd, pdata->parts, pdata->nr_parts);
+	return mtd_device_parse_register(info->mtd, NULL, 0,
+			pdata->parts, pdata->nr_parts);
 }
 
 #ifdef CONFIG_PM



More information about the linux-mtd-cvs mailing list