diff options
| author | Luca Ceresoli <luca.ceresoli@bootlin.com> | 2025-12-16 18:58:34 +0100 |
|---|---|---|
| committer | Luca Ceresoli <luca.ceresoli@bootlin.com> | 2025-12-30 10:11:32 +0100 |
| commit | 293a8fd7721a90987d9bf149feab60e756dac269 (patch) | |
| tree | 14c064a35c49446715a1225a20f9ee7505282067 /include | |
| parent | 130343ee6bca9895c47d314467db7dd3dcc8bc35 (diff) | |
drm/bridge: add of_drm_find_and_get_bridge()
of_drm_find_bridge() does not increment the refcount for the returned
bridge, but that is required now. However converting it and all its users
is not realistically doable at once given the large amount of (direct and
indirect) callers and the complexity of some.
Solve this issue by creating a new of_drm_find_and_get_bridge() function
that is identical to of_drm_find_bridge() except also it takes a
reference. Then of_drm_find_bridge() will be deprecated to be eventually
removed.
Suggested-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/dri-devel/20250319-stylish-lime-mongoose-0a18ad@houat/
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://patch.msgid.link/20251216-drm-bridge-alloc-getput-drm_of_find_bridge-v3-1-b5165fab8058@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/drm/drm_bridge.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index 68b9da1eb542..42ec33116d18 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -1326,8 +1326,13 @@ int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge, enum drm_bridge_attach_flags flags); #ifdef CONFIG_OF +struct drm_bridge *of_drm_find_and_get_bridge(struct device_node *np); struct drm_bridge *of_drm_find_bridge(struct device_node *np); #else +static inline struct drm_bridge *of_drm_find_and_get_bridge(struct device_node *np) +{ + return NULL; +} static inline struct drm_bridge *of_drm_find_bridge(struct device_node *np) { return NULL; |
