Commit 3314c6bd authored by Niklas Söderlund's avatar Niklas Söderlund Committed by Rob Herring

device property: preserve usecount for node passed to of_fwnode_graph_get_port_parent()

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: 3b27d00e ("device property: Move fwnode graph ops to firmware specific locations")
Signed-off-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent 22f8cc6e
...@@ -954,7 +954,7 @@ of_fwnode_graph_get_port_parent(struct fwnode_handle *fwnode) ...@@ -954,7 +954,7 @@ of_fwnode_graph_get_port_parent(struct fwnode_handle *fwnode)
struct device_node *np; struct device_node *np;
/* Get the parent of the port */ /* 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) if (!np)
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment