diff options
author | Rajendra Nayak <rnayak@codeaurora.org> | 2015-11-26 15:15:10 +0530 |
---|---|---|
committer | Srinivas Kandagatla <srinivas.kandagatla@linaro.org> | 2016-05-17 14:49:15 +0100 |
commit | ccfbd68b2f43df7f5fb75ec6b2509fd22a5c32e8 (patch) | |
tree | 3cc8f1f4f0f03cf0dc4c99b7be4ac191de10ece6 | |
parent | 4b6f487ce50170903d401a677a336691d1aa8748 (diff) |
clk: Add clk_hw_get_clk() helper API to be used by clk providers
Add a helper API that will allow clk providers to turn their clk_hw
structures into struct clk pointer.
Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
-rw-r--r-- | drivers/clk/clk.c | 6 | ||||
-rw-r--r-- | include/linux/clk-provider.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index fb186da816fe2..26dbbc07e8749 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -288,6 +288,12 @@ const char *clk_hw_get_name(const struct clk_hw *hw) } EXPORT_SYMBOL_GPL(clk_hw_get_name); +struct clk *clk_hw_get_clk(const struct clk_hw *hw) +{ + return hw->clk; +} +EXPORT_SYMBOL_GPL(clk_hw_get_clk); + struct clk_hw *__clk_get_hw(struct clk *clk) { return !clk ? NULL : clk->core->hw; diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index de2ba2085999f..0c21b040b9cf5 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -668,6 +668,7 @@ void devm_clk_unregister(struct device *dev, struct clk *clk); /* helper functions */ const char *__clk_get_name(const struct clk *clk); const char *clk_hw_get_name(const struct clk_hw *hw); +struct clk *clk_hw_get_clk(const struct clk_hw *hw); struct clk_hw *__clk_get_hw(struct clk *clk); unsigned int clk_hw_get_num_parents(const struct clk_hw *hw); struct clk_hw *clk_hw_get_parent(const struct clk_hw *hw); |