0084-drm-sun4i-dsi-Allow-panel-attach-before-card-registr.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From bae2790f627eb30ec3845167341b108e13328f6f Mon Sep 17 00:00:00 2001
  2. From: Samuel Holland <[email protected]>
  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. Signed-off-by: Samuel Holland <[email protected]>
  7. ---
  8. drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 8 ++++----
  9. 1 file changed, 4 insertions(+), 4 deletions(-)
  10. --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
  11. +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
  12. @@ -967,13 +967,12 @@ static int sun6i_dsi_attach(struct mipi_
  13. if (IS_ERR(panel))
  14. return PTR_ERR(panel);
  15. - if (!dsi->drm || !dsi->drm->registered)
  16. - return -EPROBE_DEFER;
  17. dsi->panel = panel;
  18. dsi->device = device;
  19. - drm_kms_helper_hotplug_event(dsi->drm);
  20. + if (dsi->drm && dsi->drm->registered)
  21. + drm_kms_helper_hotplug_event(dsi->drm);
  22. dev_info(host->dev, "Attached device %s\n", device->name);
  23. @@ -988,7 +987,8 @@ static int sun6i_dsi_detach(struct mipi_
  24. dsi->panel = NULL;
  25. dsi->device = NULL;
  26. - drm_kms_helper_hotplug_event(dsi->drm);
  27. + if (dsi->drm && dsi->drm->registered)
  28. + drm_kms_helper_hotplug_event(dsi->drm);
  29. return 0;
  30. }