clk: imx: add imx_unregister_hw_clocks
authorPeng Fan <peng.fan@nxp.com>
Thu, 12 Dec 2019 02:58:54 +0000 (02:58 +0000)
committerShawn Guo <shawnguo@kernel.org>
Mon, 23 Dec 2019 03:50:47 +0000 (11:50 +0800)
There is a non hw API based imx_unregister_clocks to unregister clocks
when of_clk_add_provider failed. Add a hw API based
imx_unregister_hw_clocks when of_clk_add_hw_provider failed.

Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
drivers/clk/imx/clk.c
drivers/clk/imx/clk.h

index cfc05e43c3430d58a26e291480f7a09e622e3781..d0ce29f2c417bbdf421bc01e67ae85b2975341eb 100644 (file)
@@ -22,6 +22,14 @@ void imx_unregister_clocks(struct clk *clks[], unsigned int count)
                clk_unregister(clks[i]);
 }
 
+void imx_unregister_hw_clocks(struct clk_hw *hws[], unsigned int count)
+{
+       unsigned int i;
+
+       for (i = 0; i < count; i++)
+               clk_hw_unregister(hws[i]);
+}
+
 void __init imx_mmdc_mask_handshake(void __iomem *ccm_base,
                                    unsigned int chn)
 {
index 46cbac4d89a512e5293dfe4dfbc3b56eb127ae35..20dc9a1fcd6cc347bf70ccebef0ec60f4d04291b 100644 (file)
@@ -12,6 +12,7 @@ void imx_check_clk_hws(struct clk_hw *clks[], unsigned int count);
 void imx_register_uart_clocks(struct clk ** const clks[]);
 void imx_mmdc_mask_handshake(void __iomem *ccm_base, unsigned int chn);
 void imx_unregister_clocks(struct clk *clks[], unsigned int count);
+void imx_unregister_hw_clocks(struct clk_hw *hws[], unsigned int count);
 
 extern void imx_cscmr1_fixup(u32 *val);