[PATCH v2 8/8] drm: bridge: anx7625: Switch to devm_drm_of_get_bridge
Jagan Teki
jagan at amarulasolutions.com
Wed Mar 2 04:23:40 UTC 2022
On Wed, Mar 2, 2022 at 4:43 AM Linus Walleij <linus.walleij at linaro.org> wrote:
>
> On Tue, Mar 1, 2022 at 3:13 PM Jagan Teki <jagan at amarulasolutions.com> wrote:
>
> > devm_drm_of_get_bridge is capable of looking up the downstream
> > bridge and panel and trying to add a panel bridge if the panel
> > is found.
> >
> > Replace explicit finding calls with devm_drm_of_get_bridge.
> >
> > Cc: Linus Walleij <linus.walleij at linaro.org>
> > Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
> > ---
> > Changes for v2:
> > - split the patch
>
> This will be nice code reduction when it works!
>
> > - struct drm_panel *panel = NULL;
> > - struct drm_bridge *bridge = NULL;
> > + struct drm_bridge *bridge;
>
> OK... and then you delete the code that uses panel. But:
>
> static void mcde_dsi_unbind(struct device *dev, struct device *master,
> void *data)
> {
> struct mcde_dsi *d = dev_get_drvdata(dev);
>
> if (d->panel)
> drm_panel_bridge_remove(d->bridge_out);
I think using drm_bridge_remove(d->bridge_out); will directly remove
the bridge whether it is the next bridge or panel bridge as bridge_out
is already found the relevant downstream.
Jagan.
More information about the dri-devel
mailing list