Hi Maxime,

On Wed, 9 Jul 2025 09:32:28 +0200
Maxime Ripard <[email protected]> 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 <[email protected]>

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

Reply via email to