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

clk: imx: pllv2: Switch to clk_hw based API

Switch the imx_clk_pllv2 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
87052383 556f7880

+13 -6
+9 -5
drivers/clk/imx/clk-pllv2.c
··· 239 239 .set_rate = clk_pllv2_set_rate, 240 240 }; 241 241 242 - struct clk *imx_clk_pllv2(const char *name, const char *parent, 242 + struct clk_hw *imx_clk_hw_pllv2(const char *name, const char *parent, 243 243 void __iomem *base) 244 244 { 245 245 struct clk_pllv2 *pll; 246 - struct clk *clk; 246 + struct clk_hw *hw; 247 247 struct clk_init_data init; 248 + int ret; 248 249 249 250 pll = kzalloc(sizeof(*pll), GFP_KERNEL); 250 251 if (!pll) ··· 260 259 init.num_parents = 1; 261 260 262 261 pll->hw.init = &init; 262 + hw = &pll->hw; 263 263 264 - clk = clk_register(NULL, &pll->hw); 265 - if (IS_ERR(clk)) 264 + ret = clk_hw_register(NULL, hw); 265 + if (ret) { 266 266 kfree(pll); 267 + return ERR_PTR(ret); 268 + } 267 269 268 - return clk; 270 + return hw; 269 271 }
+4 -1
drivers/clk/imx/clk.h
··· 113 113 #define imx_clk_pllv1(type, name, parent, base) \ 114 114 to_clk(imx_clk_hw_pllv1(type, name, parent, base)) 115 115 116 + #define imx_clk_pllv2(name, parent, base) \ 117 + to_clk(imx_clk_hw_pllv2(name, parent, base)) 118 + 116 119 struct clk *imx_clk_pll14xx(const char *name, const char *parent_name, 117 120 void __iomem *base, const struct imx_pll14xx_clk *pll_clk); 118 121 119 122 struct clk_hw *imx_clk_hw_pllv1(enum imx_pllv1_type type, const char *name, 120 123 const char *parent, void __iomem *base); 121 124 122 - struct clk *imx_clk_pllv2(const char *name, const char *parent, 125 + struct clk_hw *imx_clk_hw_pllv2(const char *name, const char *parent, 123 126 void __iomem *base); 124 127 125 128 struct clk *imx_clk_frac_pll(const char *name, const char *parent_name,