aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps/physmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/maps/physmap.c')
-rw-r--r--drivers/mtd/maps/physmap.c38
1 files changed, 2 insertions, 36 deletions
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
index f64cee4a3bfb..66e8200079c2 100644
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@ -27,8 +27,6 @@ struct physmap_flash_info {
27 struct mtd_info *mtd[MAX_RESOURCES]; 27 struct mtd_info *mtd[MAX_RESOURCES];
28 struct mtd_info *cmtd; 28 struct mtd_info *cmtd;
29 struct map_info map[MAX_RESOURCES]; 29 struct map_info map[MAX_RESOURCES];
30 int nr_parts;
31 struct mtd_partition *parts;
32}; 30};
33 31
34static int physmap_flash_remove(struct platform_device *dev) 32static int physmap_flash_remove(struct platform_device *dev)
@@ -46,8 +44,6 @@ static int physmap_flash_remove(struct platform_device *dev)
46 44
47 if (info->cmtd) { 45 if (info->cmtd) {
48 mtd_device_unregister(info->cmtd); 46 mtd_device_unregister(info->cmtd);
49 if (info->nr_parts)
50 kfree(info->parts);
51 if (info->cmtd != info->mtd[0]) 47 if (info->cmtd != info->mtd[0])
52 mtd_concat_destroy(info->cmtd); 48 mtd_concat_destroy(info->cmtd);
53 } 49 }
@@ -175,23 +171,8 @@ static int physmap_flash_probe(struct platform_device *dev)
175 if (err) 171 if (err)
176 goto err_out; 172 goto err_out;
177 173
178 err = parse_mtd_partitions(info->cmtd, part_probe_types, 174 mtd_device_parse_register(info->cmtd, part_probe_types, 0,
179 &info->parts, 0); 175 physmap_data->parts, physmap_data->nr_parts);
180 if (err > 0) {
181 mtd_device_register(info->cmtd, info->parts, err);
182 info->nr_parts = err;
183 return 0;
184 }
185
186 if (physmap_data->nr_parts) {
187 printk(KERN_NOTICE "Using physmap partition information\n");
188 mtd_device_register(info->cmtd, physmap_data->parts,
189 physmap_data->nr_parts);
190 return 0;
191 }
192
193 mtd_device_register(info->cmtd, NULL, 0);
194
195 return 0; 176 return 0;
196 177
197err_out: 178err_out:
@@ -245,21 +226,6 @@ static struct platform_device physmap_flash = {
245 .num_resources = 1, 226 .num_resources = 1,
246 .resource = &physmap_flash_resource, 227 .resource = &physmap_flash_resource,
247}; 228};
248
249void physmap_configure(unsigned long addr, unsigned long size,
250 int bankwidth, void (*set_vpp)(struct map_info *, int))
251{
252 physmap_flash_resource.start = addr;
253 physmap_flash_resource.end = addr + size - 1;
254 physmap_flash_data.width = bankwidth;
255 physmap_flash_data.set_vpp = set_vpp;
256}
257
258void physmap_set_partitions(struct mtd_partition *parts, int num_parts)
259{
260 physmap_flash_data.nr_parts = num_parts;
261 physmap_flash_data.parts = parts;
262}
263#endif 229#endif
264 230
265static int __init physmap_init(void) 231static int __init physmap_init(void)