提交 97ff46cb 编写于 作者: M Mingkai Hu 提交者: Grant Likely

mtd/m25p80: add support to parse the partitions by OF node

Signed-off-by: NMingkai Hu <Mingkai.hu@freescale.com>
[grant.likely@secretlab.ca: wrap hunk with #ifdef CONFIG_OF]
Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
上级 530719b2
...@@ -924,6 +924,13 @@ static int __devinit m25p_probe(struct spi_device *spi) ...@@ -924,6 +924,13 @@ static int __devinit m25p_probe(struct spi_device *spi)
nr_parts = data->nr_parts; 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) { if (nr_parts > 0) {
for (i = 0; i < nr_parts; i++) { for (i = 0; i < nr_parts; i++) {
DEBUG(MTD_DEBUG_LEVEL2, "partitions[%d] = " DEBUG(MTD_DEBUG_LEVEL2, "partitions[%d] = "
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册