aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/imx/clk-imx8mm.c
diff options
context:
space:
mode:
authorAnson Huang <Anson.Huang@nxp.com>2019-08-06 14:46:13 +0800
committerShawn Guo <shawnguo@kernel.org>2019-08-12 16:15:31 +0200
commitef7e6a1284374f22ca7016ae3f7c3dfccf7a3de2 (patch)
treef50fa671c0ddf8f4b21c3981a64808e619cde834 /drivers/clk/imx/clk-imx8mm.c
parentclk: imx8mq: Mark AHB clock as critical (diff)
downloadlinux-dev-ef7e6a1284374f22ca7016ae3f7c3dfccf7a3de2.tar.xz
linux-dev-ef7e6a1284374f22ca7016ae3f7c3dfccf7a3de2.zip
clk: imx8mm: Unregister clks when of_clk_add_provider failed
When of_clk_add_provider failed, all clks should be unregistered. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Diffstat (limited to 'drivers/clk/imx/clk-imx8mm.c')
-rw-r--r--drivers/clk/imx/clk-imx8mm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/clk/imx/clk-imx8mm.c b/drivers/clk/imx/clk-imx8mm.c
index 94a2b2941e3b..69ec274d4974 100644
--- a/drivers/clk/imx/clk-imx8mm.c
+++ b/drivers/clk/imx/clk-imx8mm.c
@@ -659,12 +659,17 @@ static int imx8mm_clocks_probe(struct platform_device *pdev)
ret = of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
if (ret < 0) {
pr_err("failed to register clks for i.MX8MM\n");
- return -EINVAL;
+ goto unregister_clks;
}
imx_register_uart_clocks(uart_clks);
return 0;
+
+unregister_clks:
+ imx_unregister_clocks(clks, ARRAY_SIZE(clks));
+
+ return ret;
}
static const struct of_device_id imx8mm_clk_of_match[] = {