diff options
author | Stephen Boyd <stephen.boyd@linaro.org> | 2016-06-02 00:31:22 +0300 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2016-09-15 03:40:31 +0300 |
commit | f5644f10dcfbab90ffd27da1d8d51ffc13e1bc84 (patch) | |
tree | 8e3b81da594b7c79f0c092116a641b29d63bedd9 /drivers/clk/at91/clk-master.c | |
parent | b19f009d451060ee820deffa1afba029797fa654 (diff) | |
download | linux-f5644f10dcfbab90ffd27da1d8d51ffc13e1bc84.tar.xz |
clk: at91: Migrate to clk_hw based registration and OF APIs
Now that we have clk_hw based provider APIs to register clks, we
can get rid of struct clk pointers in this driver, allowing us to
move closer to a clear split of consumer and provider clk APIs.
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Tested-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/at91/clk-master.c')
-rw-r--r-- | drivers/clk/at91/clk-master.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/clk/at91/clk-master.c b/drivers/clk/at91/clk-master.c index d1021e106191..e9cba9fc26d7 100644 --- a/drivers/clk/at91/clk-master.c +++ b/drivers/clk/at91/clk-master.c @@ -120,7 +120,7 @@ static const struct clk_ops master_ops = { .get_parent = clk_master_get_parent, }; -static struct clk * __init +static struct clk_hw * __init at91_clk_register_master(struct regmap *regmap, const char *name, int num_parents, const char **parent_names, @@ -128,8 +128,9 @@ at91_clk_register_master(struct regmap *regmap, const struct clk_master_characteristics *characteristics) { struct clk_master *master; - struct clk *clk = NULL; struct clk_init_data init; + struct clk_hw *hw; + int ret; if (!name || !num_parents || !parent_names) return ERR_PTR(-EINVAL); @@ -149,12 +150,14 @@ at91_clk_register_master(struct regmap *regmap, master->characteristics = characteristics; master->regmap = regmap; - clk = clk_register(NULL, &master->hw); - if (IS_ERR(clk)) { + hw = &master->hw; + ret = clk_hw_register(NULL, &master->hw); + if (ret) { kfree(master); + hw = ERR_PTR(ret); } - return clk; + return hw; } @@ -198,7 +201,7 @@ static void __init of_at91_clk_master_setup(struct device_node *np, const struct clk_master_layout *layout) { - struct clk *clk; + struct clk_hw *hw; unsigned int num_parents; const char *parent_names[MASTER_SOURCE_MAX]; const char *name = np->name; @@ -221,13 +224,13 @@ of_at91_clk_master_setup(struct device_node *np, if (IS_ERR(regmap)) return; - clk = at91_clk_register_master(regmap, name, num_parents, + hw = at91_clk_register_master(regmap, name, num_parents, parent_names, layout, characteristics); - if (IS_ERR(clk)) + if (IS_ERR(hw)) goto out_free_characteristics; - of_clk_add_provider(np, of_clk_src_simple_get, clk); + of_clk_add_hw_provider(np, of_clk_hw_simple_get, hw); return; out_free_characteristics: |