diff options
Diffstat (limited to 'drivers/mtd/maps/plat-ram.c')
-rw-r--r-- | drivers/mtd/maps/plat-ram.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/drivers/mtd/maps/plat-ram.c b/drivers/mtd/maps/plat-ram.c index 9ca1eccba4b..94f55348972 100644 --- a/drivers/mtd/maps/plat-ram.c +++ b/drivers/mtd/maps/plat-ram.c | |||
@@ -44,8 +44,6 @@ struct platram_info { | |||
44 | struct device *dev; | 44 | struct device *dev; |
45 | struct mtd_info *mtd; | 45 | struct mtd_info *mtd; |
46 | struct map_info map; | 46 | struct map_info map; |
47 | struct mtd_partition *partitions; | ||
48 | bool free_partitions; | ||
49 | struct resource *area; | 47 | struct resource *area; |
50 | struct platdata_mtd_ram *pdata; | 48 | struct platdata_mtd_ram *pdata; |
51 | }; | 49 | }; |
@@ -95,10 +93,6 @@ static int platram_remove(struct platform_device *pdev) | |||
95 | 93 | ||
96 | if (info->mtd) { | 94 | if (info->mtd) { |
97 | mtd_device_unregister(info->mtd); | 95 | mtd_device_unregister(info->mtd); |
98 | if (info->partitions) { | ||
99 | if (info->free_partitions) | ||
100 | kfree(info->partitions); | ||
101 | } | ||
102 | map_destroy(info->mtd); | 96 | map_destroy(info->mtd); |
103 | } | 97 | } |
104 | 98 | ||
@@ -228,21 +222,8 @@ static int platram_probe(struct platform_device *pdev) | |||
228 | /* check to see if there are any available partitions, or wether | 222 | /* check to see if there are any available partitions, or wether |
229 | * to add this device whole */ | 223 | * to add this device whole */ |
230 | 224 | ||
231 | if (!pdata->nr_partitions) { | 225 | err = mtd_device_parse_register(info->mtd, pdata->probes, 0, |
232 | /* try to probe using the supplied probe type */ | 226 | pdata->partitions, pdata->nr_partitions); |
233 | if (pdata->probes) { | ||
234 | err = parse_mtd_partitions(info->mtd, pdata->probes, | ||
235 | &info->partitions, 0); | ||
236 | info->free_partitions = 1; | ||
237 | if (err > 0) | ||
238 | err = mtd_device_register(info->mtd, | ||
239 | info->partitions, err); | ||
240 | } | ||
241 | } | ||
242 | /* use the static mapping */ | ||
243 | else | ||
244 | err = mtd_device_register(info->mtd, pdata->partitions, | ||
245 | pdata->nr_partitions); | ||
246 | if (!err) | 227 | if (!err) |
247 | dev_info(&pdev->dev, "registered mtd device\n"); | 228 | dev_info(&pdev->dev, "registered mtd device\n"); |
248 | 229 | ||