[PATCH v5 03/11] drm/bridge: it6505: unregister DP AUX adapter on bridge detach

From: Daniel Golle

Date: Wed Jul 22 2026 - 12:13:00 EST


The DP AUX adapter is registered in .attach() but only unregistered
in i2c remove(). Unbinding and rebinding the DRM device while the
i2c driver stays bound registers the adapter a second time, which
fails. Unregister it in .detach() instead, and also on the .attach()
error path, which so far leaked the registration.

Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver")
Signed-off-by: Daniel Golle <daniel@xxxxxxxxxxxxxx>
---
v5: new patch

drivers/gpu/drm/bridge/ite-it6505.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c
index 6fcf2dc03d16..ff6471d3ef7a 100644
--- a/drivers/gpu/drm/bridge/ite-it6505.c
+++ b/drivers/gpu/drm/bridge/ite-it6505.c
@@ -3091,6 +3091,7 @@ static int it6505_bridge_attach(struct drm_bridge *bridge,
ret = it6505_use_notifier_module(it6505);
if (ret < 0) {
dev_err(dev, "use notifier module failed");
+ drm_dp_aux_unregister(&it6505->aux);
return ret;
}
}
@@ -3104,6 +3105,7 @@ static void it6505_bridge_detach(struct drm_bridge *bridge)

flush_work(&it6505->link_works);
it6505_remove_notifier_module(it6505);
+ drm_dp_aux_unregister(&it6505->aux);
}

static enum drm_mode_status
@@ -3652,7 +3654,6 @@ static void it6505_i2c_remove(struct i2c_client *client)
struct it6505 *it6505 = i2c_get_clientdata(client);

drm_bridge_remove(&it6505->bridge);
- drm_dp_aux_unregister(&it6505->aux);
it6505_debugfs_remove(it6505);
it6505_remove_notifier_module(it6505);
disable_irq(it6505->irq);
--
2.55.0