Skip to content

Commit

Permalink
mtd/m25p80: add support to parse the partitions by OF node
Browse files Browse the repository at this point in the history
Signed-off-by: Mingkai Hu <Mingkai.hu@freescale.com>
[grant.likely@secretlab.ca: wrap hunk with #ifdef CONFIG_OF]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
  • Loading branch information
Mingkai Hu authored and Grant Likely committed Oct 22, 2010
1 parent 530719b commit 97ff46c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/mtd/devices/m25p80.c
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,13 @@ static int __devinit m25p_probe(struct spi_device *spi)
nr_parts = data->nr_parts;
}

#ifdef CONFIG_OF
if (nr_parts <= 0 && spi->dev.of_node) {
nr_parts = of_mtd_parse_partitions(&spi->dev,
spi->dev.of_node, &parts);
}
#endif

if (nr_parts > 0) {
for (i = 0; i < nr_parts; i++) {
DEBUG(MTD_DEBUG_LEVEL2, "partitions[%d] = "
Expand Down

0 comments on commit 97ff46c

Please sign in to comment.