d1: add new target
[openwrt/staging/mans0n.git] / target / linux / d1 / patches-6.1 / 0084-drm-sun4i-dsi-Allow-panel-attach-before-card-registr.patch
1 From bae2790f627eb30ec3845167341b108e13328f6f Mon Sep 17 00:00:00 2001
2 From: Samuel Holland <samuel@sholland.org>
3 Date: Sun, 7 Aug 2022 10:46:43 -0500
4 Subject: [PATCH 084/117] drm/sun4i: dsi: Allow panel attach before card
5 registration
6
7 Signed-off-by: Samuel Holland <samuel@sholland.org>
8 ---
9 drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 8 ++++----
10 1 file changed, 4 insertions(+), 4 deletions(-)
11
12 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
13 +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
14 @@ -967,13 +967,12 @@ static int sun6i_dsi_attach(struct mipi_
15
16 if (IS_ERR(panel))
17 return PTR_ERR(panel);
18 - if (!dsi->drm || !dsi->drm->registered)
19 - return -EPROBE_DEFER;
20
21 dsi->panel = panel;
22 dsi->device = device;
23
24 - drm_kms_helper_hotplug_event(dsi->drm);
25 + if (dsi->drm && dsi->drm->registered)
26 + drm_kms_helper_hotplug_event(dsi->drm);
27
28 dev_info(host->dev, "Attached device %s\n", device->name);
29
30 @@ -988,7 +987,8 @@ static int sun6i_dsi_detach(struct mipi_
31 dsi->panel = NULL;
32 dsi->device = NULL;
33
34 - drm_kms_helper_hotplug_event(dsi->drm);
35 + if (dsi->drm && dsi->drm->registered)
36 + drm_kms_helper_hotplug_event(dsi->drm);
37
38 return 0;
39 }