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

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>

authored by

Stephen Boyd and committed by
Stephen Boyd
759fa961 f5b3715e

+12 -10
+12 -10
drivers/clk/clk-vt8500.c
··· 232 232 static __init void vtwm_device_clk_init(struct device_node *node) 233 233 { 234 234 u32 en_reg, div_reg; 235 - struct clk *clk; 235 + struct clk_hw *hw; 236 236 struct clk_device *dev_clk; 237 237 const char *clk_name = node->name; 238 238 const char *parent_name; ··· 301 301 302 302 dev_clk->hw.init = &init; 303 303 304 - clk = clk_register(NULL, &dev_clk->hw); 305 - if (WARN_ON(IS_ERR(clk))) { 304 + hw = &dev_clk->hw; 305 + rc = clk_hw_register(NULL, hw); 306 + if (WARN_ON(rc)) { 306 307 kfree(dev_clk); 307 308 return; 308 309 } 309 - rc = of_clk_add_provider(node, of_clk_src_simple_get, clk); 310 - clk_register_clkdev(clk, clk_name, NULL); 310 + rc = of_clk_add_hw_provider(node, of_clk_hw_simple_get, hw); 311 + clk_hw_register_clkdev(hw, clk_name, NULL); 311 312 } 312 313 CLK_OF_DECLARE(vt8500_device, "via,vt8500-device-clock", vtwm_device_clk_init); 313 314 ··· 682 681 static __init void vtwm_pll_clk_init(struct device_node *node, int pll_type) 683 682 { 684 683 u32 reg; 685 - struct clk *clk; 684 + struct clk_hw *hw; 686 685 struct clk_pll *pll_clk; 687 686 const char *clk_name = node->name; 688 687 const char *parent_name; ··· 715 714 716 715 pll_clk->hw.init = &init; 717 716 718 - clk = clk_register(NULL, &pll_clk->hw); 719 - if (WARN_ON(IS_ERR(clk))) { 717 + hw = &pll_clk->hw; 718 + rc = clk_hw_register(NULL, &pll_clk->hw); 719 + if (WARN_ON(rc)) { 720 720 kfree(pll_clk); 721 721 return; 722 722 } 723 - rc = of_clk_add_provider(node, of_clk_src_simple_get, clk); 724 - clk_register_clkdev(clk, clk_name, NULL); 723 + rc = of_clk_add_hw_provider(node, of_clk_hw_simple_get, hw); 724 + clk_hw_register_clkdev(hw, clk_name, NULL); 725 725 } 726 726 727 727