diff mbox

[v4,5/5] mtd: m25p80: add support to parse the partitions by OF node

Message ID 1286878714-13090-6-git-send-email-Mingkai.hu@freescale.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Hu Mingkai-B21284 Oct. 12, 2010, 10:18 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 6f512b5..9d20738 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -924,6 +924,11 @@  static int __devinit m25p_probe(struct spi_device *spi)
 			nr_parts = data->nr_parts;
 		}
 
+		if (nr_parts <= 0 && spi->dev.of_node) {
+			nr_parts = of_mtd_parse_partitions(&spi->dev,
+					spi->dev.of_node, &parts);
+		}
+
 		if (nr_parts > 0) {
 			for (i = 0; i < nr_parts; i++) {
 				DEBUG(MTD_DEBUG_LEVEL2, "partitions[%d] = "