Skip to content

Commit

Permalink
pinctrl/pinctrl-u300: remove unneeded devm_kfree call
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Devendra Naga authored and Linus Walleij committed Aug 4, 2012
1 parent c43ba80 commit 0e3ac20
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/pinctrl/pinctrl-u300.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -1165,8 +1163,6 @@ static int __devinit u300_pmx_probe(struct platform_device *pdev)
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;
}

Expand Down

0 comments on commit 0e3ac20

Please sign in to comment.