diff mbox series

drm/panel: simple: Fix panel_simple_dsi_probe

Message ID 20190226081153.31334-1-peter.ujfalusi@ti.com (mailing list archive)
State New, archived
Headers show
Series drm/panel: simple: Fix panel_simple_dsi_probe | expand

Commit Message

Peter Ujfalusi Feb. 26, 2019, 8:11 a.m. UTC
In case mipi_dsi_attach() fails remove the registered panel to avoid added
panel without corresponding device.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 drivers/gpu/drm/panel/panel-simple.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Thierry Reding April 23, 2019, 11:57 a.m. UTC | #1
On Tue, Feb 26, 2019 at 10:11:53AM +0200, Peter Ujfalusi wrote:
> In case mipi_dsi_attach() fails remove the registered panel to avoid added
> panel without corresponding device.
> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> ---
>  drivers/gpu/drm/panel/panel-simple.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)

Applied, thanks.

Thierry
diff mbox series

Patch

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index 0337583ffa49..90b4e75381e2 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -3072,7 +3072,14 @@  static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
 	dsi->format = desc->format;
 	dsi->lanes = desc->lanes;
 
-	return mipi_dsi_attach(dsi);
+	err = mipi_dsi_attach(dsi);
+	if (err) {
+		struct panel_simple *panel = dev_get_drvdata(&dsi->dev);
+
+		drm_panel_remove(&panel->base);
+	}
+
+	return err;
 }
 
 static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)