aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps/dc21285.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/maps/dc21285.c')
-rw-r--r--drivers/mtd/maps/dc21285.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/drivers/mtd/maps/dc21285.c b/drivers/mtd/maps/dc21285.c
index b3cb3a183809..7a9e1989c977 100644
--- a/drivers/mtd/maps/dc21285.c
+++ b/drivers/mtd/maps/dc21285.c
@@ -145,17 +145,13 @@ static struct map_info dc21285_map = {
145 145
146 146
147/* Partition stuff */ 147/* Partition stuff */
148#ifdef CONFIG_MTD_PARTITIONS
149static struct mtd_partition *dc21285_parts; 148static struct mtd_partition *dc21285_parts;
150static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; 149static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
151#endif
152 150
153static int __init init_dc21285(void) 151static int __init init_dc21285(void)
154{ 152{
155 153
156#ifdef CONFIG_MTD_PARTITIONS
157 int nrparts; 154 int nrparts;
158#endif
159 155
160 /* Determine bankwidth */ 156 /* Determine bankwidth */
161 switch (*CSR_SA110_CNTL & (3<<14)) { 157 switch (*CSR_SA110_CNTL & (3<<14)) {
@@ -204,13 +200,8 @@ static int __init init_dc21285(void)
204 200
205 dc21285_mtd->owner = THIS_MODULE; 201 dc21285_mtd->owner = THIS_MODULE;
206 202
207#ifdef CONFIG_MTD_PARTITIONS
208 nrparts = parse_mtd_partitions(dc21285_mtd, probes, &dc21285_parts, 0); 203 nrparts = parse_mtd_partitions(dc21285_mtd, probes, &dc21285_parts, 0);
209 if (nrparts > 0) 204 mtd_device_register(dc21285_mtd, dc21285_parts, nrparts);
210 add_mtd_partitions(dc21285_mtd, dc21285_parts, nrparts);
211 else
212#endif
213 add_mtd_device(dc21285_mtd);
214 205
215 if(machine_is_ebsa285()) { 206 if(machine_is_ebsa285()) {
216 /* 207 /*
@@ -232,14 +223,9 @@ static int __init init_dc21285(void)
232 223
233static void __exit cleanup_dc21285(void) 224static void __exit cleanup_dc21285(void)
234{ 225{
235#ifdef CONFIG_MTD_PARTITIONS 226 mtd_device_unregister(dc21285_mtd);
236 if (dc21285_parts) { 227 if (dc21285_parts)
237 del_mtd_partitions(dc21285_mtd);
238 kfree(dc21285_parts); 228 kfree(dc21285_parts);
239 } else
240#endif
241 del_mtd_device(dc21285_mtd);
242
243 map_destroy(dc21285_mtd); 229 map_destroy(dc21285_mtd);
244 iounmap(dc21285_map.virt); 230 iounmap(dc21285_map.virt);
245} 231}