aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/clkdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/clk/clkdev.c')
-rw-r--r--drivers/clk/clkdev.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
index 043fd3633373..1fcb6ef2cdac 100644
--- a/drivers/clk/clkdev.c
+++ b/drivers/clk/clkdev.c
@@ -28,34 +28,6 @@ static LIST_HEAD(clocks);
28static DEFINE_MUTEX(clocks_mutex); 28static DEFINE_MUTEX(clocks_mutex);
29 29
30#if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK) 30#if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
31
32static struct clk *__of_clk_get_by_clkspec(struct of_phandle_args *clkspec,
33 const char *dev_id, const char *con_id)
34{
35 struct clk *clk;
36
37 if (!clkspec)
38 return ERR_PTR(-EINVAL);
39
40 of_clk_lock();
41 clk = __of_clk_get_from_provider(clkspec, dev_id, con_id);
42 of_clk_unlock();
43 return clk;
44}
45
46/**
47 * of_clk_get_by_clkspec() - Lookup a clock form a clock provider
48 * @clkspec: pointer to a clock specifier data structure
49 *
50 * This function looks up a struct clk from the registered list of clock
51 * providers, an input is a clock specifier data structure as returned
52 * from the of_parse_phandle_with_args() function call.
53 */
54struct clk *of_clk_get_by_clkspec(struct of_phandle_args *clkspec)
55{
56 return __of_clk_get_by_clkspec(clkspec, NULL, __func__);
57}
58
59static struct clk *__of_clk_get(struct device_node *np, int index, 31static struct clk *__of_clk_get(struct device_node *np, int index,
60 const char *dev_id, const char *con_id) 32 const char *dev_id, const char *con_id)
61{ 33{
@@ -71,7 +43,7 @@ static struct clk *__of_clk_get(struct device_node *np, int index,
71 if (rc) 43 if (rc)
72 return ERR_PTR(rc); 44 return ERR_PTR(rc);
73 45
74 clk = __of_clk_get_by_clkspec(&clkspec, dev_id, con_id); 46 clk = __of_clk_get_from_provider(&clkspec, dev_id, con_id);
75 of_node_put(clkspec.np); 47 of_node_put(clkspec.np);
76 48
77 return clk; 49 return clk;