Commit 2058224f authored by Suzuki K Poulose's avatar Suzuki K Poulose Committed by Greg Kroah-Hartman

coresight: Add helper to check if the endpoint is input

Add a helper to check if the given endpoint is input.

Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 96330407
...@@ -45,6 +45,11 @@ of_coresight_get_endpoint_device(struct device_node *endpoint) ...@@ -45,6 +45,11 @@ of_coresight_get_endpoint_device(struct device_node *endpoint)
endpoint, of_dev_node_match); endpoint, of_dev_node_match);
} }
static inline bool of_coresight_ep_is_input(struct device_node *ep)
{
return of_property_read_bool(ep, "slave-mode");
}
static void of_coresight_get_ports(const struct device_node *node, static void of_coresight_get_ports(const struct device_node *node,
int *nr_inport, int *nr_outport) int *nr_inport, int *nr_outport)
{ {
...@@ -56,7 +61,7 @@ static void of_coresight_get_ports(const struct device_node *node, ...@@ -56,7 +61,7 @@ static void of_coresight_get_ports(const struct device_node *node,
if (!ep) if (!ep)
break; break;
if (of_property_read_bool(ep, "slave-mode")) if (of_coresight_ep_is_input(ep))
in++; in++;
else else
out++; out++;
...@@ -213,7 +218,7 @@ of_get_coresight_platform_data(struct device *dev, ...@@ -213,7 +218,7 @@ of_get_coresight_platform_data(struct device *dev,
* No need to deal with input ports, as processing the * No need to deal with input ports, as processing the
* output ports connected to them will process the details. * output ports connected to them will process the details.
*/ */
if (of_find_property(ep, "slave-mode", NULL)) if (of_coresight_ep_is_input(ep))
continue; continue;
ret = of_coresight_parse_endpoint(dev, ep, pdata, i); ret = of_coresight_parse_endpoint(dev, ep, pdata, i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment