lkml.org 
[lkml]   [2018]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 6/9] coresight: Add helper to check if the endpoint is input
Date
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>
---
drivers/hwtracing/coresight/of_coresight.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/hwtracing/coresight/of_coresight.c b/drivers/hwtracing/coresight/of_coresight.c
index 2ecdd14..44903d3 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);
--
2.7.4
\
 
 \ /
  Last update: 2018-07-27 12:17    [W:0.080 / U:1.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site