mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
video: mmp: drop needless devm cleanup
The nice thing about devm_* is that the driver doesn't need to free the resources but the driver core takes care about that. This also simplifies the error path quite a bit and removes the wrong check for a clock pointer being NULL. Russell King - ARM Linux <linux@arm.linux.org.uk>: "And this patch also fixes the above: disabling/unpreparing _after_ putting the thing - which was quite silly... :)" Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
This commit is contained in:
parent
633358e9ff
commit
fb8a15079a
1 changed files with 2 additions and 15 deletions
|
@ -514,7 +514,7 @@ static int mmphw_probe(struct platform_device *pdev)
|
|||
if (IS_ERR(ctrl->clk)) {
|
||||
dev_err(ctrl->dev, "unable to get clk %s\n", mi->clk_name);
|
||||
ret = -ENOENT;
|
||||
goto failed_get_clk;
|
||||
goto failed;
|
||||
}
|
||||
clk_prepare_enable(ctrl->clk);
|
||||
|
||||
|
@ -551,21 +551,8 @@ static int mmphw_probe(struct platform_device *pdev)
|
|||
path_deinit(path_plat);
|
||||
}
|
||||
|
||||
if (ctrl->clk) {
|
||||
devm_clk_put(ctrl->dev, ctrl->clk);
|
||||
clk_disable_unprepare(ctrl->clk);
|
||||
}
|
||||
failed_get_clk:
|
||||
devm_free_irq(ctrl->dev, ctrl->irq, ctrl);
|
||||
clk_disable_unprepare(ctrl->clk);
|
||||
failed:
|
||||
if (ctrl) {
|
||||
if (ctrl->reg_base)
|
||||
devm_iounmap(ctrl->dev, ctrl->reg_base);
|
||||
devm_release_mem_region(ctrl->dev, res->start,
|
||||
resource_size(res));
|
||||
devm_kfree(ctrl->dev, ctrl);
|
||||
}
|
||||
|
||||
dev_err(&pdev->dev, "device init failed\n");
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Reference in a new issue