mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
clk: mediatek: mt2712: Add error handling to clk_mt2712_apmixed_probe()
[ Upstream commit20cace1b9d] This function was completely missing error handling: add it. Fixes:e2f744a82d("clk: mediatek: Add MT2712 clock support") Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> Link: https://lore.kernel.org/r/20230306140543.1813621-8-angelogioacchino.delregno@collabora.com Signed-off-by: Stephen Boyd <sboyd@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
23cc819125
commit
6f24e8ef33
@@ -1283,15 +1283,25 @@ static int clk_mt2712_apmixed_probe(struct platform_device *pdev)
|
|||||||
struct device_node *node = pdev->dev.of_node;
|
struct device_node *node = pdev->dev.of_node;
|
||||||
|
|
||||||
clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK);
|
clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK);
|
||||||
|
if (!clk_data)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data);
|
r = mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data);
|
||||||
|
if (r)
|
||||||
|
goto free_clk_data;
|
||||||
|
|
||||||
r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
|
r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
|
||||||
|
if (r) {
|
||||||
|
dev_err(&pdev->dev, "Cannot register clock provider: %d\n", r);
|
||||||
|
goto unregister_plls;
|
||||||
|
}
|
||||||
|
|
||||||
if (r != 0)
|
return 0;
|
||||||
pr_err("%s(): could not register clock provider: %d\n",
|
|
||||||
__func__, r);
|
|
||||||
|
|
||||||
|
unregister_plls:
|
||||||
|
mtk_clk_unregister_plls(plls, ARRAY_SIZE(plls), clk_data);
|
||||||
|
free_clk_data:
|
||||||
|
mtk_free_clk_data(clk_data);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user