aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/clk-vt8500.c
diff options
context:
space:
mode:
authorStephen Boyd <stephen.boyd@linaro.org>2016-06-01 19:15:32 -0400
committerStephen Boyd <sboyd@codeaurora.org>2016-08-24 20:35:48 -0400
commit759fa9613245b99b21c25b0aecf9919fb0e96c31 (patch)
treeb42139c0dbcdc6e9482bad3d4318ce7443ffcff0 /drivers/clk/clk-vt8500.c
parentf5b3715ecf851da45f27e28120b9c5c9ddeccb5f (diff)
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>
Diffstat (limited to 'drivers/clk/clk-vt8500.c')
-rw-r--r--drivers/clk/clk-vt8500.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/clk/clk-vt8500.c b/drivers/clk/clk-vt8500.c
index 37368a399ff9..4161a6f25741 100644
--- a/drivers/clk/clk-vt8500.c
+++ b/drivers/clk/clk-vt8500.c
@@ -232,7 +232,7 @@ static const struct clk_ops vt8500_gated_divisor_clk_ops = {
232static __init void vtwm_device_clk_init(struct device_node *node) 232static __init void vtwm_device_clk_init(struct device_node *node)
233{ 233{
234 u32 en_reg, div_reg; 234 u32 en_reg, div_reg;
235 struct clk *clk; 235 struct clk_hw *hw;
236 struct clk_device *dev_clk; 236 struct clk_device *dev_clk;
237 const char *clk_name = node->name; 237 const char *clk_name = node->name;
238 const char *parent_name; 238 const char *parent_name;
@@ -301,13 +301,14 @@ static __init void vtwm_device_clk_init(struct device_node *node)
301 301
302 dev_clk->hw.init = &init; 302 dev_clk->hw.init = &init;
303 303
304 clk = clk_register(NULL, &dev_clk->hw); 304 hw = &dev_clk->hw;
305 if (WARN_ON(IS_ERR(clk))) { 305 rc = clk_hw_register(NULL, hw);
306 if (WARN_ON(rc)) {
306 kfree(dev_clk); 307 kfree(dev_clk);
307 return; 308 return;
308 } 309 }
309 rc = of_clk_add_provider(node, of_clk_src_simple_get, clk); 310 rc = of_clk_add_hw_provider(node, of_clk_hw_simple_get, hw);
310 clk_register_clkdev(clk, clk_name, NULL); 311 clk_hw_register_clkdev(hw, clk_name, NULL);
311} 312}
312CLK_OF_DECLARE(vt8500_device, "via,vt8500-device-clock", vtwm_device_clk_init); 313CLK_OF_DECLARE(vt8500_device, "via,vt8500-device-clock", vtwm_device_clk_init);
313 314
@@ -681,7 +682,7 @@ static const struct clk_ops vtwm_pll_ops = {
681static __init void vtwm_pll_clk_init(struct device_node *node, int pll_type) 682static __init void vtwm_pll_clk_init(struct device_node *node, int pll_type)
682{ 683{
683 u32 reg; 684 u32 reg;
684 struct clk *clk; 685 struct clk_hw *hw;
685 struct clk_pll *pll_clk; 686 struct clk_pll *pll_clk;
686 const char *clk_name = node->name; 687 const char *clk_name = node->name;
687 const char *parent_name; 688 const char *parent_name;
@@ -714,13 +715,14 @@ static __init void vtwm_pll_clk_init(struct device_node *node, int pll_type)
714 715
715 pll_clk->hw.init = &init; 716 pll_clk->hw.init = &init;
716 717
717 clk = clk_register(NULL, &pll_clk->hw); 718 hw = &pll_clk->hw;
718 if (WARN_ON(IS_ERR(clk))) { 719 rc = clk_hw_register(NULL, &pll_clk->hw);
720 if (WARN_ON(rc)) {
719 kfree(pll_clk); 721 kfree(pll_clk);
720 return; 722 return;
721 } 723 }
722 rc = of_clk_add_provider(node, of_clk_src_simple_get, clk); 724 rc = of_clk_add_hw_provider(node, of_clk_hw_simple_get, hw);
723 clk_register_clkdev(clk, clk_name, NULL); 725 clk_hw_register_clkdev(hw, clk_name, NULL);
724} 726}
725 727
726 728