diff options
author | Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> | 2023-05-22 17:22:49 +0300 |
---|---|---|
committer | Francesco Dolcini <francesco.dolcini@toradex.com> | 2023-06-19 15:54:11 +0200 |
commit | 9a757188e1ff31e54c749d0656e3048a66467a33 (patch) | |
tree | c53534bc11104b75aa5c52a61651cf3f1b4a2039 | |
parent | 34a7716e046916220534baff7ec73341bf355aa6 (diff) |
drm/bridge: lt8912b: Fix bridge_detach
The driver calls lt8912_bridge_detach() from its lt8912_remove()
function. As the DRM code detaches bridges automatically, this leads to
a double detach and a crash.
Fix the issue by dropping the call to lt8912_bridge_detach() from
lt8912_remove(), and also drop the useless is_attached field.
Upstream-Status: Pending
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
-rw-r--r-- | drivers/gpu/drm/bridge/lontium-lt8912b.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c index 71f58e084fc2..b235e1f38306 100644 --- a/drivers/gpu/drm/bridge/lontium-lt8912b.c +++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c @@ -43,7 +43,6 @@ struct lt8912 { u8 data_lanes; bool is_power_on; - bool is_attached; }; static int lt8912_write_init_config(struct lt8912 *lt) @@ -571,8 +570,6 @@ static int lt8912_bridge_attach(struct drm_bridge *bridge, if (ret) goto error; - lt->is_attached = true; - return 0; error: @@ -584,15 +581,13 @@ static void lt8912_bridge_detach(struct drm_bridge *bridge) { struct lt8912 *lt = bridge_to_lt8912(bridge); - if (lt->is_attached) { - lt8912_hard_power_off(lt); + lt8912_hard_power_off(lt); - if (lt->hdmi_port->ops & DRM_BRIDGE_OP_HPD) - drm_bridge_hpd_disable(lt->hdmi_port); + if (lt->hdmi_port->ops & DRM_BRIDGE_OP_HPD) + drm_bridge_hpd_disable(lt->hdmi_port); - drm_connector_unregister(<->connector); - drm_connector_cleanup(<->connector); - } + drm_connector_unregister(<->connector); + drm_connector_cleanup(<->connector); } static enum drm_connector_status @@ -752,7 +747,6 @@ static int lt8912_remove(struct i2c_client *client) { struct lt8912 *lt = i2c_get_clientdata(client); - lt8912_bridge_detach(<->bridge); drm_bridge_remove(<->bridge); lt8912_free_i2c(lt); lt8912_put_dt(lt); |