aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps/ixp4xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/maps/ixp4xx.c')
-rw-r--r--drivers/mtd/maps/ixp4xx.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/mtd/maps/ixp4xx.c b/drivers/mtd/maps/ixp4xx.c
index 1f9fde0dad35..155b21942f47 100644
--- a/drivers/mtd/maps/ixp4xx.c
+++ b/drivers/mtd/maps/ixp4xx.c
@@ -162,7 +162,7 @@ static int ixp4xx_flash_remove(struct platform_device *dev)
162 return 0; 162 return 0;
163 163
164 if (info->mtd) { 164 if (info->mtd) {
165 del_mtd_partitions(info->mtd); 165 mtd_device_unregister(info->mtd);
166 map_destroy(info->mtd); 166 map_destroy(info->mtd);
167 } 167 }
168 if (info->map.virt) 168 if (info->map.virt)
@@ -252,10 +252,8 @@ static int ixp4xx_flash_probe(struct platform_device *dev)
252 /* Use the fast version */ 252 /* Use the fast version */
253 info->map.write = ixp4xx_write16; 253 info->map.write = ixp4xx_write16;
254 254
255#ifdef CONFIG_MTD_PARTITIONS
256 nr_parts = parse_mtd_partitions(info->mtd, probes, &info->partitions, 255 nr_parts = parse_mtd_partitions(info->mtd, probes, &info->partitions,
257 dev->resource->start); 256 dev->resource->start);
258#endif
259 if (nr_parts > 0) { 257 if (nr_parts > 0) {
260 part_type = "dynamic"; 258 part_type = "dynamic";
261 } else { 259 } else {
@@ -263,18 +261,16 @@ static int ixp4xx_flash_probe(struct platform_device *dev)
263 nr_parts = plat->nr_parts; 261 nr_parts = plat->nr_parts;
264 part_type = "static"; 262 part_type = "static";
265 } 263 }
266 if (nr_parts == 0) { 264 if (nr_parts == 0)
267 printk(KERN_NOTICE "IXP4xx flash: no partition info " 265 printk(KERN_NOTICE "IXP4xx flash: no partition info "
268 "available, registering whole flash\n"); 266 "available, registering whole flash\n");
269 err = add_mtd_device(info->mtd); 267 else
270 } else {
271 printk(KERN_NOTICE "IXP4xx flash: using %s partition " 268 printk(KERN_NOTICE "IXP4xx flash: using %s partition "
272 "definition\n", part_type); 269 "definition\n", part_type);
273 err = add_mtd_partitions(info->mtd, info->partitions, nr_parts);
274 270
275 if(err) 271 err = mtd_device_register(info->mtd, info->partitions, nr_parts);
276 printk(KERN_ERR "Could not parse partitions\n"); 272 if (err)
277 } 273 printk(KERN_ERR "Could not parse partitions\n");
278 274
279 if (err) 275 if (err)
280 goto Error; 276 goto Error;