clk: Introduce of_clk_get_hw_from_clkspec()
authorStephen Boyd <sboyd@kernel.org>
Wed, 19 Dec 2018 18:59:55 +0000 (10:59 -0800)
committerStephen Boyd <sboyd@kernel.org>
Fri, 1 Mar 2019 19:17:22 +0000 (11:17 -0800)
commit4472287a3b2f52f4aa53f294ccb74392dde4e07d
tree77f40e0f7e08c1394275664a624628d64cddb064
parent2447883934a03c80a85d92cd313ea1d10e330158
clk: Introduce of_clk_get_hw_from_clkspec()

We want to get struct clk_hw pointers from a DT clk specifier (i.e. a
clocks property) so that we can find parent clks without searching for
globally unique clk names. This should save time by avoiding the global
string search for clks that are external to the clock controller
providing the clk and let us move away from string comparisons in
general.

Introduce of_clk_get_hw_from_clkspec() which is largely the DT parsing
part of finding clks implemented in clkdev.c and have that return a
clk_hw pointer instead of converting that into a clk pointer. This lets
us push up the clk pointer creation to the caller in clk_get() and
avoids the need to push the dev_id and con_id throughout the DT parsing
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