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

clk: moxart: Migrate to clk_hw based OF and 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: Jonas Jensen <jonas.jensen@gmail.com>
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
5a962d2e 6b212f5a

+12 -10
+12 -10
drivers/clk/clk-moxart.c
··· 19 19 static void __init moxart_of_pll_clk_init(struct device_node *node) 20 20 { 21 21 static void __iomem *base; 22 - struct clk *clk, *ref_clk; 22 + struct clk_hw *hw; 23 + struct clk *ref_clk; 23 24 unsigned int mul; 24 25 const char *name = node->name; 25 26 const char *parent_name; ··· 43 42 return; 44 43 } 45 44 46 - clk = clk_register_fixed_factor(NULL, name, parent_name, 0, mul, 1); 47 - if (IS_ERR(clk)) { 45 + hw = clk_hw_register_fixed_factor(NULL, name, parent_name, 0, mul, 1); 46 + if (IS_ERR(hw)) { 48 47 pr_err("%s: failed to register clock\n", node->full_name); 49 48 return; 50 49 } 51 50 52 - clk_register_clkdev(clk, NULL, name); 53 - of_clk_add_provider(node, of_clk_src_simple_get, clk); 51 + clk_hw_register_clkdev(hw, NULL, name); 52 + of_clk_add_hw_provider(node, of_clk_hw_simple_get, hw); 54 53 } 55 54 CLK_OF_DECLARE(moxart_pll_clock, "moxa,moxart-pll-clock", 56 55 moxart_of_pll_clk_init); ··· 58 57 static void __init moxart_of_apb_clk_init(struct device_node *node) 59 58 { 60 59 static void __iomem *base; 61 - struct clk *clk, *pll_clk; 60 + struct clk_hw *hw; 61 + struct clk *pll_clk; 62 62 unsigned int div, val; 63 63 unsigned int div_idx[] = { 2, 3, 4, 6, 8}; 64 64 const char *name = node->name; ··· 87 85 return; 88 86 } 89 87 90 - clk = clk_register_fixed_factor(NULL, name, parent_name, 0, 1, div); 91 - if (IS_ERR(clk)) { 88 + hw = clk_hw_register_fixed_factor(NULL, name, parent_name, 0, 1, div); 89 + if (IS_ERR(hw)) { 92 90 pr_err("%s: failed to register clock\n", node->full_name); 93 91 return; 94 92 } 95 93 96 - clk_register_clkdev(clk, NULL, name); 97 - of_clk_add_provider(node, of_clk_src_simple_get, clk); 94 + clk_hw_register_clkdev(hw, NULL, name); 95 + of_clk_add_hw_provider(node, of_clk_hw_simple_get, hw); 98 96 } 99 97 CLK_OF_DECLARE(moxart_apb_clock, "moxa,moxart-apb-clock", 100 98 moxart_of_apb_clk_init);