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

Commit cfb6c39e authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "coresight: Fix support for sparsely populated ports"

parents ccb69eed 4f019334
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1570,6 +1570,8 @@ struct coresight_device *coresight_register(struct coresight_desc *desc)
		}

		for (i = 0; i < csdev->nr_outport; i++) {
			if (desc->pdata->child_names[i] == NULL)
				continue;
			conns[i].outport = desc->pdata->outports[i];
			conns[i].child_name = desc->pdata->child_names[i];
			conns[i].child_port = desc->pdata->child_ports[i];
+8 −2
Original line number Diff line number Diff line
@@ -50,16 +50,22 @@ static void of_coresight_get_ports(const struct device_node *node,
{
	struct device_node *ep = NULL;
	int in = 0, out = 0;
	struct of_endpoint endpoint;

	do {
		ep = of_graph_get_next_endpoint(node, ep);
		if (!ep)
			break;

		if (of_graph_parse_endpoint(ep, &endpoint))
			continue;

		if (of_property_read_bool(ep, "slave-mode"))
			in++;
			in = (endpoint.port + 1 > in) ?
				endpoint.port + 1 : in;
		else
			out++;
			out = (endpoint.port + 1) > out ?
				endpoint.port + 1 : out;

	} while (ep);