Skip to content

Commit 04e10d0

Browse files
committed
drm/connector: Warn if a connector is registered/added incorrectly
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). Reviewed-by: Lyude Paul <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Acked-by: Alex Deucher <[email protected]> Acked-by: Wayne Lin <[email protected]> Signed-off-by: Imre Deak <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 5a83c92 commit 04e10d0

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

drivers/gpu/drm/drm_connector.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,7 @@ static void drm_connector_add(struct drm_connector *connector)
331331
struct drm_device *dev = connector->dev;
332332
struct drm_mode_config *config = &dev->mode_config;
333333

334-
/*
335-
* TODO: Change this to a WARN, once all drivers are converted to
336-
* call drm_connector_dynamic_init() for MST connectors.
337-
*/
338-
if (!list_empty(&connector->head))
334+
if (drm_WARN_ON(dev, !list_empty(&connector->head)))
339335
return;
340336

341337
spin_lock_irq(&config->connector_list_lock);

0 commit comments

Comments
 (0)