diff options
author | Mingkai Hu <Mingkai.hu@freescale.com> | 2010-10-12 06:18:34 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-10-22 03:37:16 -0400 |
commit | 97ff46cb69da22037346670ae515217c658ace02 (patch) | |
tree | 84acc87dfb6e1abcde654c1109a354c670c42ca4 /drivers/mtd | |
parent | 530719b2341fea925f58a5d6be0353fa43a88baf (diff) |
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>
Diffstat (limited to 'drivers/mtd')
-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) | |||
924 | nr_parts = data->nr_parts; | 924 | nr_parts = data->nr_parts; |
925 | } | 925 | } |
926 | 926 | ||
927 | #ifdef CONFIG_OF | ||
928 | if (nr_parts <= 0 && spi->dev.of_node) { | ||
929 | nr_parts = of_mtd_parse_partitions(&spi->dev, | ||
930 | spi->dev.of_node, &parts); | ||
931 | } | ||
932 | #endif | ||
933 | |||
927 | if (nr_parts > 0) { | 934 | if (nr_parts > 0) { |
928 | for (i = 0; i < nr_parts; i++) { | 935 | for (i = 0; i < nr_parts; i++) { |
929 | DEBUG(MTD_DEBUG_LEVEL2, "partitions[%d] = " | 936 | DEBUG(MTD_DEBUG_LEVEL2, "partitions[%d] = " |