diff options
author | Chen-Yu Tsai <[email protected]> | 2022-02-08 20:40:30 +0800 |
---|---|---|
committer | Stephen Boyd <[email protected]> | 2022-02-17 12:12:24 -0800 |
commit | 2d18b7e31aa804dc6c0e43545ae5b028802e6f86 (patch) | |
tree | 170f43fb046528ee23eb4995a4ebb761c62b1986 | |
parent | 3c3ba2ab0226f9a4f4312a5db2dd402ec42392ca (diff) |
clk: mediatek: Unregister clks in mtk_clk_simple_probe() error path
Until now the mediatek clk driver library did not have any way to
unregister clks, and so all drivers did not do proper cleanup in
their error paths.
Now that the library does have APIs to unregister clks, use them
in the error path of mtk_clk_simple_probe() to do proper cleanup.
Signed-off-by: Chen-Yu Tsai <[email protected]>
Reviewed-by: Miles Chen <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Chun-Jie Chen <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
-rw-r--r-- | drivers/clk/mediatek/clk-mtk.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/clk/mediatek/clk-mtk.c b/drivers/clk/mediatek/clk-mtk.c index 8f15e9de742e..0e027be0d5fc 100644 --- a/drivers/clk/mediatek/clk-mtk.c +++ b/drivers/clk/mediatek/clk-mtk.c @@ -439,12 +439,14 @@ int mtk_clk_simple_probe(struct platform_device *pdev) r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); if (r) - goto free_data; + goto unregister_clks; platform_set_drvdata(pdev, clk_data); return r; +unregister_clks: + mtk_clk_unregister_gates(mcd->clks, mcd->num_clks, clk_data); free_data: mtk_free_clk_data(clk_data); return r; |