aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mtd/devices/m25p80.c7
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] = "