提交 40847437 编写于 作者: A Andres Salomon 提交者: David Woodhouse

mtd: fix build error in m25p80.c

While building an x86 distro kernel, I hit the following:

Kernel: arch/x86/boot/bzImage is ready  (#7)
ERROR: "of_mtd_parse_partitions" [drivers/mtd/devices/m25p80.ko]
undefined!

of_mtd_parse_partitions is defined with MTD_OF_PARTS, and that's only
built on PPC and microblaze.  The code in question should be wrapped w/
a stricter #ifdef.
Signed-off-by: NAndres Salomon <dilinger@queued.net>
Acked-by: NGrant Likely <grant.likely@secretlab.ca>
Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
上级 8cc9de3e
...@@ -928,7 +928,7 @@ static int __devinit m25p_probe(struct spi_device *spi) ...@@ -928,7 +928,7 @@ static int __devinit m25p_probe(struct spi_device *spi)
nr_parts = data->nr_parts; nr_parts = data->nr_parts;
} }
#ifdef CONFIG_OF #ifdef CONFIG_MTD_OF_PARTS
if (nr_parts <= 0 && spi->dev.of_node) { if (nr_parts <= 0 && spi->dev.of_node) {
nr_parts = of_mtd_parse_partitions(&spi->dev, nr_parts = of_mtd_parse_partitions(&spi->dev,
spi->dev.of_node, &parts); spi->dev.of_node, &parts);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册