drm/panel: ili9881c: remove panel on DSI attach failure
Subsystems (3)
PATCH 1/1 drm/panel: ili9881c: remove panel on DSI attach failure
The probe path calls drm_panel_add() before mipi_dsi_attach().
If mipi_dsi_attach() fails, the driver returns without calling
drm_panel_remove(), leaving the panel registered in the global DRM panel list. The driver's .remove() callback does not handle this case because failed probe does not transition through the normal bound-device removal path.
Fix this by unwinding drm_panel_add() when mipi_dsi_attach() fails.
Co-developed-by Ijae Kim <[email protected]>
Signed-off-by Ijae Kim <[email protected]>
Co-developed-by Taegyu Kim <[email protected]>
Signed-off-by Taegyu Kim <[email protected]>
Co-developed-by Yuho Choi <[email protected]>
Signed-off-by Yuho Choi <[email protected]>
Signed-off-by Myeonghun Pak <[email protected]>
--- drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-ilitek-ili9881c.c +7 -1
@@ -2359,7 +2359,13 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi) dsi->format =MIPI_DSI_FMT_RGB888 ; dsi->lanes = ctx->desc->lanes; -return mipi_dsi_attach (dsi); + ret =mipi_dsi_attach (dsi); +if (ret) { +drm_panel_remove (&ctx->panel); +return ret; + } + +return 0 ; }static void ili9881c_dsi_remove (struct mipi_dsi_device *dsi)
Signature · 1 line
2.47.1