[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250709112231.05aa90bc@booty>
Date: Wed, 9 Jul 2025 11:22:31 +0200
From: Luca Ceresoli <luca.ceresoli@...tlin.com>
To: Maxime Ripard <mripard@...nel.org>
Cc: Alain Volmat <alain.volmat@...s.st.com>, Raphael Gallais-Pou
<rgallaispou@...il.com>, Maarten Lankhorst
<maarten.lankhorst@...ux.intel.com>, Thomas Zimmermann
<tzimmermann@...e.de>, David Airlie <airlied@...il.com>, Simona Vetter
<simona@...ll.ch>, Marek Szyprowski <m.szyprowski@...sung.com>, Hui Pu
<Hui.Pu@...ealthcare.com>, Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] drm/sti: hda: convert to devm_drm_bridge_alloc()
API
Hi Maxime,
On Wed, 9 Jul 2025 09:32:28 +0200
Maxime Ripard <mripard@...nel.org> wrote:
...
> > @@ -677,7 +683,6 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data)
> > struct drm_encoder *encoder;
> > struct sti_hda_connector *connector;
> > struct drm_connector *drm_connector;
> > - struct drm_bridge *bridge;
> > int err;
> >
> > /* Set the drm device handle */
> > @@ -693,13 +698,7 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data)
> >
> > connector->hda = hda;
> >
> > - bridge = devm_kzalloc(dev, sizeof(*bridge), GFP_KERNEL);
> > - if (!bridge)
> > - return -ENOMEM;
> > -
> > - bridge->driver_private = hda;
> > - bridge->funcs = &sti_hda_bridge_funcs;
> > - drm_bridge_attach(encoder, bridge, NULL, 0);
> > + drm_bridge_attach(encoder, &hda->bridge, NULL, 0);
>
> It's not entirely related, but the connector is also allocated right
> before and could be moved into the structure instead of storing a
> pointer.
>
> Either way,
> Reviewed-by: Maxime Ripard <mripard@...nel.org>
Given this patch as-is is fixing a (potentially invisible) bug due to
using the old bridge allocation policy, and the connector allocation
change is an improvements but not a fix, I'll apply as is.
BTW, as a side effect, this series is removing two users of
bridge->driver_private :)
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Powered by blists - more mailing lists