Skip to content

Commit

Permalink
mtd: plat_nand: Add default partition parser to driver
Browse files Browse the repository at this point in the history
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@visionengravers.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
H Hartley Sweeten authored and David Woodhouse committed May 14, 2012
1 parent 9ff00d5 commit f2e5a24
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/mtd/nand/plat_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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) {
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit f2e5a24

Please sign in to comment.