mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
Merge "coresight: Fix support for sparsely populated ports"
This commit is contained in:
commit
14403b3a85
@ -1398,6 +1398,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];
|
||||
|
@ -58,6 +58,7 @@ static void of_coresight_get_ports(const struct device_node *node,
|
||||
struct device_node *ep = NULL;
|
||||
int in = 0, out = 0;
|
||||
struct device_node *ports = NULL, *port = NULL;
|
||||
struct of_endpoint endpoint;
|
||||
|
||||
ports = of_get_child_by_name(node, "ports");
|
||||
port = of_get_child_by_name(node, "port");
|
||||
@ -70,10 +71,15 @@ static void of_coresight_get_ports(const struct device_node *node,
|
||||
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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user