summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2023-05-22 17:22:49 +0300
committerFrancesco Dolcini <francesco.dolcini@toradex.com>2023-06-19 15:54:11 +0200
commit9a757188e1ff31e54c749d0656e3048a66467a33 (patch)
treec53534bc11104b75aa5c52a61651cf3f1b4a2039
parent34a7716e046916220534baff7ec73341bf355aa6 (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.c16
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(&lt->connector);
- drm_connector_cleanup(&lt->connector);
- }
+ drm_connector_unregister(&lt->connector);
+ drm_connector_cleanup(&lt->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(&lt->bridge);
drm_bridge_remove(&lt->bridge);
lt8912_free_i2c(lt);
lt8912_put_dt(lt);