diff options
| author | Luca Ceresoli <luca.ceresoli@bootlin.com> | 2025-05-09 15:53:46 +0200 |
|---|---|---|
| committer | Luca Ceresoli <luca.ceresoli@bootlin.com> | 2025-05-21 13:40:09 +0200 |
| commit | 5164553d739ef45b2c69c8cfe88b9ef26c9a0035 (patch) | |
| tree | 0bdbf1a41170ace45d65d6d577e36a08469a0fe2 /include/drm/drm_bridge.h | |
| parent | afb903c01b2b7af382392024fb02bbfea62696f7 (diff) | |
| download | linux-5164553d739ef45b2c69c8cfe88b9ef26c9a0035.tar.gz linux-5164553d739ef45b2c69c8cfe88b9ef26c9a0035.tar.bz2 linux-5164553d739ef45b2c69c8cfe88b9ef26c9a0035.zip | |
drm/bridge: add devm_drm_put_bridge()
Bridges obtained via devm_drm_bridge_alloc(dev, ...) will be put when the
requesting device (@dev) is removed.
However drivers which obtained them may need to put the obtained reference
explicitly. One such case is if they bind the devm removal action to a
different device than the one implemented by the driver itself and which
might be removed at a different time, such as bridge/panel.c.
Add devm_drm_put_bridge() to manually release a devm-obtained bridge in
such cases.
This function is considered only a temporary workaround until the panel
bridge is reworked and should be removed afterwards.
Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250509-drm-bridge-convert-to-alloc-api-v3-20-b8bc1f16d7aa@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Diffstat (limited to 'include/drm/drm_bridge.h')
| -rw-r--r-- | include/drm/drm_bridge.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index cc9f7df38102..464da28f9134 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -1311,6 +1311,8 @@ static inline struct drm_bridge *devm_drm_of_get_bridge(struct device *dev, return ERR_PTR(-ENODEV); } +static inline void devm_drm_put_bridge(struct device *dev, struct drm_bridge *bridge) {} + static inline struct drm_bridge *drmm_of_get_bridge(struct drm_device *drm, struct device_node *node, u32 port, @@ -1320,6 +1322,8 @@ static inline struct drm_bridge *drmm_of_get_bridge(struct drm_device *drm, } #endif +void devm_drm_put_bridge(struct device *dev, struct drm_bridge *bridge); + void drm_bridge_debugfs_params(struct dentry *root); void drm_bridge_debugfs_encoder_params(struct dentry *root, struct drm_encoder *encoder); |
