Signed-off-by: Mingkai Hu <mingkai...@freescale.com> Acked-by: Grant Likely <grant.lik...@secretlab.ca> --- v4: - Updated to latest kernel base(Linux 2.6.36-rc7). - Made changes according to Grant's comments.
drivers/mtd/devices/m25p80.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) 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] = " -- 1.6.4 _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev