mtd: pxa32xx_nand: add support for partition table parsing

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon May 10 13:59:03 EDT 2010


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=bff3c10d369440bc87ba612b45ba2777d2bf017f
Commit:     bff3c10d369440bc87ba612b45ba2777d2bf017f
Parent:     1dd2a092af8ed53eb744c5b9993fa775616cf699
Author:     Marc Kleine-Budde <mkl at pengutronix.de>
AuthorDate: Fri Apr 23 23:25:44 2010 +0200
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Mon May 10 14:23:43 2010 +0100

    mtd: pxa32xx_nand: add support for partition table parsing
    
    The pxa32xx_nand driver doesn't support partition tables from the
    command line. This patch adds support for it.
    
    Signed-off-by: Marc Kleine-Budde <mkl at pengutronix.de>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/pxa3xx_nand.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 1a5a036..55a3d2c 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -1319,6 +1319,17 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
 		goto fail_free_irq;
 	}
 
+	if (mtd_has_cmdlinepart()) {
+		static const char *probes[] = { "cmdlinepart", NULL };
+		struct mtd_partition *parts;
+		int nr_parts;
+
+		nr_parts = parse_mtd_partitions(mtd, probes, &parts, 0);
+
+		if (nr_parts)
+			return add_mtd_partitions(mtd, parts, nr_parts);
+	}
+
 	return add_mtd_partitions(mtd, pdata->parts, pdata->nr_parts);
 
 fail_free_irq:



More information about the linux-mtd-cvs mailing list