mtd: uclinux: convert to mtd_device_register()
authorJamie Iles <jamie@jamieiles.com>
Mon, 23 May 2011 09:23:12 +0000 (10:23 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 25 May 2011 01:23:09 +0000 (02:23 +0100)
Convert to mtd_device_register() and remove the CONFIG_MTD_PARTITIONS
preprocessor conditionals as partitioning is always available.

Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/maps/Kconfig
drivers/mtd/maps/uclinux.c

index add25a94ce4aa012f4c094ed30cc89db3e833997..44032433730df11c2677767ac29d75a10793a76b 100644 (file)
@@ -472,7 +472,7 @@ config MTD_GPIO_ADDR
 
 config MTD_UCLINUX
        bool "Generic uClinux RAM/ROM filesystem support"
-       depends on MTD_PARTITIONS && MTD_RAM=y && !MMU
+       depends on MTD_RAM=y && !MMU
        help
          Map driver to support image based filesystems for uClinux.
 
index 35009294b435f33a62c0dbb4496ffe5c8b189174..6793074f3f40aff0eacb4d4e94eb6c8e960e51e7 100644 (file)
@@ -89,11 +89,7 @@ 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
+       mtd_device_register(mtd, uclinux_romfs, NUM_PARTITIONS);
 
        return(0);
 }
@@ -103,11 +99,7 @@ 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
+               mtd_device_unregister(uclinux_ram_mtdinfo);
                map_destroy(uclinux_ram_mtdinfo);
                uclinux_ram_mtdinfo = NULL;
        }