diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2014-12-01 12:32:32 (GMT) |
---|---|---|
committer | Philipp Zabel <p.zabel@pengutronix.de> | 2015-02-23 10:42:23 (GMT) |
commit | f033c0bcc53675562200680f4cb4a86710d9fbae (patch) | |
tree | 0fceddf110155d73a39194e945b1c9b473a7e37f /drivers/of | |
parent | c517d838eb7d07bbe9507871fab3931deccff539 (diff) | |
download | linux-f033c0bcc53675562200680f4cb4a86710d9fbae.tar.xz |
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.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c index 0a8aeb8..05b20f1 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -2086,8 +2086,7 @@ EXPORT_SYMBOL(of_graph_parse_endpoint); * @prev: previous endpoint node, or NULL to get first * * Return: An 'endpoint' node pointer with refcount incremented. Refcount - * of the passed @prev node is not decremented, the caller have to use - * of_node_put() on it when done. + * of the passed @prev node is decremented. */ struct device_node *of_graph_get_next_endpoint(const struct device_node *parent, struct device_node *prev) @@ -2123,12 +2122,6 @@ struct device_node *of_graph_get_next_endpoint(const struct device_node *parent, if (WARN_ONCE(!port, "%s(): endpoint %s has no parent node\n", __func__, prev->full_name)) return NULL; - - /* - * Avoid dropping prev node refcount to 0 when getting the next - * child below. - */ - of_node_get(prev); } while (1) { |