aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/clk/clkdev.c2
-rw-r--r--include/linux/clk.h5
2 files changed, 4 insertions, 3 deletions
diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
index 20649b3c88fe..69085e02bd58 100644
--- a/drivers/clk/clkdev.c
+++ b/drivers/clk/clkdev.c
@@ -157,7 +157,7 @@ struct clk *clk_get(struct device *dev, const char *con_id)
157 157
158 if (dev) { 158 if (dev) {
159 clk = of_clk_get_by_name(dev->of_node, con_id); 159 clk = of_clk_get_by_name(dev->of_node, con_id);
160 if (clk && __clk_get(clk)) 160 if (!IS_ERR(clk) && __clk_get(clk))
161 return clk; 161 return clk;
162 } 162 }
163 163
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 8b70342e7e0b..071e24083dc8 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -12,6 +12,7 @@
12#ifndef __LINUX_CLK_H 12#ifndef __LINUX_CLK_H
13#define __LINUX_CLK_H 13#define __LINUX_CLK_H
14 14
15#include <linux/err.h>
15#include <linux/kernel.h> 16#include <linux/kernel.h>
16#include <linux/notifier.h> 17#include <linux/notifier.h>
17 18
@@ -320,12 +321,12 @@ struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec);
320#else 321#else
321static inline struct clk *of_clk_get(struct device_node *np, int index) 322static inline struct clk *of_clk_get(struct device_node *np, int index)
322{ 323{
323 return NULL; 324 return ERR_PTR(-ENOENT);
324} 325}
325static inline struct clk *of_clk_get_by_name(struct device_node *np, 326static inline struct clk *of_clk_get_by_name(struct device_node *np,
326 const char *name) 327 const char *name)
327{ 328{
328 return NULL; 329 return ERR_PTR(-ENOENT);
329} 330}
330#endif 331#endif
331 332