2019-02-26 08:12:16

by Peter Ujfalusi

[permalink] [raw]
Subject: [PATCH] drm/panel: simple: Fix panel_simple_dsi_probe

In case mipi_dsi_attach() fails remove the registered panel to avoid added
panel without corresponding device.

Signed-off-by: Peter Ujfalusi <[email protected]>
---
drivers/gpu/drm/panel/panel-simple.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

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)
--
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki



2019-04-23 11:58:51

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH] drm/panel: simple: Fix panel_simple_dsi_probe

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 <[email protected]>
> ---
> drivers/gpu/drm/panel/panel-simple.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)

Applied, thanks.

Thierry


Attachments:
(No filename) (387.00 B)
signature.asc (849.00 B)
Download all attachments