From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: prabhakar.csengg@gmail.com,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Claudiu Beznea <claudiu.beznea@tuxon.dev>,
Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@gmail.com>,
Eugen Hristev <eugen.hristev@collabora.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Helge Deller <deller@gmx.de>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Maxime Ripard <mripard@kernel.org>,
Michal Simek <michal.simek@amd.com>,
Nicolas Ferre <nicolas.ferre@microchip.com>,
Rob Herring <robh+dt@kernel.org>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Thomas Zimmermann <tzimmermann@suse.de>,
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
coresight@lists.linaro.org, dri-devel@lists.freedesktop.org,
linux-arm-kernel@lists.infradead.org,
linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org,
linux-staging@lists.linux.dev
Subject: Re: [PATCH v2 resend 4/8] media: platform: ti: use for_each_endpoint_of_node()
Date: Wed, 29 May 2024 03:47:46 +0300 [thread overview]
Message-ID: <20240529004746.GD1436@pendragon.ideasonboard.com> (raw)
In-Reply-To: <87cyp54hky.wl-kuninori.morimoto.gx@renesas.com>
Hello Morimoto-san,
Thank you for the patch.
On Tue, May 28, 2024 at 11:55:42PM +0000, Kuninori Morimoto wrote:
> We already have for_each_endpoint_of_node(), don't use
> of_graph_get_next_endpoint() directly. Replace it.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
> drivers/media/platform/ti/am437x/am437x-vpfe.c | 12 +++++-------
> drivers/media/platform/ti/davinci/vpif_capture.c | 12 ++++++------
> 2 files changed, 11 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/media/platform/ti/am437x/am437x-vpfe.c b/drivers/media/platform/ti/am437x/am437x-vpfe.c
> index 77e12457d1495..009ff68a2b43c 100644
> --- a/drivers/media/platform/ti/am437x/am437x-vpfe.c
> +++ b/drivers/media/platform/ti/am437x/am437x-vpfe.c
> @@ -2287,7 +2287,7 @@ static const struct v4l2_async_notifier_operations vpfe_async_ops = {
> static struct vpfe_config *
> vpfe_get_pdata(struct vpfe_device *vpfe)
> {
> - struct device_node *endpoint = NULL;
> + struct device_node *endpoint;
> struct device *dev = vpfe->pdev;
> struct vpfe_subdev_info *sdinfo;
> struct vpfe_config *pdata;
> @@ -2306,14 +2306,11 @@ vpfe_get_pdata(struct vpfe_device *vpfe)
> if (!pdata)
> return NULL;
>
> - for (i = 0; ; i++) {
> + i = 0;
> + for_each_endpoint_of_node(dev->of_node, endpoint) {
> struct v4l2_fwnode_endpoint bus_cfg = { .bus_type = 0 };
> struct device_node *rem;
>
> - endpoint = of_graph_get_next_endpoint(dev->of_node, endpoint);
> - if (!endpoint)
> - break;
> -
> sdinfo = &pdata->sub_devs[i];
> sdinfo->grp_id = 0;
>
> @@ -2371,9 +2368,10 @@ vpfe_get_pdata(struct vpfe_device *vpfe)
> of_node_put(rem);
> if (IS_ERR(pdata->asd[i]))
> goto cleanup;
> +
> + i++;
> }
>
> - of_node_put(endpoint);
> return pdata;
>
> cleanup:
> diff --git a/drivers/media/platform/ti/davinci/vpif_capture.c b/drivers/media/platform/ti/davinci/vpif_capture.c
> index c28794b6677b7..078ae11cd0787 100644
> --- a/drivers/media/platform/ti/davinci/vpif_capture.c
> +++ b/drivers/media/platform/ti/davinci/vpif_capture.c
> @@ -1517,16 +1517,12 @@ vpif_capture_get_pdata(struct platform_device *pdev,
> if (!pdata->subdev_info)
> return NULL;
>
> - for (i = 0; i < VPIF_CAPTURE_NUM_CHANNELS; i++) {
> + i = 0;
> + for_each_endpoint_of_node(pdev->dev.of_node, endpoint) {
> struct v4l2_fwnode_endpoint bus_cfg = { .bus_type = 0 };
> unsigned int flags;
> int err;
>
> - endpoint = of_graph_get_next_endpoint(pdev->dev.of_node,
> - endpoint);
> - if (!endpoint)
> - break;
> -
> rem = of_graph_get_remote_port_parent(endpoint);
> if (!rem) {
> dev_dbg(&pdev->dev, "Remote device at %pOF not found\n",
> @@ -1577,6 +1573,10 @@ vpif_capture_get_pdata(struct platform_device *pdev,
> goto err_cleanup;
>
> of_node_put(rem);
> +
> + i++;
> + if (i >= VPIF_CAPTURE_NUM_CHANNELS)
> + break;
> }
>
> done:
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2024-05-29 0:48 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-28 23:55 [PATCH v2 resend 0/8] use for_each_endpoint_of_node() Kuninori Morimoto
2024-05-28 23:55 ` [PATCH v2 resend 1/8] gpu: drm: " Kuninori Morimoto
2024-05-29 0:01 ` Dmitry Baryshkov
2024-05-29 0:37 ` Laurent Pinchart
2024-05-28 23:55 ` [PATCH v2 resend 2/8] hwtracing: " Kuninori Morimoto
2024-05-29 0:40 ` Laurent Pinchart
2024-05-29 12:30 ` James Clark
2024-05-29 14:34 ` Dan Carpenter
2024-05-29 14:52 ` Laurent Pinchart
2024-05-29 15:19 ` Dan Carpenter
2024-05-29 15:29 ` Laurent Pinchart
2024-05-29 23:39 ` Kuninori Morimoto
2024-05-28 23:55 ` [PATCH v2 resend 3/8] media: platform: microchip: " Kuninori Morimoto
2024-05-29 0:42 ` Laurent Pinchart
2024-05-28 23:55 ` [PATCH v2 resend 4/8] media: platform: ti: " Kuninori Morimoto
2024-05-29 0:47 ` Laurent Pinchart [this message]
2024-05-28 23:55 ` [PATCH v2 resend 5/8] media: platform: xilinx: " Kuninori Morimoto
2024-05-29 0:49 ` Laurent Pinchart
2024-05-28 23:55 ` [PATCH v2 resend 6/8] staging: media: atmel: " Kuninori Morimoto
2024-05-29 0:50 ` Laurent Pinchart
2024-05-28 23:55 ` [PATCH v2 resend 7/8] video: fbdev: " Kuninori Morimoto
2024-05-29 0:51 ` Laurent Pinchart
2024-05-28 23:55 ` [PATCH v2 resend 8/8] fbdev: omapfb: use of_graph_get_remote_port() Kuninori Morimoto
2024-05-29 0:52 ` Laurent Pinchart
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=20240529004746.GD1436@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=alexandre.belloni@bootlin.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=coresight@lists.linaro.org \
--cc=daniel@ffwll.ch \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=eugen.hristev@collabora.com \
--cc=gregkh@linuxfoundation.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mchehab@kernel.org \
--cc=michal.simek@amd.com \
--cc=mripard@kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=prabhakar.csengg@gmail.com \
--cc=robh+dt@kernel.org \
--cc=suzuki.poulose@arm.com \
--cc=tomi.valkeinen@ideasonboard.com \
--cc=tzimmermann@suse.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;
as well as URLs for NNTP newsgroup(s).