Commit fb8a1507 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Tomi Valkeinen

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: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 633358e9
...@@ -514,7 +514,7 @@ static int mmphw_probe(struct platform_device *pdev) ...@@ -514,7 +514,7 @@ static int mmphw_probe(struct platform_device *pdev)
if (IS_ERR(ctrl->clk)) { if (IS_ERR(ctrl->clk)) {
dev_err(ctrl->dev, "unable to get clk %s\n", mi->clk_name); dev_err(ctrl->dev, "unable to get clk %s\n", mi->clk_name);
ret = -ENOENT; ret = -ENOENT;
goto failed_get_clk; goto failed;
} }
clk_prepare_enable(ctrl->clk); clk_prepare_enable(ctrl->clk);
...@@ -551,21 +551,8 @@ static int mmphw_probe(struct platform_device *pdev) ...@@ -551,21 +551,8 @@ static int mmphw_probe(struct platform_device *pdev)
path_deinit(path_plat); path_deinit(path_plat);
} }
if (ctrl->clk) { clk_disable_unprepare(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);
failed: 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"); dev_err(&pdev->dev, "device init failed\n");
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment