Skip to contentSkip to conversation

drm/bridge/synopsys: dsi: check post disable

PATCH In review Yannick Fertre 2 participants 2 messages Nov 27, 2019

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

PATCH 1/1 drm/bridge/synopsys: dsi: check post disable

From: Yannick Fertré <[email protected]>

Some bridges did not registered the post_disable function. To avoid a crash, check it before calling.

---
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +2 -1
index cc806ba..1e37233 100644
@@ -886,7 +886,8 @@ static void dw_mipi_dsi_bridge_post_disable(struct drm_bridge *bridge)
 	 * This needs to be fixed in the drm_bridge framework and the API
 	 * needs to be updated to manage our own call chains...
 	 */
-	dsi->panel_bridge->funcs->post_disable(dsi->panel_bridge);
+	if (dsi->panel_bridge->funcs->post_disable)
+		dsi->panel_bridge->funcs->post_disable(dsi->panel_bridge);
 
 	if (dsi->slave) {
 		dw_mipi_dsi_disable(dsi->slave);
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Yannick Fertre

From: Yannick Fertré <[email protected]>

Some bridges did not registered the post_disable function. To avoid a crash, check it before calling.

Quoted 21 lines
---
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +2 -1
index cc806ba..1e37233 100644
@@ -886,7 +886,8 @@ static void dw_mipi_dsi_bridge_post_disable(struct drm_bridge *bridge)
 	 * This needs to be fixed in the drm_bridge framework and the API
 	 * needs to be updated to manage our own call chains...
 	 */
-	dsi->panel_bridge->funcs->post_disable(dsi->panel_bridge);
+	if (dsi->panel_bridge->funcs->post_disable)
+		dsi->panel_bridge->funcs->post_disable(dsi->panel_bridge);
 
 	if (dsi->slave) {
 		dw_mipi_dsi_disable(dsi->slave);
Signature · 1 line
2.7.4
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch