devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] device property: preserve usecount for node passed to of_fwnode_graph_get_port_parent()
@ 2017-08-22  0:19 Niklas Söderlund
  2017-08-22 14:49 ` Rob Herring
  0 siblings, 1 reply; 9+ messages in thread
From: Niklas Söderlund @ 2017-08-22  0:19 UTC (permalink / raw)
  To: devicetree, linux-media
  Cc: Sakari Ailus, Kieran Bingham, linux-renesas-soc,
	Niklas Söderlund

Using CONFIG_OF_DYNAMIC=y uncovered an imbalance in the usecount of the
node being passed to of_fwnode_graph_get_port_parent(). Preserve the
usecount by using of_get_parent() instead of of_get_next_parent() which
don't decrement the usecount of the node passed to it.

Fixes: 3b27d00e7b6d7c88 ("device property: Move fwnode graph ops to firmware specific locations")
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.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 067f9fab7b77c794..59afeea9888e3b3d 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -923,7 +923,7 @@ of_fwnode_graph_get_port_parent(struct fwnode_handle *fwnode)
 	struct device_node *np;
 
 	/* Get the parent of the port */
-	np = of_get_next_parent(to_of_node(fwnode));
+	np = of_get_parent(to_of_node(fwnode));
 	if (!np)
 		return NULL;
 
-- 
2.14.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-10-04 12:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-22  0:19 [PATCH v2] device property: preserve usecount for node passed to of_fwnode_graph_get_port_parent() Niklas Söderlund
2017-08-22 14:49 ` Rob Herring
2017-08-22 14:58   ` Geert Uytterhoeven
2017-08-22 15:00   ` Niklas Söderlund
2017-08-22 19:42     ` Rob Herring
2017-08-27 22:40       ` Sakari Ailus
2017-10-03 13:40         ` Rob Herring
2017-10-04 12:30           ` Sakari Ailus
2017-10-04 12:48             ` 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).