aboutsummaryrefslogtreecommitdiff
path: root/drivers/coresight/of_coresight.c
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2014-12-01 13:32:32 +0100
committerPhilipp Zabel <p.zabel@pengutronix.de>2015-02-23 11:42:23 +0100
commitf033c0bcc53675562200680f4cb4a86710d9fbae (patch)
tree0fceddf110155d73a39194e945b1c9b473a7e37f /drivers/coresight/of_coresight.c
parentc517d838eb7d07bbe9507871fab3931deccff539 (diff)
of: Decrement refcount of previous endpoint in of_graph_get_next_endpoint
Decrementing the reference count of the previous endpoint node allows to use the of_graph_get_next_endpoint function in a for_each_... style macro. All current users of this function that pass a non-NULL prev parameter (that is, soc_camera and imx-drm) are changed to not decrement the passed prev argument's refcount themselves. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/coresight/of_coresight.c')
-rw-r--r--drivers/coresight/of_coresight.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/coresight/of_coresight.c b/drivers/coresight/of_coresight.c
index c3efa418a86d..6f75e9d5b6fb 100644
--- a/drivers/coresight/of_coresight.c
+++ b/drivers/coresight/of_coresight.c
@@ -52,15 +52,6 @@ of_coresight_get_endpoint_device(struct device_node *endpoint)
endpoint, of_dev_node_match);
}
-static struct device_node *of_get_coresight_endpoint(
- const struct device_node *parent, struct device_node *prev)
-{
- struct device_node *node = of_graph_get_next_endpoint(parent, prev);
-
- of_node_put(prev);
- return node;
-}
-
static void of_coresight_get_ports(struct device_node *node,
int *nr_inport, int *nr_outport)
{
@@ -68,7 +59,7 @@ static void of_coresight_get_ports(struct device_node *node,
int in = 0, out = 0;
do {
- ep = of_get_coresight_endpoint(node, ep);
+ ep = of_graph_get_next_endpoint(node, ep);
if (!ep)
break;
@@ -140,7 +131,7 @@ struct coresight_platform_data *of_get_coresight_platform_data(
/* Iterate through each port to discover topology */
do {
/* Get a handle on a port */
- ep = of_get_coresight_endpoint(node, ep);
+ ep = of_graph_get_next_endpoint(node, ep);
if (!ep)
break;