aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps
diff options
context:
space:
mode:
authorEzequiel Garcia <ezequiel.garcia@free-electrons.com>2013-01-25 11:50:27 -0300
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2013-02-12 18:10:46 +0200
commiteb82038f97f93c5f0ff274fb98a9fff741dc2f5e (patch)
treea5831ec93daebda35d09c57e4520be590895c730 /drivers/mtd/maps
parent84cfbbb85a98c8c89407f108da9d102e5dfe2ae5 (diff)
downloadkernel_goldelico_gta04-eb82038f97f93c5f0ff274fb98a9fff741dc2f5e.zip
kernel_goldelico_gta04-eb82038f97f93c5f0ff274fb98a9fff741dc2f5e.tar.gz
kernel_goldelico_gta04-eb82038f97f93c5f0ff274fb98a9fff741dc2f5e.tar.bz2
mtd: physmap_of: Convert device allocation to managed devm_kzalloc()
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd/maps')
-rw-r--r--drivers/mtd/maps/physmap_of.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index 263d9e1..500d7f4 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -68,9 +68,6 @@ static int of_flash_remove(struct platform_device *dev)
kfree(info->list[i].res);
}
}
-
- kfree(info);
-
return 0;
}
@@ -199,8 +196,9 @@ static int of_flash_probe(struct platform_device *dev)
map_indirect = of_property_read_bool(dp, "no-unaligned-direct-access");
err = -ENOMEM;
- info = kzalloc(sizeof(struct of_flash) +
- sizeof(struct of_flash_list) * count, GFP_KERNEL);
+ info = devm_kzalloc(&dev->dev,
+ sizeof(struct of_flash) +
+ sizeof(struct of_flash_list) * count, GFP_KERNEL);
if (!info)
goto err_flash_remove;