[PATCH v9 3/5] drm/bridge: make devm_drm_bridge_alloc() mandatory for bridge allocation

Luca Ceresoli luca.ceresoli at bootlin.com
Wed Mar 26 10:47:37 PDT 2025


All DRM bridges are now supposed to be allocated using
devm_drm_bridge_alloc(), which is cleaner and necessary to support
refcounting.

In the absence of a drm_bridge_init() or such initialization function,
document the new mandatory alloc function on the first DRM bridge core
function that is called after allocation, i.e. drm_bridge_add().

Suggested-by: Maxime Ripard <mripard at kernel.org>
Signed-off-by: Luca Ceresoli <luca.ceresoli at bootlin.com>

---

Changes in v9:
- remove sentence about old-style allocation

This patch was added in v8.
---
 drivers/gpu/drm/drm_bridge.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
index 22b459af112fd3cd2db00aa16668d270e028b307..b4c89ec01998b849018ce031c7cd84614e65e710 100644
--- a/drivers/gpu/drm/drm_bridge.c
+++ b/drivers/gpu/drm/drm_bridge.c
@@ -286,6 +286,9 @@ EXPORT_SYMBOL(__devm_drm_bridge_alloc);
  * drm_bridge_add - add the given bridge to the global bridge list
  *
  * @bridge: bridge control structure
+ *
+ * The bridge to be added must have been allocated by
+ * devm_drm_bridge_alloc().
  */
 void drm_bridge_add(struct drm_bridge *bridge)
 {

-- 
2.49.0




More information about the linux-arm-kernel mailing list