diff options
author | Mingkai Hu <Mingkai.hu@freescale.com> | 2010-10-12 14:18:34 +0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-10-22 11:37:16 +0400 |
commit | 97ff46cb69da22037346670ae515217c658ace02 (patch) | |
tree | 84acc87dfb6e1abcde654c1109a354c670c42ca4 | |
parent | 530719b2341fea925f58a5d6be0353fa43a88baf (diff) | |
download | linux-97ff46cb69da22037346670ae515217c658ace02.tar.xz |
mtd/m25p80: add support to parse the partitions by OF node
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>
-rw-r--r-- | drivers/mtd/devices/m25p80.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 6f512b5c117b..ea22520c0406 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -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] = " |