* [PATCH] of: property: Document that of_graph_get_endpoint_by_regs needs of_node_put
@ 2019-03-15 9:22 Maxime Ripard
2019-03-28 19:40 ` Rob Herring
0 siblings, 1 reply; 2+ messages in thread
From: Maxime Ripard @ 2019-03-15 9:22 UTC (permalink / raw)
To: Rob Herring, Frank Rowand; +Cc: devicetree, linux-kernel, 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.
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
drivers/of/property.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/of/property.c b/drivers/of/property.c
index 08430031bd28..29bfc5d3b783 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -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)
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] of: property: Document that of_graph_get_endpoint_by_regs needs of_node_put
2019-03-15 9:22 [PATCH] of: property: Document that of_graph_get_endpoint_by_regs needs of_node_put Maxime Ripard
@ 2019-03-28 19:40 ` Rob Herring
0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2019-03-28 19:40 UTC (permalink / raw)
To: Maxime Ripard; +Cc: Frank Rowand, devicetree, linux-kernel
On Fri, Mar 15, 2019 at 10:22:47AM +0100, Maxime Ripard wrote:
> 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.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> ---
> drivers/of/property.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied.
Rob
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-03-28 19:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-15 9:22 [PATCH] of: property: Document that of_graph_get_endpoint_by_regs needs of_node_put Maxime Ripard
2019-03-28 19:40 ` Rob Herring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).