Commit 916120df authored by AngeloGioacchino Del Regno's avatar AngeloGioacchino Del Regno Committed by Matthias Brugger
Browse files

soc: mediatek: mtk-devapc: Switch to devm_clk_get_enabled()



This driver does exactly devm_clk_get() and clk_prepare_enable() right
after, which is exactly what devm_clk_get_enabled() does: clean that
up by switching to the latter.

This commit brings no functional changes.

Signed-off-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20221006110935.59695-1-angelogioacchino.delregno@collabora.com


Signed-off-by: default avatarMatthias Brugger <matthias.bgg@gmail.com>
parent d5a7d809
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -276,19 +276,14 @@ static int mtk_devapc_probe(struct platform_device *pdev)
	if (!devapc_irq)
		return -EINVAL;

	ctx->infra_clk = devm_clk_get(&pdev->dev, "devapc-infra-clock");
	ctx->infra_clk = devm_clk_get_enabled(&pdev->dev, "devapc-infra-clock");
	if (IS_ERR(ctx->infra_clk))
		return -EINVAL;

	if (clk_prepare_enable(ctx->infra_clk))
		return -EINVAL;

	ret = devm_request_irq(&pdev->dev, devapc_irq, devapc_violation_irq,
			       IRQF_TRIGGER_NONE, "devapc", ctx);
	if (ret) {
		clk_disable_unprepare(ctx->infra_clk);
	if (ret)
		return ret;
	}

	platform_set_drvdata(pdev, ctx);

@@ -303,8 +298,6 @@ static int mtk_devapc_remove(struct platform_device *pdev)

	stop_devapc(ctx);

	clk_disable_unprepare(ctx->infra_clk);

	return 0;
}