[PATCH v8 3/5] drm/bridge: deprecate old-style bridge allocation

From: Luca Ceresoli
Date: Thu Mar 20 2025 - 11:43:45 EST


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

Deprecate old school allocation using kzalloc and derivatives. In the
absence of a drm_bridge_init() or such initialization function, document
the deprecation on the first DRM bridge core function that is called after
allocation, i.e. drm_bridge_add().

Suggested-by: Maxime Ripard <mripard@xxxxxxxxxx>
Signed-off-by: Luca Ceresoli <luca.ceresoli@xxxxxxxxxxx>

---

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

diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
index 2f2ecb73308e601b1a53ec8e7110933cef59b5da..17659b1cbdeae04e10b76f2aabc8ebba65c4f6e1 100644
--- a/drivers/gpu/drm/drm_bridge.c
+++ b/drivers/gpu/drm/drm_bridge.c
@@ -295,6 +295,10 @@ 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(). Old-style allocation by kzalloc(),
+ * devm_kzalloc() and similar is deprecated.
*/
void drm_bridge_add(struct drm_bridge *bridge)
{

--
2.48.1