diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c index 979b6142acc8..910dd5bf5c76 100644 --- a/drivers/hwtracing/coresight/coresight-platform.c +++ b/drivers/hwtracing/coresight/coresight-platform.c @@ -69,6 +69,13 @@ static void of_coresight_get_ports_legacy(const struct device_node *node, struct device_node *ep = NULL; struct of_endpoint endpoint; int in = 0, out = 0; + struct device_node *ports = NULL, *port = NULL; + + ports = of_get_child_by_name(node, "ports"); + port = of_get_child_by_name(node, "port"); + + if (!ports && !port) + return; do { ep = of_graph_get_next_endpoint(node, ep);