clk: Combine __clk_get() and __clk_create_clk()
authorStephen Boyd <sboyd@kernel.org>
Tue, 11 Dec 2018 16:32:04 +0000 (08:32 -0800)
committerStephen Boyd <sboyd@kernel.org>
Fri, 1 Mar 2019 19:16:14 +0000 (11:16 -0800)
commit1df4046a93e086f77d244ea47c21591b4acad3e2
tree47ee347de39b70442db6653adc1fa581b4cede59
parentd13937116f1e82bf508a6325111b322c30c85eb9
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>
drivers/clk/clk.c
drivers/clk/clk.h
drivers/clk/clkdev.c