diff mbox series

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

Message ID 20250326-drm-bridge-refcount-v9-3-5e0661fe1f84@bootlin.com (mailing list archive)
State New
Headers show
Series drm/bridge: add devm_drm_bridge_alloc() with bridge refcount | expand

Commit Message

Luca Ceresoli March 26, 2025, 5:47 p.m. UTC
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@kernel.org>
Signed-off-by: Luca Ceresoli <luca.ceresoli@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(+)

Comments

Maxime Ripard March 27, 2025, 1:46 p.m. UTC | #1
On Wed, 26 Mar 2025 18:47:37 +0100, Luca Ceresoli wrote:
> 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,
> 
> [ ... ]

Reviewed-by: Maxime Ripard <mripard@kernel.org>

Thanks!
Maxime
diff mbox series

Patch

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)
 {