Hi, On Mon, Jan 19, 2026 at 10:18:12PM +0100, Luca Ceresoli wrote: > Maxime, I'd appreciate your opinion about the topic below. > > On Fri Jan 16, 2026 at 6:02 PM CET, Kory Maincent (TI.com) wrote: > > Replace drm_of_find_panel_or_bridge() with the newer > > devm_drm_of_get_bridge() helper which simplifies the code by: > > - Automatically handling both panel and bridge cases internally > > - Managing the panel-to-bridge conversion when needed > > - Using devres for resource management, eliminating manual cleanup > > > > This removes the need for explicit panel-to-bridge conversion via > > devm_drm_panel_bridge_add_typed() and the associated error handling path. > > > > Signed-off-by: Kory Maincent (TI.com) <[email protected]> > > --- > > > > Change in v4: > > - New patch > > --- > > drivers/gpu/drm/tilcdc/tilcdc_encoder.c | 18 ++++-------------- > > 1 file changed, 4 insertions(+), 14 deletions(-) > > > > diff --git a/drivers/gpu/drm/tilcdc/tilcdc_encoder.c > > b/drivers/gpu/drm/tilcdc/tilcdc_encoder.c > > index a34a10337f6a8..546fe7e6ee815 100644 > > --- a/drivers/gpu/drm/tilcdc/tilcdc_encoder.c > > +++ b/drivers/gpu/drm/tilcdc/tilcdc_encoder.c > > @@ -55,15 +55,12 @@ int tilcdc_encoder_create(struct drm_device *ddev) > > struct tilcdc_drm_private *priv = ddev_to_tilcdc_priv(ddev); > > struct tilcdc_encoder *encoder; > > struct drm_bridge *bridge; > > - struct drm_panel *panel; > > - int ret; > > > > - ret = drm_of_find_panel_or_bridge(ddev->dev->of_node, 0, 0, > > - &panel, &bridge); > > - if (ret == -ENODEV) > > + bridge = devm_drm_of_get_bridge(ddev->dev, ddev->dev->of_node, 0, 0); > > + if (PTR_ERR(bridge) == -ENODEV) > > This patch is technically OK in the sense that the code before and after > would be equivalent. However if it were me I would not do this change. The > reason is that both drm_of_find_panel_or_bridge() and *_of_get_bridge() are > problematic when introducing drm_bridge hotplug, which is the long-term > goal I am working for, but *_of_get_bridge() is more problematic than > drm_of_find_panel_or_bridge(). > > These functions are still there and not deprecated because there is > currently no better replacement (and drm_bridge hotplug is not yet > supported because of this and other things still to be done). To have a > replacement, the panel_bridge lifetime needs to be reworked first and > that's not going to happen overnight. So, all in all, if this patch is not > crucial to your series I'd consider dropping it. But if it is important I'm > fine with applying it, it won't make a huge difference.
Eh. I'm fine either way. I understand what you're saying, but this patch doesn't introduce any *new* problem while it cleans up the driver, so I guess we could merge it still. And further clean it up with what you were suggesting later on. Maxime
signature.asc
Description: PGP signature
