diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2014-04-01 16:23:46 +0300 |
---|---|---|
committer | Nishanth Menon <nm@ti.com> | 2014-05-05 14:30:36 -0500 |
commit | bae74510179bc6d2c71168eeef33b7b157e244d0 (patch) | |
tree | 960052a8bef282fe40b539cddb6949592a1a8952 /drivers/bus | |
parent | 455c6fdbd219161bd09b1165f11699d6d73de11c (diff) |
drivers: bus: omap_l3: Convert to use devm_kzalloc
We can remove the kfree() calls from probe and remove.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Tested-by: Sekhar Nori <nsekhar@ti.com>
Diffstat (limited to 'drivers/bus')
-rw-r--r-- | drivers/bus/omap_l3_noc.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/bus/omap_l3_noc.c b/drivers/bus/omap_l3_noc.c index feeecae623f6..d25d727e7cfb 100644 --- a/drivers/bus/omap_l3_noc.c +++ b/drivers/bus/omap_l3_noc.c @@ -134,7 +134,7 @@ static int omap4_l3_probe(struct platform_device *pdev) struct resource *res; int ret; - l3 = kzalloc(sizeof(*l3), GFP_KERNEL); + l3 = devm_kzalloc(&pdev->dev, sizeof(*l3), GFP_KERNEL); if (!l3) return -ENOMEM; @@ -142,15 +142,13 @@ static int omap4_l3_probe(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { dev_err(&pdev->dev, "couldn't find resource 0\n"); - ret = -ENODEV; - goto err0; + return -ENODEV; } l3->l3_base[0] = ioremap(res->start, resource_size(res)); if (!l3->l3_base[0]) { dev_err(&pdev->dev, "ioremap failed\n"); - ret = -ENOMEM; - goto err0; + return -ENOMEM; } res = platform_get_resource(pdev, IORESOURCE_MEM, 1); @@ -214,8 +212,6 @@ err2: iounmap(l3->l3_base[1]); err1: iounmap(l3->l3_base[0]); -err0: - kfree(l3); return ret; } @@ -228,7 +224,6 @@ static int omap4_l3_remove(struct platform_device *pdev) iounmap(l3->l3_base[0]); iounmap(l3->l3_base[1]); iounmap(l3->l3_base[2]); - kfree(l3); return 0; } |