summaryrefslogtreecommitdiff
path: root/drivers/clk/imx/clk-pllv2.c
diff options
context:
space:
mode:
authorAbel Vesa <abel.vesa@nxp.com>2019-12-11 11:25:44 +0200
committerShawn Guo <shawnguo@kernel.org>2019-12-11 19:19:44 +0800
commit87052383491c46e302f27a9ec0d7cc249b2f4ef2 (patch)
tree097e496c8601dc5d67b34b61ca982161975e8e9a /drivers/clk/imx/clk-pllv2.c
parent556f788010adfd4e06959ded48e7b0d89f9024b8 (diff)
downloadlinux-87052383491c46e302f27a9ec0d7cc249b2f4ef2.tar.gz
linux-87052383491c46e302f27a9ec0d7cc249b2f4ef2.tar.bz2
linux-87052383491c46e302f27a9ec0d7cc249b2f4ef2.zip
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>
Diffstat (limited to 'drivers/clk/imx/clk-pllv2.c')
-rw-r--r--drivers/clk/imx/clk-pllv2.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/clk/imx/clk-pllv2.c b/drivers/clk/imx/clk-pllv2.c
index eeba3cb14e2d..ff17f0664faa 100644
--- a/drivers/clk/imx/clk-pllv2.c
+++ b/drivers/clk/imx/clk-pllv2.c
@@ -239,12 +239,13 @@ static const struct clk_ops clk_pllv2_ops = {
.set_rate = clk_pllv2_set_rate,
};
-struct clk *imx_clk_pllv2(const char *name, const char *parent,
+struct clk_hw *imx_clk_hw_pllv2(const char *name, const char *parent,
void __iomem *base)
{
struct clk_pllv2 *pll;
- struct clk *clk;
+ struct clk_hw *hw;
struct clk_init_data init;
+ int ret;
pll = kzalloc(sizeof(*pll), GFP_KERNEL);
if (!pll)
@@ -259,10 +260,13 @@ struct clk *imx_clk_pllv2(const char *name, const char *parent,
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;
}