All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/exynos: mic: add a bridge at probe
       [not found] <CGME20170705081842epcas1p46d9f6868ad2f25712c8d41ae6ecd0358@epcas1p4.samsung.com>
@ 2017-07-05  8:18 ` Inki Dae
  2017-07-05  9:40   ` Hoegeun Kwon
  0 siblings, 1 reply; 2+ messages in thread
From: Inki Dae @ 2017-07-05  8:18 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-samsung-soc

This patch moves drm_bridge_add call into probe.

It doesn't need to call drm_bridge_add call every time
bind callback is called.

Changelog v2
- moved drm_bridge_remove call into remove callback.
- corrected description.

Suggested-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_mic.c | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c
index e457205..16bbee8 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_mic.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c
@@ -340,16 +340,10 @@ static int exynos_mic_bind(struct device *dev, struct device *master,
 			   void *data)
 {
 	struct exynos_mic *mic = dev_get_drvdata(dev);
-	int ret;
 
-	mic->bridge.funcs = &mic_bridge_funcs;
-	mic->bridge.of_node = dev->of_node;
 	mic->bridge.driver_private = mic;
-	ret = drm_bridge_add(&mic->bridge);
-	if (ret)
-		DRM_ERROR("mic: Failed to add MIC to the global bridge list\n");
 
-	return ret;
+	return 0;
 }
 
 static void exynos_mic_unbind(struct device *dev, struct device *master,
@@ -365,8 +359,6 @@ static void exynos_mic_unbind(struct device *dev, struct device *master,
 
 already_disabled:
 	mutex_unlock(&mic_mutex);
-
-	drm_bridge_remove(&mic->bridge);
 }
 
 static const struct component_ops exynos_mic_component_ops = {
@@ -461,6 +453,15 @@ static int exynos_mic_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, mic);
 
+	mic->bridge.funcs = &mic_bridge_funcs;
+	mic->bridge.of_node = dev->of_node;
+
+	ret = drm_bridge_add(&mic->bridge);
+	if (ret) {
+		DRM_ERROR("mic: Failed to add MIC to the global bridge list\n");
+		return ret;
+	}
+
 	pm_runtime_enable(dev);
 
 	ret = component_add(dev, &exynos_mic_component_ops);
@@ -479,8 +480,13 @@ static int exynos_mic_probe(struct platform_device *pdev)
 
 static int exynos_mic_remove(struct platform_device *pdev)
 {
+	struct exynos_mic *mic = platform_get_drvdata(pdev);
+
 	component_del(&pdev->dev, &exynos_mic_component_ops);
 	pm_runtime_disable(&pdev->dev);
+
+	drm_bridge_remove(&mic->bridge);
+
 	return 0;
 }
 
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] drm/exynos: mic: add a bridge at probe
  2017-07-05  8:18 ` [PATCH v2] drm/exynos: mic: add a bridge at probe Inki Dae
@ 2017-07-05  9:40   ` Hoegeun Kwon
  0 siblings, 0 replies; 2+ messages in thread
From: Hoegeun Kwon @ 2017-07-05  9:40 UTC (permalink / raw)
  To: Inki Dae, dri-devel; +Cc: linux-samsung-soc


[-- Attachment #1.1: Type: text/plain, Size: 508 bytes --]

On 07/05/2017 05:18 PM, Inki Dae wrote:
> This patch moves drm_bridge_add call into probe.
>
> It doesn't need to call drm_bridge_add call every time
> bind callback is called.
>
> Changelog v2
> - moved drm_bridge_remove call into remove callback.
> - corrected description.
>
> Suggested-by: Andrzej Hajda <a.hajda@samsung.com>
> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
> Signed-off-by: Inki Dae <inki.dae@samsung.com>

Reviewed-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>

Best regards,
Hoegeun


[-- Attachment #1.2: Type: text/html, Size: 1175 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-05  9:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20170705081842epcas1p46d9f6868ad2f25712c8d41ae6ecd0358@epcas1p4.samsung.com>
2017-07-05  8:18 ` [PATCH v2] drm/exynos: mic: add a bridge at probe Inki Dae
2017-07-05  9:40   ` Hoegeun Kwon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.