2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-27 22:53:55 +08:00

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>
This commit is contained in:
Anson Huang 2019-08-06 14:46:13 +08:00 committed by Shawn Guo
parent 9b9c60bed5
commit ef7e6a1284

View File

@ -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); ret = of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
if (ret < 0) { if (ret < 0) {
pr_err("failed to register clks for i.MX8MM\n"); pr_err("failed to register clks for i.MX8MM\n");
return -EINVAL; goto unregister_clks;
} }
imx_register_uart_clocks(uart_clks); imx_register_uart_clocks(uart_clks);
return 0; return 0;
unregister_clks:
imx_unregister_clocks(clks, ARRAY_SIZE(clks));
return ret;
} }
static const struct of_device_id imx8mm_clk_of_match[] = { static const struct of_device_id imx8mm_clk_of_match[] = {