[PATCH v2 8/8] drm: bridge: anx7625: Switch to devm_drm_of_get_bridge

Linus Walleij linus.walleij at linaro.org
Tue Mar 1 23:12:55 UTC 2022


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);
        regmap_update_bits(d->prcmu, PRCM_DSI_SW_RESET,
                           PRCM_DSI_SW_RESET_DSI0_SW_RESETN, 0);
}

So this will not even compile.

I suppose you have a solution for removing the panel bridge automatically
as well?

Yours,
Linus Walleij


More information about the dri-devel mailing list