public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: return proper ERR_PTR for clk_get when !HAVE_CLK
@ 2015-02-05 19:09 Wolfram Sang
  2015-02-05 23:40 ` Russell King - ARM Linux
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfram Sang @ 2015-02-05 19:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: Wolfram Sang, Russell King

clk_get functions return an ERR_PTR and not NULL in the error case. Make
that consistent for the dummy functions when HAVE_CLK is not enabled.
Otherwise unexpected codepaths might be trying to use a NULL pointer.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
 include/linux/clk.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/clk.h b/include/linux/clk.h
index c7f258a81761..37a286b69943 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -340,12 +340,12 @@ struct clk *clk_get_sys(const char *dev_id, const char *con_id);
 
 static inline struct clk *clk_get(struct device *dev, const char *id)
 {
-	return NULL;
+	return ERR_PTR(-ENOENT);
 }
 
 static inline struct clk *devm_clk_get(struct device *dev, const char *id)
 {
-	return NULL;
+	return ERR_PTR(-ENOENT);
 }
 
 static inline void clk_put(struct clk *clk) {}
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-02-19 16:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-05 19:09 [PATCH] clk: return proper ERR_PTR for clk_get when !HAVE_CLK Wolfram Sang
2015-02-05 23:40 ` Russell King - ARM Linux
2015-02-07 16:42   ` Wolfram Sang
2015-02-07 17:29     ` Russell King - ARM Linux
2015-02-09 14:29       ` Wolfram Sang
2015-02-10 11:02         ` Russell King - ARM Linux
2015-02-19 16:20           ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox