diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2014-12-01 13:32:32 +0100 |
---|---|---|
committer | Philipp Zabel <p.zabel@pengutronix.de> | 2015-02-23 11:42:23 +0100 |
commit | f033c0bcc53675562200680f4cb4a86710d9fbae (patch) | |
tree | 0fceddf110155d73a39194e945b1c9b473a7e37f /drivers/gpu/drm/rcar-du | |
parent | c517d838eb7d07bbe9507871fab3931deccff539 (diff) | |
download | op-kernel-dev-f033c0bcc53675562200680f4cb4a86710d9fbae.zip op-kernel-dev-f033c0bcc53675562200680f4cb4a86710d9fbae.tar.gz |
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/gpu/drm/rcar-du')
-rw-r--r-- | drivers/gpu/drm/rcar-du/rcar_du_kms.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index cc9136e..68dab26 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c @@ -206,7 +206,7 @@ static int rcar_du_encoders_init_one(struct rcar_du_device *rcdu, enum rcar_du_encoder_type enc_type = RCAR_DU_ENCODER_NONE; struct device_node *connector = NULL; struct device_node *encoder = NULL; - struct device_node *prev = NULL; + struct device_node *ep_node = NULL; struct device_node *entity_ep_node; struct device_node *entity; int ret; @@ -225,11 +225,7 @@ static int rcar_du_encoders_init_one(struct rcar_du_device *rcdu, entity_ep_node = of_parse_phandle(ep->local_node, "remote-endpoint", 0); while (1) { - struct device_node *ep_node; - - ep_node = of_graph_get_next_endpoint(entity, prev); - of_node_put(prev); - prev = ep_node; + ep_node = of_graph_get_next_endpoint(entity, ep_node); if (!ep_node) break; @@ -300,7 +296,7 @@ static int rcar_du_encoders_init_one(struct rcar_du_device *rcdu, static int rcar_du_encoders_init(struct rcar_du_device *rcdu) { struct device_node *np = rcdu->dev->of_node; - struct device_node *prev = NULL; + struct device_node *ep_node = NULL; unsigned int num_encoders = 0; /* @@ -308,15 +304,12 @@ static int rcar_du_encoders_init(struct rcar_du_device *rcdu) * pipeline. */ while (1) { - struct device_node *ep_node; enum rcar_du_output output; struct of_endpoint ep; unsigned int i; int ret; - ep_node = of_graph_get_next_endpoint(np, prev); - of_node_put(prev); - prev = ep_node; + ep_node = of_graph_get_next_endpoint(np, ep_node); if (ep_node == NULL) break; |