Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: imx: pllv1: Switch to clk_hw based API

Switch the imx_clk_pllv1 register function to clk_hw based API, rename
accordingly and add a macro for clk based legacy. This allows us to
move closer to a clear split between consumer and provider clk APIs.

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

authored by

Abel Vesa and committed by
Shawn Guo
556f7880 0394d404

+13 -6
+9 -5
drivers/clk/imx/clk-pllv1.c
··· 111 111 .recalc_rate = clk_pllv1_recalc_rate, 112 112 }; 113 113 114 - struct clk *imx_clk_pllv1(enum imx_pllv1_type type, const char *name, 114 + struct clk_hw *imx_clk_hw_pllv1(enum imx_pllv1_type type, const char *name, 115 115 const char *parent, void __iomem *base) 116 116 { 117 117 struct clk_pllv1 *pll; 118 - struct clk *clk; 118 + struct clk_hw *hw; 119 119 struct clk_init_data init; 120 + int ret; 120 121 121 122 pll = kmalloc(sizeof(*pll), GFP_KERNEL); 122 123 if (!pll) ··· 133 132 init.num_parents = 1; 134 133 135 134 pll->hw.init = &init; 135 + hw = &pll->hw; 136 136 137 - clk = clk_register(NULL, &pll->hw); 138 - if (IS_ERR(clk)) 137 + ret = clk_hw_register(NULL, hw); 138 + if (ret) { 139 139 kfree(pll); 140 + return ERR_PTR(ret); 141 + } 140 142 141 - return clk; 143 + return hw; 142 144 }
+4 -1
drivers/clk/imx/clk.h
··· 110 110 #define imx_clk_mux(name, reg, shift, width, parents, num_parents) \ 111 111 to_clk(imx_clk_hw_mux(name, reg, shift, width, parents, num_parents)) 112 112 113 + #define imx_clk_pllv1(type, name, parent, base) \ 114 + to_clk(imx_clk_hw_pllv1(type, name, parent, base)) 115 + 113 116 struct clk *imx_clk_pll14xx(const char *name, const char *parent_name, 114 117 void __iomem *base, const struct imx_pll14xx_clk *pll_clk); 115 118 116 - struct clk *imx_clk_pllv1(enum imx_pllv1_type type, const char *name, 119 + struct clk_hw *imx_clk_hw_pllv1(enum imx_pllv1_type type, const char *name, 117 120 const char *parent, void __iomem *base); 118 121 119 122 struct clk *imx_clk_pllv2(const char *name, const char *parent,