summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuzuki K Poulose <suzuki.poulose@arm.com>2018-09-20 21:17:41 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-25 20:09:17 +0200
commit2058224f5415df895551ee8f8e48a2b26acfc20f (patch)
tree08ebeac446491af4a9095a3005ea3012fc5016b9
parentcoresight: Fix remote endpoint parsing (diff)
downloadlinux-2058224f5415df895551ee8f8e48a2b26acfc20f.tar.xz
linux-2058224f5415df895551ee8f8e48a2b26acfc20f.zip
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: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/hwtracing/coresight/of_coresight.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/hwtracing/coresight/of_coresight.c b/drivers/hwtracing/coresight/of_coresight.c
index 2ecdd1432b5c..44903d35009f 100644
--- a/drivers/hwtracing/coresight/of_coresight.c
+++ b/drivers/hwtracing/coresight/of_coresight.c
@@ -45,6 +45,11 @@ of_coresight_get_endpoint_device(struct device_node *endpoint)
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,
int *nr_inport, int *nr_outport)
{
@@ -56,7 +61,7 @@ static void of_coresight_get_ports(const struct device_node *node,
if (!ep)
break;
- if (of_property_read_bool(ep, "slave-mode"))
+ if (of_coresight_ep_is_input(ep))
in++;
else
out++;
@@ -213,7 +218,7 @@ of_get_coresight_platform_data(struct device *dev,
* No need to deal with input ports, as processing the
* 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;
ret = of_coresight_parse_endpoint(dev, ep, pdata, i);