mtd: fix build error in m25p80.c

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sat Oct 30 07:59:02 EDT 2010


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=40847437f15221b5822ba70550e8b9fcccfb9bb3
Commit:     40847437f15221b5822ba70550e8b9fcccfb9bb3
Parent:     8cc9de3ebdf654601db51a516267dff89c49acc3
Author:     Andres Salomon <dilinger at queued.net>
AuthorDate: Fri Oct 29 21:04:19 2010 -0700
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Sat Oct 30 12:46:08 2010 +0100

    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: Andres Salomon <dilinger at queued.net>
    Acked-by: Grant Likely <grant.likely at secretlab.ca>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/devices/m25p80.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 669d2b7..bf5a002 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -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);



More information about the linux-mtd-cvs mailing list