mtd: pxa32xx_nand: add support for partition table parsing
authorMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 23 Apr 2010 21:25:44 +0000 (23:25 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 10 May 2010 13:23:43 +0000 (14:23 +0100)
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@pengutronix.de>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/pxa3xx_nand.c

index 1a5a036..55a3d2c 100644 (file)
@@ -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: