mtd: plat_nand: Add default partition parser to driver

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon May 28 07:59:01 EDT 2012


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=f2e5a24480023db86ebd455c807aa30dc224ba9a
Commit:     f2e5a24480023db86ebd455c807aa30dc224ba9a
Parent:     9ff00d58a915b6747ba2e843ab2d04c712b4dc32
Author:     H Hartley Sweeten <hartleys at visionengravers.com>
AuthorDate: Wed Mar 28 11:13:05 2012 -0700
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Sun May 13 22:47:04 2012 -0500

    mtd: plat_nand: Add default partition parser to driver
    
    Use cmdlinepart as the default partition parser and allow the arch setup code
    to still use their own partition parsers.
    
    Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/plat_nand.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c
index 6404e6e..5856399 100644
--- a/drivers/mtd/nand/plat_nand.c
+++ b/drivers/mtd/nand/plat_nand.c
@@ -23,6 +23,8 @@ struct plat_nand_data {
 	void __iomem		*io_base;
 };
 
+static const char *part_probe_types[] = { "cmdlinepart", NULL };
+
 /*
  * Probe for the NAND device.
  */
@@ -31,6 +33,7 @@ static int __devinit plat_nand_probe(struct platform_device *pdev)
 	struct platform_nand_data *pdata = pdev->dev.platform_data;
 	struct plat_nand_data *data;
 	struct resource *res;
+	const char **part_types;
 	int err = 0;
 
 	if (pdata->chip.nr_chips < 1) {
@@ -98,8 +101,9 @@ static int __devinit plat_nand_probe(struct platform_device *pdev)
 		goto out;
 	}
 
-	err = mtd_device_parse_register(&data->mtd,
-					pdata->chip.part_probe_types, NULL,
+	part_types = pdata->chip.part_probe_types ? : part_probe_types;
+
+	err = mtd_device_parse_register(&data->mtd, part_types, NULL,
 					pdata->chip.partitions,
 					pdata->chip.nr_partitions);
 



More information about the linux-mtd-cvs mailing list