summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2019-02-26 10:11:53 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-31 07:24:28 +0200
commit68953ae09cbd1b01e88a6af8d15d2c6b42d7aafa (patch)
tree8f70ca9f9e5c828c073a721a7319a9786fba5ae1
parent36a66cd28e40c5836e544bf3291c79908ba91ed8 (diff)
downloadlinux-stable-68953ae09cbd1b01e88a6af8d15d2c6b42d7aafa.tar.gz
linux-stable-68953ae09cbd1b01e88a6af8d15d2c6b42d7aafa.tar.bz2
linux-stable-68953ae09cbd1b01e88a6af8d15d2c6b42d7aafa.zip
drm/panel: simple: Fix panel_simple_dsi_probe
[ Upstream commit 7ad9db66fafb0f0ad53fd2a66217105da5ddeffe ] 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> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190226081153.31334-1-peter.ujfalusi@ti.com Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/gpu/drm/panel/panel-simple.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index 569be4efd8d1..48e2fa7bbe48 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -3098,7 +3098,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)