[PATCH v3 08/11] drm/connector: Warn if a connector is registered/added incorrectly
Jani Nikula
jani.nikula at linux.intel.com
Thu Dec 12 10:15:26 UTC 2024
On Thu, 12 Dec 2024, Imre Deak <imre.deak at intel.com> wrote:
> All the drivers should be converted now to use
> drm_connector_dynamic_init() for MST connectors, hence
> drm_connector_dynamic_register()->drm_connector_add() can WARN now if
> this was not the case (for instance if a driver inited an MST connector
> with one of the drm_connector_init*() functions incorrectly).
>
> Signed-off-by: Imre Deak <imre.deak at intel.com>
Reviewed-by: Jani Nikula <jani.nikula at intel.com>
> ---
> drivers/gpu/drm/drm_connector.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index c322dbf6e3161..1bd7407223fbb 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -330,11 +330,7 @@ static void drm_connector_add(struct drm_connector *connector)
> struct drm_device *dev = connector->dev;
> struct drm_mode_config *config = &dev->mode_config;
>
> - /*
> - * TODO: Change this to a WARN, once all drivers are converted to
> - * call drm_connector_dynamic_init() for MST connectors.
> - */
> - if (!list_empty(&connector->head))
> + if (drm_WARN_ON(dev, !list_empty(&connector->head)))
> return;
>
> spin_lock_irq(&config->connector_list_lock);
--
Jani Nikula, Intel
More information about the Intel-gfx
mailing list