diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2014-04-01 09:23:46 -0400 |
---|---|---|
committer | Nishanth Menon <nm@ti.com> | 2014-05-05 15:30:36 -0400 |
commit | bae74510179bc6d2c71168eeef33b7b157e244d0 (patch) | |
tree | 960052a8bef282fe40b539cddb6949592a1a8952 /drivers/bus/omap_l3_noc.c | |
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/omap_l3_noc.c')
-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) | |||
134 | struct resource *res; | 134 | struct resource *res; |
135 | int ret; | 135 | int ret; |
136 | 136 | ||
137 | l3 = kzalloc(sizeof(*l3), GFP_KERNEL); | 137 | l3 = devm_kzalloc(&pdev->dev, sizeof(*l3), GFP_KERNEL); |
138 | if (!l3) | 138 | if (!l3) |
139 | return -ENOMEM; | 139 | return -ENOMEM; |
140 | 140 | ||
@@ -142,15 +142,13 @@ static int omap4_l3_probe(struct platform_device *pdev) | |||
142 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 142 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
143 | if (!res) { | 143 | if (!res) { |
144 | dev_err(&pdev->dev, "couldn't find resource 0\n"); | 144 | dev_err(&pdev->dev, "couldn't find resource 0\n"); |
145 | ret = -ENODEV; | 145 | return -ENODEV; |
146 | goto err0; | ||
147 | } | 146 | } |
148 | 147 | ||
149 | l3->l3_base[0] = ioremap(res->start, resource_size(res)); | 148 | l3->l3_base[0] = ioremap(res->start, resource_size(res)); |
150 | if (!l3->l3_base[0]) { | 149 | if (!l3->l3_base[0]) { |
151 | dev_err(&pdev->dev, "ioremap failed\n"); | 150 | dev_err(&pdev->dev, "ioremap failed\n"); |
152 | ret = -ENOMEM; | 151 | return -ENOMEM; |
153 | goto err0; | ||
154 | } | 152 | } |
155 | 153 | ||
156 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 154 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
@@ -214,8 +212,6 @@ err2: | |||
214 | iounmap(l3->l3_base[1]); | 212 | iounmap(l3->l3_base[1]); |
215 | err1: | 213 | err1: |
216 | iounmap(l3->l3_base[0]); | 214 | iounmap(l3->l3_base[0]); |
217 | err0: | ||
218 | kfree(l3); | ||
219 | return ret; | 215 | return ret; |
220 | } | 216 | } |
221 | 217 | ||
@@ -228,7 +224,6 @@ static int omap4_l3_remove(struct platform_device *pdev) | |||
228 | iounmap(l3->l3_base[0]); | 224 | iounmap(l3->l3_base[0]); |
229 | iounmap(l3->l3_base[1]); | 225 | iounmap(l3->l3_base[1]); |
230 | iounmap(l3->l3_base[2]); | 226 | iounmap(l3->l3_base[2]); |
231 | kfree(l3); | ||
232 | 227 | ||
233 | return 0; | 228 | return 0; |
234 | } | 229 | } |