Commit bae74510 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Nishanth Menon

drivers: bus: omap_l3: Convert to use devm_kzalloc

We can remove the kfree() calls from probe and remove.
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarNishanth Menon <nm@ti.com>
Tested-by: default avatarSekhar Nori <nsekhar@ti.com>
parent 455c6fdb
...@@ -134,7 +134,7 @@ static int omap4_l3_probe(struct platform_device *pdev) ...@@ -134,7 +134,7 @@ static int omap4_l3_probe(struct platform_device *pdev)
struct resource *res; struct resource *res;
int ret; int ret;
l3 = kzalloc(sizeof(*l3), GFP_KERNEL); l3 = devm_kzalloc(&pdev->dev, sizeof(*l3), GFP_KERNEL);
if (!l3) if (!l3)
return -ENOMEM; return -ENOMEM;
...@@ -142,15 +142,13 @@ static int omap4_l3_probe(struct platform_device *pdev) ...@@ -142,15 +142,13 @@ static int omap4_l3_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) { if (!res) {
dev_err(&pdev->dev, "couldn't find resource 0\n"); dev_err(&pdev->dev, "couldn't find resource 0\n");
ret = -ENODEV; return -ENODEV;
goto err0;
} }
l3->l3_base[0] = ioremap(res->start, resource_size(res)); l3->l3_base[0] = ioremap(res->start, resource_size(res));
if (!l3->l3_base[0]) { if (!l3->l3_base[0]) {
dev_err(&pdev->dev, "ioremap failed\n"); dev_err(&pdev->dev, "ioremap failed\n");
ret = -ENOMEM; return -ENOMEM;
goto err0;
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 1); res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
...@@ -214,8 +212,6 @@ static int omap4_l3_probe(struct platform_device *pdev) ...@@ -214,8 +212,6 @@ static int omap4_l3_probe(struct platform_device *pdev)
iounmap(l3->l3_base[1]); iounmap(l3->l3_base[1]);
err1: err1:
iounmap(l3->l3_base[0]); iounmap(l3->l3_base[0]);
err0:
kfree(l3);
return ret; return ret;
} }
...@@ -228,7 +224,6 @@ static int omap4_l3_remove(struct platform_device *pdev) ...@@ -228,7 +224,6 @@ static int omap4_l3_remove(struct platform_device *pdev)
iounmap(l3->l3_base[0]); iounmap(l3->l3_base[0]);
iounmap(l3->l3_base[1]); iounmap(l3->l3_base[1]);
iounmap(l3->l3_base[2]); iounmap(l3->l3_base[2]);
kfree(l3);
return 0; return 0;
} }
......
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