aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2014-12-01 07:32:32 -0500
committerPhilipp Zabel <p.zabel@pengutronix.de>2015-02-23 05:42:23 -0500
commitf033c0bcc53675562200680f4cb4a86710d9fbae (patch)
tree0fceddf110155d73a39194e945b1c9b473a7e37f /drivers/of
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/of')
-rw-r--r--drivers/of/base.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 0a8aeb8523fe..05b20f1cca7b 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2086,8 +2086,7 @@ EXPORT_SYMBOL(of_graph_parse_endpoint);
2086 * @prev: previous endpoint node, or NULL to get first 2086 * @prev: previous endpoint node, or NULL to get first
2087 * 2087 *
2088 * Return: An 'endpoint' node pointer with refcount incremented. Refcount 2088 * Return: An 'endpoint' node pointer with refcount incremented. Refcount
2089 * of the passed @prev node is not decremented, the caller have to use 2089 * of the passed @prev node is decremented.
2090 * of_node_put() on it when done.
2091 */ 2090 */
2092struct device_node *of_graph_get_next_endpoint(const struct device_node *parent, 2091struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
2093 struct device_node *prev) 2092 struct device_node *prev)
@@ -2123,12 +2122,6 @@ struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
2123 if (WARN_ONCE(!port, "%s(): endpoint %s has no parent node\n", 2122 if (WARN_ONCE(!port, "%s(): endpoint %s has no parent node\n",
2124 __func__, prev->full_name)) 2123 __func__, prev->full_name))
2125 return NULL; 2124 return NULL;
2126
2127 /*
2128 * Avoid dropping prev node refcount to 0 when getting the next
2129 * child below.
2130 */
2131 of_node_get(prev);
2132 } 2125 }
2133 2126
2134 while (1) { 2127 while (1) {