Commit 17659c60 authored by David Woodhouse's avatar David Woodhouse

mtd: maps: Remove BUS_ID_SIZE from integrator_flash

Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
Tested-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 48396413
...@@ -42,10 +42,8 @@ ...@@ -42,10 +42,8 @@
#include <mach/hardware.h> #include <mach/hardware.h>
#include <asm/system.h> #include <asm/system.h>
#define SUBDEV_NAME_SIZE (BUS_ID_SIZE + 2)
struct armflash_subdev_info { struct armflash_subdev_info {
char name[SUBDEV_NAME_SIZE]; char *name;
struct mtd_info *mtd; struct mtd_info *mtd;
struct map_info map; struct map_info map;
struct flash_platform_data *plat; struct flash_platform_data *plat;
...@@ -134,6 +132,8 @@ static void armflash_subdev_remove(struct armflash_subdev_info *subdev) ...@@ -134,6 +132,8 @@ static void armflash_subdev_remove(struct armflash_subdev_info *subdev)
map_destroy(subdev->mtd); map_destroy(subdev->mtd);
if (subdev->map.virt) if (subdev->map.virt)
iounmap(subdev->map.virt); iounmap(subdev->map.virt);
kfree(subdev->name);
subdev->name = NULL;
release_mem_region(subdev->map.phys, subdev->map.size); release_mem_region(subdev->map.phys, subdev->map.size);
} }
...@@ -177,17 +177,23 @@ static int armflash_probe(struct platform_device *dev) ...@@ -177,17 +177,23 @@ static int armflash_probe(struct platform_device *dev)
if (nr == 1) if (nr == 1)
/* No MTD concatenation, just use the default name */ /* No MTD concatenation, just use the default name */
snprintf(subdev->name, SUBDEV_NAME_SIZE, "%s", subdev->name = kstrdup(dev_name(&dev->dev), GFP_KERNEL);
dev_name(&dev->dev));
else else
snprintf(subdev->name, SUBDEV_NAME_SIZE, "%s-%d", subdev->name = kasprintf(GFP_KERNEL, "%s-%d",
dev_name(&dev->dev), i); dev_name(&dev->dev), i);
if (!subdev->name) {
err = -ENOMEM;
break;
}
subdev->plat = plat; subdev->plat = plat;
err = armflash_subdev_probe(subdev, res); err = armflash_subdev_probe(subdev, res);
if (err) if (err) {
kfree(subdev->name);
subdev->name = NULL;
break; break;
} }
}
info->nr_subdev = i; info->nr_subdev = i;
if (err) if (err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment