[PATCH v4 03/15] drm/bridge: tc358764: drop drm_connector_(un)register

Andrzej Hajda a.hajda at samsung.com
Wed Sep 2 16:48:35 UTC 2020


Hi Sam,

On 26.07.2020 22:33, Sam Ravnborg wrote:
> Drop drm_connector handling that is not needed:
>
> - drm_dev_register() in the display controller driver takes
>    care of registering connectors.
>    So the call to drm_connector_register() call is not needed in the bridge
>    driver.
>
> - Use of drm_connector_unregister() is only required for drivers that
>    explicit have called drm_dev_register.
>
> - The reference counting using drm_connector_put() is likewise not needed.


All three statements above are true in case of statically allocated 
connectors.

Here the connector is allocated dynamically, so it must be 
registered/deregistered by the driver itself.


Regards

Andrzej


>
> Signed-off-by: Sam Ravnborg <sam at ravnborg.org>
> Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> Cc: Andrzej Hajda <a.hajda at samsung.com>
> Cc: Neil Armstrong <narmstrong at baylibre.com>
> Cc: Laurent Pinchart <Laurent.pinchart at ideasonboard.com>
> Cc: Jonas Karlman <jonas at kwiboo.se>
> Cc: Jernej Skrabec <jernej.skrabec at siol.net>
> ---
>   drivers/gpu/drm/bridge/tc358764.c | 3 ---
>   1 file changed, 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/tc358764.c b/drivers/gpu/drm/bridge/tc358764.c
> index 5ac1430fab04..a277739fab58 100644
> --- a/drivers/gpu/drm/bridge/tc358764.c
> +++ b/drivers/gpu/drm/bridge/tc358764.c
> @@ -375,7 +375,6 @@ static int tc358764_attach(struct drm_bridge *bridge,
>   	drm_connector_attach_encoder(&ctx->connector, bridge->encoder);
>   	drm_panel_attach(ctx->panel, &ctx->connector);
>   	ctx->connector.funcs->reset(&ctx->connector);
> -	drm_connector_register(&ctx->connector);
>   	return 0;
>   }
> @@ -384,10 +383,8 @@ static void tc358764_detach(struct drm_bridge *bridge)
>   {
>   	struct tc358764 *ctx = bridge_to_tc358764(bridge);
>   
> -	drm_connector_unregister(&ctx->connector);
>   	drm_panel_detach(ctx->panel);
>   	ctx->panel = NULL;
> -	drm_connector_put(&ctx->connector);
>   }
>   
>   static const struct drm_bridge_funcs tc358764_bridge_funcs = {


More information about the dri-devel mailing list