diff mbox series

[v2,2/2] drm: bridge: document bridge attach/detach imbalance

Message ID 20180806061910.29914-3-peda@axentia.se (mailing list archive)
State New, archived
Headers show
Series drm: fix some bridge api misunderstandings | expand

Commit Message

Peter Rosin Aug. 6, 2018, 6:19 a.m. UTC
Since 4a878c03d562 ("drm: bridge: Detach bridge from encoder at encoder
cleanup time"), it is generally no longer correct to detach bridges from
encoders manually. Document that.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/gpu/drm/drm_bridge.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Andrzej Hajda Sept. 13, 2018, 9:31 a.m. UTC | #1
On 06.08.2018 08:19, Peter Rosin wrote:
> Since 4a878c03d562 ("drm: bridge: Detach bridge from encoder at encoder
> cleanup time"), it is generally no longer correct to detach bridges from
> encoders manually. Document that.
>
> Signed-off-by: Peter Rosin <peda@axentia.se>
> ---
>  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 1638bfe9627c..ba7025041e46 100644
> --- a/drivers/gpu/drm/drm_bridge.c
> +++ b/drivers/gpu/drm/drm_bridge.c
> @@ -104,6 +104,10 @@ EXPORT_SYMBOL(drm_bridge_remove);
>   * If non-NULL the previous bridge must be already attached by a call to this
>   * function.
>   *
> + * Note that bridges attached to encoders are auto-detached during encoder
> + * cleanup in drm_encoder_cleanup(), so drm_bridge_attach() should generally
> + * *not* be balanced with a drm_bridge_detach() in driver code.
> + *
>   * RETURNS:
>   * Zero on success, error code on failure
>   */

Pushed to drm-misc-next.

--
Regards
Andrzej
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
index 1638bfe9627c..ba7025041e46 100644
--- a/drivers/gpu/drm/drm_bridge.c
+++ b/drivers/gpu/drm/drm_bridge.c
@@ -104,6 +104,10 @@  EXPORT_SYMBOL(drm_bridge_remove);
  * If non-NULL the previous bridge must be already attached by a call to this
  * function.
  *
+ * Note that bridges attached to encoders are auto-detached during encoder
+ * cleanup in drm_encoder_cleanup(), so drm_bridge_attach() should generally
+ * *not* be balanced with a drm_bridge_detach() in driver code.
+ *
  * RETURNS:
  * Zero on success, error code on failure
  */