From cf13f2896807d516df79d118d1e82f9d2db3c336 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Wed, 19 Dec 2018 15:09:14 -0800 Subject: clk: Move of_clk_*() APIs into clk.c from clkdev.c The API between clk.c and clkdev.c is purely getting the clk_hw structure (or the struct clk if it's not CCF) and then turning that struct clk_hw pointer into a struct clk pointer via clk_hw_create_clk(). There's no need to complicate clkdev.c with these DT parsing details that are only relevant to the common clk framework. Move the DT parsing logic into the core framework and just expose the APIs to get a clk_hw pointer and convert it. Cc: Miquel Raynal Cc: Jerome Brunet Cc: Russell King Cc: Michael Turquette Cc: Jeffrey Hugo Cc: Chen-Yu Tsai Signed-off-by: Stephen Boyd --- drivers/clk/clk.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'drivers/clk/clk.h') diff --git a/drivers/clk/clk.h b/drivers/clk/clk.h index 5ea2185e57a1..553f531cc232 100644 --- a/drivers/clk/clk.h +++ b/drivers/clk/clk.h @@ -9,9 +9,14 @@ struct device; struct of_phandle_args; #if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK) -int of_parse_clkspec(const struct device_node *np, int index, const char *name, - struct of_phandle_args *out_args); -struct clk_hw *of_clk_get_hw_from_clkspec(struct of_phandle_args *clkspec); +struct clk_hw *of_clk_get_hw(struct device_node *np, + int index, const char *con_id); +#else /* !CONFIG_COMMON_CLK || !CONFIG_OF */ +static inline struct clk_hw *of_clk_get_hw(struct device_node *np, + int index, const char *con_id) +{ + return ERR_PTR(-ENOENT); +} #endif #ifdef CONFIG_COMMON_CLK -- cgit v1.2.3-59-g8ed1b