From: Luca Ceresoli Date: Tue, 28 Oct 2025 10:15:44 +0000 (+0100) Subject: drm/bridge: document that adding a bridge is mandatory before attach X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f8b460262a28060be932078e2b8d9fb8bf99dcf6;p=thirdparty%2Fkernel%2Flinux.git drm/bridge: document that adding a bridge is mandatory before attach At the moment it's not documented that you need to add a bridge before attaching it. Clarify that. Suggested-by: Maxime Ripard Link: https://lore.kernel.org/all/20250709-sophisticated-loon-of-rain-6ccdd8@houat/ Reviewed-by: Raphael Gallais-Pou Reviewed-by: Maxime Ripard Link: https://patch.msgid.link/20251028-b4-drm-bridge-alloc-add-before-attach-v3-3-bb8611acbbfb@bootlin.com Signed-off-by: Luca Ceresoli --- diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 53e7ece36dd94..1246a52f8767b 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -422,6 +422,9 @@ static bool drm_bridge_is_atomic(struct drm_bridge *bridge) * If non-NULL the previous bridge must be already attached by a call to this * function. * + * The bridge to be attached must have been previously added by + * drm_bridge_add(). + * * Note that bridges attached to encoders are auto-detached during encoder * cleanup in drm_encoder_cleanup(), so drm_bridge_attach() should generally * *not* be balanced with a drm_bridge_detach() in driver code.