Skip to contentSkip to conversation

drm/bridge: anx6345: Power off the bridge on removal

PATCH New Myeonghun Pak 1 participant 1 message Sep 13

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/bridge: anx6345: Power off the bridge on removal

The probe callback powers on the bridge to read its chip ID and leaves it powered on when the ID check succeeds. This enables both regulators and prepares the optional panel. If the device is removed before the bridge disable callback runs, these resources remain active after removal.

Power off the bridge in the remove callback before unregistering its I2C dummy clients. Check the powered flag first to avoid disabling regulators again when the bridge disable callback has already powered it off.

This issue was identified during our ongoing static-analysis research while reviewing kernel code.

Fixes 6aa192698089 ("drm/bridge: Add Analogix anx6345 support")
Assisted-by OpenAI:GPT-5.6

---
Validated with an ARM64 W=1 object build and strict checkpatch. No hardware runtime or active-display unbind testing was performed.

 drivers/gpu/drm/bridge/analogix/analogix-anx6345.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/bridge/analogix/analogix-anx6345.c +3 -0
index 407834a03b638991a5a7a4c64dbe3263bfd0d8a9..43c02f312a46593bfe4a0c46f06940006ee566b6 100644
@@ -775,6 +775,9 @@ static void anx6345_i2c_remove(struct i2c_client *client)
 
 	drm_bridge_remove(&anx6345->bridge);
 
+	if (anx6345->powered)
+		anx6345_poweroff(anx6345);
+
 	unregister_i2c_dummy_clients(anx6345);
 
 	drm_edid_free(anx6345->drm_edid);