Skip to content

Commit

Permalink
mtd: fix build error in m25p80.c
Browse files Browse the repository at this point in the history
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: Andres Salomon <dilinger@queued.net>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
Andres Salomon authored and David Woodhouse committed Oct 30, 2010
1 parent 8cc9de3 commit 4084743
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/devices/m25p80.c
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ static int __devinit m25p_probe(struct spi_device *spi)
nr_parts = data->nr_parts;
}

#ifdef CONFIG_OF
#ifdef CONFIG_MTD_OF_PARTS
if (nr_parts <= 0 && spi->dev.of_node) {
nr_parts = of_mtd_parse_partitions(&spi->dev,
spi->dev.of_node, &parts);
Expand Down

0 comments on commit 4084743

Please sign in to comment.