Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: tqm8xll: convert to mtd_device_register()

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>

authored by

Jamie Iles and committed by
David Woodhouse
b5c0a4ea f6c11c18

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