summaryrefslogtreecommitdiffstats
path: root/drivers/clk/imx/clk-pllv3.c
diff options
context:
space:
mode:
authorAbel Vesa <abel.vesa@nxp.com>2019-05-29 14:26:43 +0200
committerShawn Guo <shawnguo@kernel.org>2019-06-07 02:36:25 +0200
commite5674a4d076299a94f0a0bf15cc08ca8baeaaa0e (patch)
tree6498d1272d71ea794e6e43e3e9a338516d645a11 /drivers/clk/imx/clk-pllv3.c
parentclk: imx: clk-gate2: Switch to clk_hw based API (diff)
downloadlinux-e5674a4d076299a94f0a0bf15cc08ca8baeaaa0e.tar.xz
linux-e5674a4d076299a94f0a0bf15cc08ca8baeaaa0e.zip
clk: imx: clk-pllv3: Switch to clk_hw based API
Switch the imx_clk_hw_pllv3 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: Stephen Boyd <sboyd@kernel.org> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Diffstat (limited to 'drivers/clk/imx/clk-pllv3.c')
-rw-r--r--drivers/clk/imx/clk-pllv3.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c
index 4110e713d259..23aebca06c80 100644
--- a/drivers/clk/imx/clk-pllv3.c
+++ b/drivers/clk/imx/clk-pllv3.c
@@ -416,14 +416,15 @@ static const struct clk_ops clk_pllv3_enet_ops = {
.recalc_rate = clk_pllv3_enet_recalc_rate,
};
-struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
+struct clk_hw *imx_clk_hw_pllv3(enum imx_pllv3_type type, const char *name,
const char *parent_name, void __iomem *base,
u32 div_mask)
{
struct clk_pllv3 *pll;
const struct clk_ops *ops;
- struct clk *clk;
+ struct clk_hw *hw;
struct clk_init_data init;
+ int ret;
pll = kzalloc(sizeof(*pll), GFP_KERNEL);
if (!pll)
@@ -484,10 +485,13 @@ struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
init.num_parents = 1;
pll->hw.init = &init;
+ hw = &pll->hw;
- clk = clk_register(NULL, &pll->hw);
- if (IS_ERR(clk))
+ ret = clk_hw_register(NULL, hw);
+ if (ret) {
kfree(pll);
+ return ERR_PTR(ret);
+ }
- return clk;
+ return hw;
}