Re: [PATCH] usb: typec: fusb302: add DRM DP HPD bridge support

From: Dmitry Baryshkov

Date: Fri Mar 13 2026 - 14:10:00 EST


On Fri, 13 Mar 2026 at 17:23, Sebastian Reichel
<sebastian.reichel@xxxxxxxxxxxxx> wrote:
>
> Hi,
>
> On Fri, Mar 13, 2026 at 12:15:08PM +0400, Alexey Charkov wrote:
> > [...]
> > > + ret = devm_drm_dp_hpd_bridge_add(chip->dev, bridge_dev);
> > > + if (ret)
> > > + return ret;
> > > +
> > > return ret;
> >
> > Nit: how about
> >
> > return devm_drm_dp_hpd_bridge_add(chip->dev, bridge_dev);
> >
> > Saves three lines :)
>
> The patch got queued already. I can provide a follow-up patch if
> that is something people want to see. Generally this is a style
> decision handled differently between subsystems. Your suggestion
> saves three lines and is more efficient (but compiler will optimize
> to that anyways). Meanwhile the version I provided results in
> smaller diff when more code is appended in the probe function or
> the order has to be changed for some reason.
>
> FWIW I would like to see this driver be more converted towards
> device managed resource and then use drm_dp_hpd_bridge_register()

This API is more fragile. Using it can result in various side effects,
starting from EPROBE_DEFER loops if it is used in a wrong place.
Other bridges might also get the pointed to the bridge and then
witness its disappearance.
I think in the long term we should remove that API completely.

> instead of doing the allocation and add step separetely. But I
> would wait with the cleanup until the 7.2 cycle as
> devm_alloc_ordered_workqueue() will land in 7.1.
>
> Greetings,
>
> -- Sebastian



--
With best wishes
Dmitry