diff options
| -rw-r--r-- | drivers/clk/clkdev.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c index 6e787cc9e5b9..6f65bde696da 100644 --- a/drivers/clk/clkdev.c +++ b/drivers/clk/clkdev.c | |||
| @@ -72,25 +72,26 @@ static struct clk_lookup *clk_find(const char *dev_id, const char *con_id) | |||
| 72 | return cl; | 72 | return cl; |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | static struct clk *__clk_get_sys(struct device *dev, const char *dev_id, | 75 | static struct clk_hw *clk_find_hw(const char *dev_id, const char *con_id) |
| 76 | const char *con_id) | ||
| 77 | { | 76 | { |
| 78 | struct clk_lookup *cl; | 77 | struct clk_lookup *cl; |
| 79 | struct clk *clk = NULL; | 78 | struct clk_hw *hw = ERR_PTR(-ENOENT); |
| 80 | 79 | ||
| 81 | mutex_lock(&clocks_mutex); | 80 | mutex_lock(&clocks_mutex); |
| 82 | |||
| 83 | cl = clk_find(dev_id, con_id); | 81 | cl = clk_find(dev_id, con_id); |
| 84 | if (!cl) | 82 | if (cl) |
| 85 | goto out; | 83 | hw = cl->clk_hw; |
| 86 | |||
| 87 | clk = clk_hw_create_clk(dev, cl->clk_hw, dev_id, con_id); | ||
| 88 | if (IS_ERR(clk)) | ||
| 89 | cl = NULL; | ||
| 90 | out: | ||
| 91 | mutex_unlock(&clocks_mutex); | 84 | mutex_unlock(&clocks_mutex); |
| 92 | 85 | ||
| 93 | return cl ? clk : ERR_PTR(-ENOENT); | 86 | return hw; |
| 87 | } | ||
| 88 | |||
| 89 | static struct clk *__clk_get_sys(struct device *dev, const char *dev_id, | ||
| 90 | const char *con_id) | ||
| 91 | { | ||
| 92 | struct clk_hw *hw = clk_find_hw(dev_id, con_id); | ||
| 93 | |||
| 94 | return clk_hw_create_clk(dev, hw, dev_id, con_id); | ||
| 94 | } | 95 | } |
| 95 | 96 | ||
| 96 | struct clk *clk_get_sys(const char *dev_id, const char *con_id) | 97 | struct clk *clk_get_sys(const char *dev_id, const char *con_id) |
