mtd/maps: uclinux: fix building when partition support is disabled

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sat Sep 19 17:59:01 EDT 2009


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=3ff230a742b8fc196c1fe69875a57a429877cacb
Commit:     3ff230a742b8fc196c1fe69875a57a429877cacb
Parent:     9aff1b1afe9a30c358d1c3a0bb50ae77bd7f994b
Author:     Timofei Bondarenko <tim at ipi.ac.ru>
AuthorDate: Wed May 20 19:59:02 2009 -0400
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Sat Sep 19 11:44:51 2009 -0700

    mtd/maps: uclinux: fix building when partition support is disabled
    
    The uClinux map driver doesn't even use partitions, so we shouldn't require
    it in order to work properly.
    
    Signed-off-by: Timofei Bondarenko <tim at ipi.ac.ru>
    Signed-off-by: Mike Frysinger <vapier at gentoo.org>
    Signed-off-by: Sonic Zhang <sonic.zhang at analog.com>
    CC: Greg Ungerer <gerg at uclinux.org>
    CC: uclinux-dev at uclinux.org
    CC: linux-mtd at lists.infradead.org
    
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/maps/uclinux.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/maps/uclinux.c b/drivers/mtd/maps/uclinux.c
index d4314fb..3500929 100644
--- a/drivers/mtd/maps/uclinux.c
+++ b/drivers/mtd/maps/uclinux.c
@@ -89,7 +89,11 @@ static int __init uclinux_mtd_init(void)
 	mtd->priv = mapp;
 
 	uclinux_ram_mtdinfo = mtd;
+#ifdef CONFIG_MTD_PARTITIONS
 	add_mtd_partitions(mtd, uclinux_romfs, NUM_PARTITIONS);
+#else
+	add_mtd_device(mtd);
+#endif
 
 	return(0);
 }
@@ -99,7 +103,11 @@ static int __init uclinux_mtd_init(void)
 static void __exit uclinux_mtd_cleanup(void)
 {
 	if (uclinux_ram_mtdinfo) {
+#ifdef CONFIG_MTD_PARTITIONS
 		del_mtd_partitions(uclinux_ram_mtdinfo);
+#else
+		del_mtd_device(uclinux_ram_mtdinfo);
+#endif
 		map_destroy(uclinux_ram_mtdinfo);
 		uclinux_ram_mtdinfo = NULL;
 	}



More information about the linux-mtd-cvs mailing list