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

mtd: ixp: convert to mtd_device_register()

Convert to mtd_device_register() and remove the CONFIG_MTD_PARTITIONS
preprocessor conditionals as partitioning is always available.

Cc: Imre Kaloz <kaloz@openwrt.org>
Cc: Krzysztof Halasa <khc@pm.waw.pl>
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
6cbbf2ff c06addd3

+8 -16
-4
arch/arm/mach-ixp4xx/ixdp425-setup.c
··· 60 60 #if defined(CONFIG_MTD_NAND_PLATFORM) || \ 61 61 defined(CONFIG_MTD_NAND_PLATFORM_MODULE) 62 62 63 - #ifdef CONFIG_MTD_PARTITIONS 64 63 const char *part_probes[] = { "cmdlinepart", NULL }; 65 64 66 65 static struct mtd_partition ixdp425_partitions[] = { ··· 73 74 .size = MTDPART_SIZ_FULL 74 75 }, 75 76 }; 76 - #endif 77 77 78 78 static void 79 79 ixdp425_flash_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) ··· 101 103 .nr_chips = 1, 102 104 .chip_delay = 30, 103 105 .options = NAND_NO_AUTOINCR, 104 - #ifdef CONFIG_MTD_PARTITIONS 105 106 .part_probe_types = part_probes, 106 107 .partitions = ixdp425_partitions, 107 108 .nr_partitions = ARRAY_SIZE(ixdp425_partitions), 108 - #endif 109 109 }, 110 110 .ctrl = { 111 111 .cmd_ctrl = ixdp425_flash_nand_cmd_ctrl
+2 -2
drivers/mtd/maps/ixp2000.c
··· 119 119 return 0; 120 120 121 121 if (info->mtd) { 122 - del_mtd_partitions(info->mtd); 122 + mtd_device_unregister(info->mtd); 123 123 map_destroy(info->mtd); 124 124 } 125 125 if (info->map.map_priv_1) ··· 230 230 231 231 err = parse_mtd_partitions(info->mtd, probes, &info->partitions, 0); 232 232 if (err > 0) { 233 - err = add_mtd_partitions(info->mtd, info->partitions, err); 233 + err = mtd_device_register(info->mtd, info->partitions, err); 234 234 if(err) 235 235 dev_err(&dev->dev, "Could not parse partitions\n"); 236 236 }
+6 -10
drivers/mtd/maps/ixp4xx.c
··· 162 162 return 0; 163 163 164 164 if (info->mtd) { 165 - del_mtd_partitions(info->mtd); 165 + mtd_device_unregister(info->mtd); 166 166 map_destroy(info->mtd); 167 167 } 168 168 if (info->map.virt) ··· 252 252 /* Use the fast version */ 253 253 info->map.write = ixp4xx_write16; 254 254 255 - #ifdef CONFIG_MTD_PARTITIONS 256 255 nr_parts = parse_mtd_partitions(info->mtd, probes, &info->partitions, 257 256 dev->resource->start); 258 - #endif 259 257 if (nr_parts > 0) { 260 258 part_type = "dynamic"; 261 259 } else { ··· 261 263 nr_parts = plat->nr_parts; 262 264 part_type = "static"; 263 265 } 264 - if (nr_parts == 0) { 266 + if (nr_parts == 0) 265 267 printk(KERN_NOTICE "IXP4xx flash: no partition info " 266 268 "available, registering whole flash\n"); 267 - err = add_mtd_device(info->mtd); 268 - } else { 269 + else 269 270 printk(KERN_NOTICE "IXP4xx flash: using %s partition " 270 271 "definition\n", part_type); 271 - err = add_mtd_partitions(info->mtd, info->partitions, nr_parts); 272 272 273 - if(err) 274 - printk(KERN_ERR "Could not parse partitions\n"); 275 - } 273 + err = mtd_device_register(info->mtd, info->partitions, nr_parts); 274 + if (err) 275 + printk(KERN_ERR "Could not parse partitions\n"); 276 276 277 277 if (err) 278 278 goto Error;