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

clk: h8300: 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: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: <uclinux-h8-devel@lists.sourceforge.jp>
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
8b2bdc76 120c1552

+11 -11
+5 -5
drivers/clk/h8300/clk-div.c
··· 14 14 static void __init h8300_div_clk_setup(struct device_node *node) 15 15 { 16 16 unsigned int num_parents; 17 - struct clk *clk; 17 + struct clk_hw *hw; 18 18 const char *clk_name = node->name; 19 19 const char *parent_name; 20 20 void __iomem *divcr = NULL; ··· 38 38 39 39 parent_name = of_clk_get_parent_name(node, 0); 40 40 of_property_read_u32(node, "renesas,width", &width); 41 - clk = clk_register_divider(NULL, clk_name, parent_name, 41 + hw = clk_hw_register_divider(NULL, clk_name, parent_name, 42 42 CLK_SET_RATE_GATE, divcr, offset, width, 43 43 CLK_DIVIDER_POWER_OF_TWO, &clklock); 44 - if (!IS_ERR(clk)) { 45 - of_clk_add_provider(node, of_clk_src_simple_get, clk); 44 + if (!IS_ERR(hw)) { 45 + of_clk_add_hw_provider(node, of_clk_hw_simple_get, hw); 46 46 return; 47 47 } 48 48 pr_err("%s: failed to register %s div clock (%ld)\n", 49 - __func__, clk_name, PTR_ERR(clk)); 49 + __func__, clk_name, PTR_ERR(hw)); 50 50 error: 51 51 if (divcr) 52 52 iounmap(divcr);
+6 -6
drivers/clk/h8300/clk-h8s2678.c
··· 84 84 static void __init h8s2678_pll_clk_setup(struct device_node *node) 85 85 { 86 86 unsigned int num_parents; 87 - struct clk *clk; 88 87 const char *clk_name = node->name; 89 88 const char *parent_name; 90 89 struct pll_clock *pll_clock; 91 90 struct clk_init_data init; 91 + int ret; 92 92 93 93 num_parents = of_clk_get_parent_count(node); 94 94 if (!num_parents) { ··· 121 121 init.num_parents = 1; 122 122 pll_clock->hw.init = &init; 123 123 124 - clk = clk_register(NULL, &pll_clock->hw); 125 - if (IS_ERR(clk)) { 126 - pr_err("%s: failed to register %s div clock (%ld)\n", 127 - __func__, clk_name, PTR_ERR(clk)); 124 + ret = clk_hw_register(NULL, &pll_clock->hw); 125 + if (ret) { 126 + pr_err("%s: failed to register %s div clock (%d)\n", 127 + __func__, clk_name, ret); 128 128 goto unmap_pllcr; 129 129 } 130 130 131 - of_clk_add_provider(node, of_clk_src_simple_get, clk); 131 + of_clk_add_hw_provider(node, of_clk_hw_simple_get, &pll_clock->hw); 132 132 return; 133 133 134 134 unmap_pllcr: