diff mbox series

[10/16] drm/exynos: move dsi host registration to probe helper

Message ID 20200903165717.1272492-11-m.tretter@pengutronix.de
State New
Headers show
Series drm/exynos: Convert driver to drm bridge | expand

Commit Message

Michael Tretter Sept. 3, 2020, 4:57 p.m. UTC
The bind/unbind API will be only used with the component framework, but
the mipi dsi host is always required. Therefore, move it to the shared
probe helper function.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
 drivers/gpu/drm/exynos/exynos_drm_dsi.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
index 7485097472dc..3bf4ae0fe6cc 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
@@ -1768,7 +1768,7 @@  static int exynos_dsi_bind(struct device *dev, struct device *master,
 	if (ret)
 		return ret;
 
-	return mipi_dsi_host_register(&dsi->dsi_host);
+	return 0;
 }
 
 static void exynos_dsi_unbind(struct device *dev, struct device *master,
@@ -1779,8 +1779,6 @@  static void exynos_dsi_unbind(struct device *dev, struct device *master,
 	exynos_dsi_disable(dsi);
 
 	__exynos_dsi_remove(dsi);
-
-	mipi_dsi_host_unregister(&dsi->dsi_host);
 }
 
 static const struct component_ops exynos_dsi_component_ops = {
@@ -1878,6 +1876,10 @@  static struct exynos_dsi *__exynos_dsi_probe(struct platform_device *pdev)
 
 	pm_runtime_enable(dev);
 
+	ret = mipi_dsi_host_register(&dsi->dsi_host);
+	if (ret)
+		return ERR_PTR(ret);
+
 	bridge = &dsi->bridge;
 	bridge->driver_private = dsi;
 	bridge->funcs = &exynos_dsi_bridge_funcs;
@@ -1892,6 +1894,8 @@  static void __exynos_dsi_remove(struct exynos_dsi *dsi)
 {
 	drm_bridge_remove(&dsi->bridge);
 
+	mipi_dsi_host_unregister(&dsi->dsi_host);
+
 	pm_runtime_disable(dsi->dev);
 }