Commit ef7e6a12 authored by Anson Huang's avatar Anson Huang Committed by Shawn Guo

clk: imx8mm: Unregister clks when of_clk_add_provider failed

When of_clk_add_provider failed, all clks should be unregistered.
Signed-off-by: default avatarAnson Huang <Anson.Huang@nxp.com>
Reviewed-by: default avatarDaniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: default avatarShawn Guo <shawnguo@kernel.org>
parent 9b9c60be
......@@ -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[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment