[PATCH 1/1] drm/sti: fix master bind bug for using component

Xinwei Kong kong.kongxinwei at hisilicon.com
Tue Jul 14 02:28:40 PDT 2015


From: Xinwei Kong <kong.kongxinwei at hisilicon.com>

This patch fix one bug which it can't call .bind function in
sti_hdmi.c and sti_hda.c file when changing the building sequence
(sti_hdmi.o,sti_hda.o) in Makefile file. This patch can prepare
it.

Signed-off-by: Xinwei Kong <kong.kongxinwei at hisilicon.com>
---
 drivers/gpu/drm/sti/sti_tvout.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c
index 5cc5311..293dfae 100644
--- a/drivers/gpu/drm/sti/sti_tvout.c
+++ b/drivers/gpu/drm/sti/sti_tvout.c
@@ -683,7 +683,22 @@ static int compare_of(struct device *dev, void *data)

 static int sti_tvout_master_bind(struct device *dev)
 {
-	return 0;
+	struct sti_tvout *tvout = dev_get_drvdata(dev);
+	struct drm_device *drm_dev;
+	int ret;
+
+	if (!tvout->drm_dev) {
+		DRM_ERROR("master bind is fail\n");
+		return 0;
+	}
+
+	drm_dev = tvout->drm_dev;
+
+	ret = component_bind_all(dev, drm_dev);
+	if (ret)
+		sti_tvout_destroy_encoders(tvout);
+
+	return ret;
 }

 static void sti_tvout_master_unbind(struct device *dev)
-- 
1.9.1



More information about the dri-devel mailing list