Skip to contentSkip to conversation

clk: document that clk_get_parent() returns NULL

PATCH In review Dan Carpenter 2 participants 2 messages Jul 14 – Jul 16

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: document that clk_get_parent() returns NULL

The documentation in the clk.h file says that clk_get_parent() returns error pointers but it doesn't. It's also not consistent with the comments next to the clk_get_parent() implementation which say that it returns NULL when the clk is NULL. Update the comments so they are consistent and accurate and say that it returns NULL.

---
 include/linux/clk.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/clk.h +2 -2
index 998ba3f261da..aa93ce1fbf37 100644
@@ -951,8 +951,8 @@ int clk_set_parent(struct clk *clk, struct clk *parent);
  * clk_get_parent - get the parent clock source for this clock
  * @clk: clock source
  *
- * Returns struct clk corresponding to parent clock source, or
- * valid IS_ERR() condition containing errno.
+ * Returns struct clk corresponding to parent clock source, or NULL
+ * if clk is NULL.
  */
 struct clk *clk_get_parent(struct clk *clk);
 
Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Dan Carpenter

The documentation in the clk.h file says that clk_get_parent() returns error pointers but it doesn't. It's also not consistent with the comments next to the clk_get_parent() implementation which say that it returns NULL when the clk is NULL. Update the comments so they are consistent and accurate and say that it returns NULL.