diff options
| author | Stephen Boyd <sboyd@kernel.org> | 2018-12-11 11:32:04 -0500 |
|---|---|---|
| committer | Stephen Boyd <sboyd@kernel.org> | 2019-03-01 14:16:14 -0500 |
| commit | 1df4046a93e086f77d244ea47c21591b4acad3e2 (patch) | |
| tree | 47ee347de39b70442db6653adc1fa581b4cede59 /drivers/clk/clkdev.c | |
| parent | d13937116f1e82bf508a6325111b322c30c85eb9 (diff) | |
clk: Combine __clk_get() and __clk_create_clk()
The __clk_get() function is practically a private clk implementation
detail now. No architecture defines it, and given that new code should
be using the common clk framework there isn't a need for it to keep
existing just to serve clkdev purposes. Let's fold it into the
__clk_create_clk() function and make that a little more generic by
renaming it to clk_hw_create_clk(). This will allow the framework to
create a struct clk handle to a particular clk_hw pointer and link it up
as a consumer wherever that's needed.
Doing this also lets us get rid of the __clk_free_clk() API that had to
be kept in sync with __clk_put(). Splitting that API up into the "link
and unlink from consumer list" phase and "free the clk pointer" phase
allows us to reuse that logic in a couple places, simplifying the code.
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Jeffrey Hugo <jhugo@codeaurora.org>
Cc: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/clkdev.c')
| -rw-r--r-- | drivers/clk/clkdev.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c index 9ab3db8b3988..bdeaffc950ae 100644 --- a/drivers/clk/clkdev.c +++ b/drivers/clk/clkdev.c | |||
| @@ -174,16 +174,9 @@ struct clk *clk_get_sys(const char *dev_id, const char *con_id) | |||
| 174 | if (!cl) | 174 | if (!cl) |
| 175 | goto out; | 175 | goto out; |
| 176 | 176 | ||
| 177 | clk = __clk_create_clk(cl->clk_hw, dev_id, con_id); | 177 | clk = clk_hw_create_clk(cl->clk_hw, dev_id, con_id); |
| 178 | if (IS_ERR(clk)) | 178 | if (IS_ERR(clk)) |
| 179 | goto out; | ||
| 180 | |||
| 181 | if (!__clk_get(clk)) { | ||
| 182 | __clk_free_clk(clk); | ||
| 183 | cl = NULL; | 179 | cl = NULL; |
| 184 | goto out; | ||
| 185 | } | ||
| 186 | |||
| 187 | out: | 180 | out: |
| 188 | mutex_unlock(&clocks_mutex); | 181 | mutex_unlock(&clocks_mutex); |
| 189 | 182 | ||
