aboutsummaryrefslogtreecommitdiff
path: root/target/linux/d1/patches-6.1/0084-drm-sun4i-dsi-Allow-panel-attach-before-card-registr.patch
blob: e74ea35e5a7602a2e0fce578c76aade87a24bd5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From bae2790f627eb30ec3845167341b108e13328f6f Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sun, 7 Aug 2022 10:46:43 -0500
Subject: [PATCH 084/117] drm/sun4i: dsi: Allow panel attach before card
 registration

Signed-off-by: Samuel Holland <samuel@sholland.org>
---
 drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
+++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
@@ -967,13 +967,12 @@ static int sun6i_dsi_attach(struct mipi_
 
 	if (IS_ERR(panel))
 		return PTR_ERR(panel);
-	if (!dsi->drm || !dsi->drm->registered)
-		return -EPROBE_DEFER;
 
 	dsi->panel = panel;
 	dsi->device = device;
 
-	drm_kms_helper_hotplug_event(dsi->drm);
+	if (dsi->drm && dsi->drm->registered)
+		drm_kms_helper_hotplug_event(dsi->drm);
 
 	dev_info(host->dev, "Attached device %s\n", device->name);
 
@@ -988,7 +987,8 @@ static int sun6i_dsi_detach(struct mipi_
 	dsi->panel = NULL;
 	dsi->device = NULL;
 
-	drm_kms_helper_hotplug_event(dsi->drm);
+	if (dsi->drm && dsi->drm->registered)
+		drm_kms_helper_hotplug_event(dsi->drm);
 
 	return 0;
 }