* [PATCH] pinctrl/pinctrl-u300: remove unneeded devm_kfree call
@ 2012-07-21 8:37 Devendra Naga
2012-07-27 23:11 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Devendra Naga @ 2012-07-21 8:37 UTC (permalink / raw)
To: Linus Walleij, linux-kernel; +Cc: Devendra Naga
the allocated memory will be destroyed at the driver unload time,
automatically if driver uses the devm_ functions, so no need of
doing devm_kfree at the error path
Signed-off-by: Devendra Naga <develkernel412222@gmail.com>
---
drivers/pinctrl/pinctrl-u300.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-u300.c b/drivers/pinctrl/pinctrl-u300.c
index a7ad8c1..309f5b9 100644
--- a/drivers/pinctrl/pinctrl-u300.c
+++ b/drivers/pinctrl/pinctrl-u300.c
@@ -1121,10 +1121,8 @@ static int __devinit u300_pmx_probe(struct platform_device *pdev)
upmx->dev = &pdev->dev;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- ret = -ENOENT;
- goto out_no_resource;
- }
+ if (!res)
+ return -ENOENT;
upmx->phybase = res->start;
upmx->physize = resource_size(res);
@@ -1165,8 +1163,6 @@ out_no_remap:
platform_set_drvdata(pdev, NULL);
out_no_memregion:
release_mem_region(upmx->phybase, upmx->physize);
-out_no_resource:
- devm_kfree(&pdev->dev, upmx);
return ret;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] pinctrl/pinctrl-u300: remove unneeded devm_kfree call
2012-07-21 8:37 [PATCH] pinctrl/pinctrl-u300: remove unneeded devm_kfree call Devendra Naga
@ 2012-07-27 23:11 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2012-07-27 23:11 UTC (permalink / raw)
To: Devendra Naga; +Cc: linux-kernel
On Sat, Jul 21, 2012 at 10:37 AM, Devendra Naga
<develkernel412222@gmail.com> wrote:
> the allocated memory will be destroyed at the driver unload time,
> automatically if driver uses the devm_ functions, so no need of
> doing devm_kfree at the error path
>
> Signed-off-by: Devendra Naga <develkernel412222@gmail.com>
Applied.
Thanks!
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-07-27 23:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-21 8:37 [PATCH] pinctrl/pinctrl-u300: remove unneeded devm_kfree call Devendra Naga
2012-07-27 23:11 ` Linus Walleij
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.