Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −15
Original line number Diff line number Diff line
@@ -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);
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;