From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org,
Grant Likely <grant.likely@linaro.org>,
Mark Yao <mark.yao@rock-chips.com>
Subject: Re: [PATCH 3/4] drm/rcar-du: use for_each_endpoint_of_node macro
Date: Mon, 23 Feb 2015 19:00:32 +0200 [thread overview]
Message-ID: <1495627.rEAeKFzOFN@avalon> (raw)
In-Reply-To: <1424709269-23374-4-git-send-email-p.zabel@pengutronix.de>
Hi Philipp,
Thank you for the patch.
On Monday 23 February 2015 17:34:28 Philipp Zabel wrote:
> Using the for_each_... macro should make the code a bit shorter and
> easier to read.
>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/gpu/drm/rcar-du/rcar_du_kms.c | 16 +++-------------
> 1 file changed, 3 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c
> b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index 68dab26..c235074 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
> @@ -224,12 +224,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) {
> - ep_node = of_graph_get_next_endpoint(entity, ep_node);
> -
> - if (!ep_node)
> - break;
> -
> + for_each_endpoint_of_node(entity, ep_node) {
> if (ep_node == entity_ep_node)
> continue;
>
> @@ -296,24 +291,19 @@ 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 *ep_node = NULL;
> + struct device_node *ep_node;
> unsigned int num_encoders = 0;
>
> /*
> * Iterate over the endpoints and create one encoder for each output
> * pipeline.
> */
> - while (1) {
> + for_each_endpoint_of_node(np, ep_node) {
> enum rcar_du_output output;
> struct of_endpoint ep;
> unsigned int i;
> int ret;
>
> - ep_node = of_graph_get_next_endpoint(np, ep_node);
> -
> - if (ep_node == NULL)
> - break;
> -
> ret = of_graph_parse_endpoint(ep_node, &ep);
> if (ret < 0) {
> of_node_put(ep_node);
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2015-02-23 16:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-23 16:34 [PATCH 0/4] drm: use for_each_endpoint_of_node macro Philipp Zabel
2015-02-23 16:34 ` [PATCH 1/4] drm: use for_each_endpoint_of_node macro in drm_of_find_possible_crtcs Philipp Zabel
2015-02-23 16:34 ` [PATCH 2/4] drm/imx: use for_each_endpoint_of_node macro in imx_drm_encoder_get_mux_id Philipp Zabel
2015-02-23 16:34 ` [PATCH 3/4] drm/rcar-du: use for_each_endpoint_of_node macro Philipp Zabel
2015-02-23 17:00 ` Laurent Pinchart [this message]
2015-02-23 16:34 ` [PATCH 4/4] drm/rockchip: use for_each_endpoint_of_node macro, drop endpoint reference on break Philipp Zabel
2015-02-24 3:13 ` Daniel Kurtz
2015-02-24 9:24 ` Philipp Zabel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1495627.rEAeKFzOFN@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=grant.likely@linaro.org \
--cc=kernel@pengutronix.de \
--cc=mark.yao@rock-chips.com \
--cc=p.zabel@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox