clk: vt8500: Migrate to clk_hw based registration APIs

Now that we have clk_hw based provider APIs to register clks, we
can get rid of struct clk pointers while registering clks in
these drivers, allowing us to move closer to a clear split of
consumer and provider clk APIs.

Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Tony Prisk <linux@prisktech.co.nz>
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This commit is contained in:
Stephen Boyd 2016-06-01 16:15:32 -07:00 committed by Stephen Boyd
parent f5b3715ecf
commit 759fa96132
1 changed files with 12 additions and 10 deletions

View File

@ -232,7 +232,7 @@ static const struct clk_ops vt8500_gated_divisor_clk_ops = {
static __init void vtwm_device_clk_init(struct device_node *node) static __init void vtwm_device_clk_init(struct device_node *node)
{ {
u32 en_reg, div_reg; u32 en_reg, div_reg;
struct clk *clk; struct clk_hw *hw;
struct clk_device *dev_clk; struct clk_device *dev_clk;
const char *clk_name = node->name; const char *clk_name = node->name;
const char *parent_name; const char *parent_name;
@ -301,13 +301,14 @@ static __init void vtwm_device_clk_init(struct device_node *node)
dev_clk->hw.init = &init; dev_clk->hw.init = &init;
clk = clk_register(NULL, &dev_clk->hw); hw = &dev_clk->hw;
if (WARN_ON(IS_ERR(clk))) { rc = clk_hw_register(NULL, hw);
if (WARN_ON(rc)) {
kfree(dev_clk); kfree(dev_clk);
return; return;
} }
rc = of_clk_add_provider(node, of_clk_src_simple_get, clk); rc = of_clk_add_hw_provider(node, of_clk_hw_simple_get, hw);
clk_register_clkdev(clk, clk_name, NULL); clk_hw_register_clkdev(hw, clk_name, NULL);
} }
CLK_OF_DECLARE(vt8500_device, "via,vt8500-device-clock", vtwm_device_clk_init); CLK_OF_DECLARE(vt8500_device, "via,vt8500-device-clock", vtwm_device_clk_init);
@ -681,7 +682,7 @@ static const struct clk_ops vtwm_pll_ops = {
static __init void vtwm_pll_clk_init(struct device_node *node, int pll_type) static __init void vtwm_pll_clk_init(struct device_node *node, int pll_type)
{ {
u32 reg; u32 reg;
struct clk *clk; struct clk_hw *hw;
struct clk_pll *pll_clk; struct clk_pll *pll_clk;
const char *clk_name = node->name; const char *clk_name = node->name;
const char *parent_name; const char *parent_name;
@ -714,13 +715,14 @@ static __init void vtwm_pll_clk_init(struct device_node *node, int pll_type)
pll_clk->hw.init = &init; pll_clk->hw.init = &init;
clk = clk_register(NULL, &pll_clk->hw); hw = &pll_clk->hw;
if (WARN_ON(IS_ERR(clk))) { rc = clk_hw_register(NULL, &pll_clk->hw);
if (WARN_ON(rc)) {
kfree(pll_clk); kfree(pll_clk);
return; return;
} }
rc = of_clk_add_provider(node, of_clk_src_simple_get, clk); rc = of_clk_add_hw_provider(node, of_clk_hw_simple_get, hw);
clk_register_clkdev(clk, clk_name, NULL); clk_hw_register_clkdev(hw, clk_name, NULL);
} }