Thread (16 messages) 16 messages, 3 authors, 2014-09-27
STALE4260d
Revisions (3)
  1. v10 [diff vs current]
  2. v11 [diff vs current]
  3. v13 current

[PATCH v13 9/9] clk: Add docs about calling clk_put after clk_get_parent

From: Tomeu Vizoso <hidden>
Date: 2014-09-23 18:45:05
Also in: lkml
Subsystem: clk api, common clk framework, the rest · Maintainers: Russell King, Michael Turquette, Stephen Boyd, Linus Torvalds

As otherwise the per-user clk will be leaked.

Signed-off-by: Tomeu Vizoso <redacted>
---
 drivers/clk/clk.c   | 3 ++-
 include/linux/clk.h | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index c507548..2c7baea 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1828,7 +1828,8 @@ EXPORT_SYMBOL_GPL(clk_provider_get_parent);
  * clk_get_parent - return the parent of a clk
  * @clk_user: the clk whose parent gets returned
  *
- * Simply returns clk->parent.  Returns NULL if clk is NULL.
+ * Simply returns clk->parent.  Returns NULL if clk is NULL. Caller must call
+ * clk_put() to release the returned struct clk.
  */
 struct clk *clk_get_parent(struct clk *clk_user)
 {
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 066b100..4f54952 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -306,7 +306,8 @@ int clk_set_parent(struct clk *clk, struct clk *parent);
  * @clk: clock source
  *
  * Returns struct clk corresponding to parent clock source, or
- * valid IS_ERR() condition containing errno.
+ * valid IS_ERR() condition containing errno. Caller must call
+ * clk_put() to release the returned struct clk.
  */
 struct clk *clk_get_parent(struct clk *clk);
 
-- 
1.9.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help