Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7f20d186 authored by Mao Jinlong's avatar Mao Jinlong Committed by Gerrit - the friendly Code Review server
Browse files

Add ports and port child node check in legacy function



in get_ports_legacy function, if there is no ports and port child nodes
of device node, just return to avoid unnecessary actions.

Change-Id: Ie392f1fe8265cb3dba38ac687a0a1612e772a943
Signed-off-by: default avatarMao Jinlong <jinlmao@codeaurora.org>
parent 0070b55b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -68,6 +68,13 @@ static void of_coresight_get_ports_legacy(const struct device_node *node,
{
	struct device_node *ep = NULL;
	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);