Skip to contentSkip to conversation

of: property: Document that of_graph_get_endpoint_by_regs needs of_node_put

PATCH Applied Maxime Ripard 2 participants 2 messages Mar 15, 2019 – Mar 28, 2019 Device tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 of: property: Document that of_graph_get_endpoint_by_regs needs of_node_put

The node returned by of_graph_get_endpoint_by_regs has a reference taken, and we need to put that reference back when done with the node.

However, the documentation for that node doesn't mention it, so let's make sure it does.

---
 drivers/of/property.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/property.c +1 -1
index 08430031bd28..29bfc5d3b783 100644
@@ -659,7 +659,7 @@ EXPORT_SYMBOL(of_graph_get_next_endpoint);
  *
  * Return: An 'endpoint' node pointer which is identified by reg and at the same
  * is the child of a port node identified by port_reg. reg and port_reg are
- * ignored when they are -1.
+ * ignored when they are -1. Use of_node_put() on the pointer when done.
  */
 struct device_node *of_graph_get_endpoint_by_regs(
 	const struct device_node *parent, int port_reg, int reg)
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw
Quoted 10 lines · Maxime Ripard

The node returned by of_graph_get_endpoint_by_regs has a reference taken, and we need to put that reference back when done with the node.

However, the documentation for that node doesn't mention it, so let's make sure it does.

---
 drivers/of/property.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied.

Rob