diff options
Diffstat (limited to 'drivers/mtd/maps/tqm8xxl.c')
-rw-r--r-- | drivers/mtd/maps/tqm8xxl.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/mtd/maps/tqm8xxl.c b/drivers/mtd/maps/tqm8xxl.c index 0718dfb3ee64..d78587990e7e 100644 --- a/drivers/mtd/maps/tqm8xxl.c +++ b/drivers/mtd/maps/tqm8xxl.c | |||
@@ -62,7 +62,6 @@ static void __iomem *start_scan_addr; | |||
62 | * "struct map_desc *_io_desc" for the corresponding machine. | 62 | * "struct map_desc *_io_desc" for the corresponding machine. |
63 | */ | 63 | */ |
64 | 64 | ||
65 | #ifdef CONFIG_MTD_PARTITIONS | ||
66 | /* Currently, TQM8xxL has up to 8MiB flash */ | 65 | /* Currently, TQM8xxL has up to 8MiB flash */ |
67 | static unsigned long tqm8xxl_max_flash_size = 0x00800000; | 66 | static unsigned long tqm8xxl_max_flash_size = 0x00800000; |
68 | 67 | ||
@@ -107,7 +106,6 @@ static struct mtd_partition tqm8xxl_fs_partitions[] = { | |||
107 | //.size = MTDPART_SIZ_FULL, | 106 | //.size = MTDPART_SIZ_FULL, |
108 | } | 107 | } |
109 | }; | 108 | }; |
110 | #endif | ||
111 | 109 | ||
112 | static int __init init_tqm_mtd(void) | 110 | static int __init init_tqm_mtd(void) |
113 | { | 111 | { |
@@ -188,7 +186,6 @@ static int __init init_tqm_mtd(void) | |||
188 | goto error_mem; | 186 | goto error_mem; |
189 | } | 187 | } |
190 | 188 | ||
191 | #ifdef CONFIG_MTD_PARTITIONS | ||
192 | /* | 189 | /* |
193 | * Select Static partition definitions | 190 | * Select Static partition definitions |
194 | */ | 191 | */ |
@@ -201,21 +198,14 @@ static int __init init_tqm_mtd(void) | |||
201 | part_banks[1].nums = ARRAY_SIZE(tqm8xxl_fs_partitions); | 198 | part_banks[1].nums = ARRAY_SIZE(tqm8xxl_fs_partitions); |
202 | 199 | ||
203 | for(idx = 0; idx < num_banks ; idx++) { | 200 | for(idx = 0; idx < num_banks ; idx++) { |
204 | if (part_banks[idx].nums == 0) { | 201 | if (part_banks[idx].nums == 0) |
205 | printk(KERN_NOTICE "TQM flash%d: no partition info available, registering whole flash at once\n", idx); | 202 | printk(KERN_NOTICE "TQM flash%d: no partition info available, registering whole flash at once\n", idx); |
206 | add_mtd_device(mtd_banks[idx]); | 203 | else |
207 | } else { | ||
208 | printk(KERN_NOTICE "TQM flash%d: Using %s partition definition\n", | 204 | printk(KERN_NOTICE "TQM flash%d: Using %s partition definition\n", |
209 | idx, part_banks[idx].type); | 205 | idx, part_banks[idx].type); |
210 | add_mtd_partitions(mtd_banks[idx], part_banks[idx].mtd_part, | 206 | mtd_device_register(mtd_banks[idx], part_banks[idx].mtd_part, |
211 | part_banks[idx].nums); | 207 | part_banks[idx].nums); |
212 | } | ||
213 | } | 208 | } |
214 | #else | ||
215 | printk(KERN_NOTICE "TQM flash: registering %d whole flash banks at once\n", num_banks); | ||
216 | for(idx = 0 ; idx < num_banks ; idx++) | ||
217 | add_mtd_device(mtd_banks[idx]); | ||
218 | #endif | ||
219 | return 0; | 209 | return 0; |
220 | error_mem: | 210 | error_mem: |
221 | for(idx = 0 ; idx < FLASH_BANK_MAX ; idx++) { | 211 | for(idx = 0 ; idx < FLASH_BANK_MAX ; idx++) { |
@@ -237,7 +227,7 @@ static void __exit cleanup_tqm_mtd(void) | |||
237 | for(idx = 0 ; idx < num_banks ; idx++) { | 227 | for(idx = 0 ; idx < num_banks ; idx++) { |
238 | /* destroy mtd_info previously allocated */ | 228 | /* destroy mtd_info previously allocated */ |
239 | if (mtd_banks[idx]) { | 229 | if (mtd_banks[idx]) { |
240 | del_mtd_partitions(mtd_banks[idx]); | 230 | mtd_device_unregister(mtd_banks[idx]); |
241 | map_destroy(mtd_banks[idx]); | 231 | map_destroy(mtd_banks[idx]); |
242 | } | 232 | } |
243 | /* release map_info not used anymore */ | 233 | /* release map_info not used anymore */ |