diff options
Diffstat (limited to 'drivers/mtd/maps/uclinux.c')
-rw-r--r-- | 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 d4314fb88212..35009294b435 100644 --- a/drivers/mtd/maps/uclinux.c +++ b/drivers/mtd/maps/uclinux.c | |||
@@ -89,7 +89,11 @@ static int __init uclinux_mtd_init(void) | |||
89 | mtd->priv = mapp; | 89 | mtd->priv = mapp; |
90 | 90 | ||
91 | uclinux_ram_mtdinfo = mtd; | 91 | uclinux_ram_mtdinfo = mtd; |
92 | #ifdef CONFIG_MTD_PARTITIONS | ||
92 | add_mtd_partitions(mtd, uclinux_romfs, NUM_PARTITIONS); | 93 | add_mtd_partitions(mtd, uclinux_romfs, NUM_PARTITIONS); |
94 | #else | ||
95 | add_mtd_device(mtd); | ||
96 | #endif | ||
93 | 97 | ||
94 | return(0); | 98 | return(0); |
95 | } | 99 | } |
@@ -99,7 +103,11 @@ static int __init uclinux_mtd_init(void) | |||
99 | static void __exit uclinux_mtd_cleanup(void) | 103 | static void __exit uclinux_mtd_cleanup(void) |
100 | { | 104 | { |
101 | if (uclinux_ram_mtdinfo) { | 105 | if (uclinux_ram_mtdinfo) { |
106 | #ifdef CONFIG_MTD_PARTITIONS | ||
102 | del_mtd_partitions(uclinux_ram_mtdinfo); | 107 | del_mtd_partitions(uclinux_ram_mtdinfo); |
108 | #else | ||
109 | del_mtd_device(uclinux_ram_mtdinfo); | ||
110 | #endif | ||
103 | map_destroy(uclinux_ram_mtdinfo); | 111 | map_destroy(uclinux_ram_mtdinfo); |
104 | uclinux_ram_mtdinfo = NULL; | 112 | uclinux_ram_mtdinfo = NULL; |
105 | } | 113 | } |