Skip to contentSkip to conversation

of: Document exactly what of_find_node_by_name() puts

PATCH Applied Stephen Boyd 3 participants 3 messages Nov 17, 2017 – Nov 20, 2017 Device tree

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 of: Document exactly what of_find_node_by_name() puts

It isn't clear if this function of_node_put()s the 'from' argument, or the node it searches. Clearly indicate which variable is touched. Fold in some more fixes from Randy too because we're in the area.

---

Changes from v1:
* Fold in Randy's fixes

 drivers/of/base.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/of/base.c +3 -3
index 63897531cd75..4368a878df88 100644
@@ -863,10 +863,10 @@ EXPORT_SYMBOL(of_find_node_opts_by_path);
 
 /**
  *	of_find_node_by_name - Find a node by its "name" property
- *	@from:	The node to start searching from or NULL, the node
+ *	@from:	The node to start searching from or NULL; the node
  *		you pass will not be searched, only the next one
- *		will; typically, you pass what the previous call
- *		returned. of_node_put() will be called on it
+ *		will. Typically, you pass what the previous call
+ *		returned. of_node_put() will be called on @from.
  *	@name:	The name string to match against
  *
  *	Returns a node pointer with refcount incremented, use
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Acked-by on v2 1/1
#1 lore raw
Quoted 24 lines · Stephen Boyd

It isn't clear if this function of_node_put()s the 'from' argument, or the node it searches. Clearly indicate which variable is touched. Fold in some more fixes from Randy too because we're in the area.

---

Changes from v1:
* Fold in Randy's fixes

 drivers/of/base.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/of/base.c +0 -0
index 63897531cd75..4368a878df88 100644
@@ -863,10 +863,10 @@ EXPORT_SYMBOL(of_find_node_opts_by_path);
 
 /**
  *	of_find_node_by_name - Find a node by its "name" property

drivers/of/base.c EXPORT_SYMBOL(of_find_node_opts_by_path); · line 872

Quoted 10 lines
drivers/of/base.c +3 -3
- *	@from:	The node to start searching from or NULL, the node
+ *	@from:	The node to start searching from or NULL; the node
  *		you pass will not be searched, only the next one
- *		will; typically, you pass what the previous call
- *		returned. of_node_put() will be called on it
+ *		will. Typically, you pass what the previous call
+ *		returned. of_node_put() will be called on @from.
  *	@name:	The name string to match against
  *
  *	Returns a node pointer with refcount incremented, use

Looks good. Thanks.

Signature · 1 line
~Randy
maintainer Applied
#2 lore raw
In reply to Stephen Boyd
Quoted 7 lines · Stephen Boyd

It isn't clear if this function of_node_put()s the 'from' argument, or the node it searches. Clearly indicate which variable is touched. Fold in some more fixes from Randy too because we're in the area.

Quoted 7 lines

---

Changes from v1:
* Fold in Randy's fixes

 drivers/of/base.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Applied, thanks.

Rob