]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
of: property: Add in-ports/out-ports support to of_graph_get_port_parent()
authorSaravana Kannan <saravanak@google.com>
Wed, 7 Feb 2024 01:18:02 +0000 (17:18 -0800)
committerRob Herring <robh@kernel.org>
Fri, 9 Feb 2024 10:32:09 +0000 (10:32 +0000)
Similar to the existing "ports" node name, coresight device tree bindings
have added "in-ports" and "out-ports" as standard node names for a
collection of ports.

Add support for these name to of_graph_get_port_parent() so that
remote-endpoint parsing can find the correct parent node for these
coresight ports too.

Signed-off-by: Saravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20240207011803.2637531-4-saravanak@google.com
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/property.c

index a5f562a5e14625ff6b333867b216c3b5a54eca5b..b71267c6667cf80309532c4ca2602354ccfc34a2 100644 (file)
@@ -763,7 +763,9 @@ struct device_node *of_graph_get_port_parent(struct device_node *node)
        /* Walk 3 levels up only if there is 'ports' node. */
        for (depth = 3; depth && node; depth--) {
                node = of_get_next_parent(node);
-               if (depth == 2 && !of_node_name_eq(node, "ports"))
+               if (depth == 2 && !of_node_name_eq(node, "ports") &&
+                   !of_node_name_eq(node, "in-ports") &&
+                   !of_node_name_eq(node, "out-ports"))
                        break;
        }
        return node;