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

clk: imx8mq: 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 ef7e6a12
......@@ -562,10 +562,18 @@ static int imx8mq_clocks_probe(struct platform_device *pdev)
clk_data.clk_num = ARRAY_SIZE(clks);
err = of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
WARN_ON(err);
if (err < 0) {
dev_err(dev, "failed to register clks for i.MX8MQ\n");
goto unregister_clks;
}
imx_register_uart_clocks(uart_clks);
return 0;
unregister_clks:
imx_unregister_clocks(clks, ARRAY_SIZE(clks));
return err;
}
......
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