@@ -531,7 +531,7 @@ EXPORT_SYMBOL_GPL(of_prop_next_string);
int of_graph_parse_endpoint(const struct device_node *node,
struct of_endpoint *endpoint)
{
- struct device_node *port_node = of_get_parent(node);
+ struct device_node *port_node = of_graph_get_port(node);
WARN_ONCE(!port_node, "%s(): endpoint %pOF has no parent node\n",
__func__, node);
@@ -621,7 +621,7 @@ struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
return NULL;
}
} else {
- port = of_get_parent(prev);
+ port = of_graph_get_port(prev);
if (WARN_ONCE(!port, "%s(): endpoint %pOF has no parent node\n",
__func__, prev))
return NULL;
@@ -874,7 +874,7 @@ of_fwnode_property_read_string_array(const struct fwnode_handle *fwnode,
static struct fwnode_handle *
of_fwnode_get_parent(const struct fwnode_handle *fwnode)
{
- return of_fwnode_handle(of_get_parent(to_of_node(fwnode)));
+ return of_fwnode_handle(of_graph_get_port(to_of_node(fwnode)));
}
static struct fwnode_handle *
@@ -965,7 +965,7 @@ static int of_fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
struct fwnode_endpoint *endpoint)
{
const struct device_node *node = to_of_node(fwnode);
- struct device_node *port_node = of_get_parent(node);
+ struct device_node *port_node = of_graph_get_port(node);
endpoint->local_fwnode = fwnode;
@@ -37,6 +37,8 @@ struct of_endpoint {
for (child = of_graph_get_next_endpoint(parent, NULL); child != NULL; \
child = of_graph_get_next_endpoint(parent, child))
+#define of_graph_get_port(endpoint) of_get_parent(endpoint)
+
#ifdef CONFIG_OF
int of_graph_parse_endpoint(const struct device_node *node,
struct of_endpoint *endpoint);