From: "Maíra Canal" <mcanal@igalia.com>
To: Luca Ceresoli <luca.ceresoli@bootlin.com>,
Maxime Ripard <mripard@kernel.org>,
Dave Stevenson <dave.stevenson@raspberrypi.com>,
Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>
Cc: Paul Cercueil <paul.cercueil@bootlin.com>,
Hui Pu <Hui.Pu@gehealthcare.com>,
Ian Ray <ian.ray@gehealthcare.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/3] drm/vc4: dpi: inline vc4_dpi_init_bridge() into vc4_dpi_bind()
Date: Sat, 24 Oct 2026 10:03:31 -0300 [thread overview]
Message-ID: <1202bdc6-afde-45e1-8a32-c64f9424a65d@igalia.com> (raw)
In-Reply-To: <20261013-drm-fix-of_get_bridge-build-regression-v3-3-0b4c0b65be82@bootlin.com>
Hi Luca,
If you go ahead with this patch, could you merge it with [1/3]
Personally, I prefer to keep it as a separate function. vc4_dpi_bind()
is already a big function, with several initializations. I have the
impression that vc4_dpi_init_bridge() makes the error handling more
clear.
But that's bikeshed territory...
Best regards,
- Maíra
On 13/10/26 12:23, Luca Ceresoli wrote:
> There isn't much benefit in this small static function. Inline it in the
> caller.
>
> Link: https://lore.kernel.org/lkml/accaa9f4ad05ef73071e5cfb5368fcbdd394d3ab.camel@bootlin.com/
> Suggested-by: Paul Cercueil <paul.cercueil@bootlin.com>
> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
>
> ---
>
> New patch in v3
> ---
> drivers/gpu/drm/vc4/vc4_dpi.c | 37 ++++++++++++++-----------------------
> 1 file changed, 14 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
> index feefefcf3ad7..5439e73da0d4 100644
> --- a/drivers/gpu/drm/vc4/vc4_dpi.c
> +++ b/drivers/gpu/drm/vc4/vc4_dpi.c
> @@ -278,26 +278,6 @@ static const struct of_device_id vc4_dpi_dt_match[] = {
> {}
> };
>
> -/* Sets up the next link in the display chain */
> -static int vc4_dpi_init_bridge(struct vc4_dpi *dpi)
> -{
> - struct device *dev = &dpi->pdev->dev;
> -
> - struct drm_bridge *bridge __free(drm_bridge_put) =
> - of_drm_get_bridge_by_endpoint(dev->of_node, 0, 0);
> - if (IS_ERR(bridge)) {
> - /* If nothing was connected in the DT, that's not an
> - * error.
> - */
> - if (PTR_ERR(bridge) == -ENODEV)
> - return 0;
> - else
> - return PTR_ERR(bridge);
> - }
> -
> - return drm_bridge_attach(&dpi->encoder.base, bridge, NULL, 0);
> -}
> -
> static void vc4_dpi_disable_clock(void *ptr)
> {
> struct vc4_dpi *dpi = ptr;
> @@ -366,9 +346,20 @@ static int vc4_dpi_bind(struct device *dev, struct device *master, void *data)
>
> drm_encoder_helper_add(&dpi->encoder.base, &vc4_dpi_encoder_helper_funcs);
>
> - ret = vc4_dpi_init_bridge(dpi);
> - if (ret)
> - return ret;
> + /* Set up the next link in the display chain */
> + struct drm_bridge *bridge __free(drm_bridge_put) =
> + of_drm_get_bridge_by_endpoint(dev->of_node, 0, 0);
> + if (IS_ERR(bridge)) {
> + /* If nothing was connected in the DT (-ENODEV), that's not
> + * an error.
> + */
> + if (PTR_ERR(bridge) != -ENODEV)
> + return PTR_ERR(bridge);
> + } else {
> + ret = drm_bridge_attach(&dpi->encoder.base, bridge, NULL, 0);
> + if (ret)
> + return ret;
> + }
>
> dev_set_drvdata(dev, dpi);
>
>
prev parent reply other threads:[~2026-10-24 13:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 15:23 [PATCH v3 0/3] drm: remove deprecated *_of_get_bridge() from non-OF drivers Luca Ceresoli
2026-10-13 15:23 ` [PATCH v3 1/3] drm/vc4: dpi: stop using deprecated drmm_of_get_bridge() Luca Ceresoli
2026-10-24 12:57 ` Maíra Canal
2026-10-13 15:23 ` [PATCH v3 2/3] drm/vc4: dsi: " Luca Ceresoli
2026-10-24 12:56 ` Maíra Canal
2026-10-13 15:23 ` [PATCH v3 3/3] drm/vc4: dpi: inline vc4_dpi_init_bridge() into vc4_dpi_bind() Luca Ceresoli
2026-10-24 13:03 ` Maíra Canal [this message]
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=1202bdc6-afde-45e1-8a32-c64f9424a65d@igalia.com \
--to=mcanal@igalia.com \
--cc=Hui.Pu@gehealthcare.com \
--cc=airlied@gmail.com \
--cc=dave.stevenson@raspberrypi.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=ian.ray@gehealthcare.com \
--cc=kernel-list@raspberrypi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luca.ceresoli@bootlin.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=paul.cercueil@bootlin.com \
--cc=simona@ffwll.ch \
--cc=thomas.petazzoni@bootlin.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
all inboxes | Powered by JetHome®