diff mbox

[2/2] drm/exynos: fimd: check error status for drm_iommu_attach_device

Message ID 1417953876-28266-2-git-send-email-ajaykumar.rs@samsung.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Ajay Kumar Dec. 7, 2014, 12:04 p.m. UTC
check error status for drm_iommu_attach_device() and make sure
it propagates till the caller.

Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 157f4dd..a53d35b 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -294,6 +294,8 @@  static int fimd_mgr_initialize(struct exynos_drm_manager *mgr,
 {
 	struct fimd_context *ctx = mgr_to_fimd(mgr);
 	struct exynos_drm_private *priv;
+	int ret;
+
 	priv = drm_dev->dev_private;
 
 	mgr->drm_dev = drm_dev;
@@ -306,7 +308,12 @@  static int fimd_mgr_initialize(struct exynos_drm_manager *mgr,
 		 * a PAGE FAULT when enabled. So clear any channel if enabled.
 		 */
 		fimd_clear_channel(mgr);
-		drm_iommu_attach_device(mgr->drm_dev, ctx->dev);
+
+		ret = drm_iommu_attach_device(mgr->drm_dev, ctx->dev);
+		if (ret) {
+			DRM_ERROR("drm_iommu_attach failed.\n");
+			return ret;
+		}
 	}
 
 	return 0;
@@ -1074,8 +1081,14 @@  static int fimd_bind(struct device *dev, struct device *master, void *data)
 {
 	struct fimd_context *ctx = dev_get_drvdata(dev);
 	struct drm_device *drm_dev = data;
+	int ret;
+
+	ret = fimd_mgr_initialize(&ctx->manager, drm_dev);
+	if (ret) {
+		DRM_ERROR("fimd_mgr_initialize failed.\n");
+		return ret;
+	}
 
-	fimd_mgr_initialize(&ctx->manager, drm_dev);
 	exynos_drm_crtc_create(&ctx->manager);
 	if (ctx->display)
 		exynos_drm_create_enc_conn(drm_dev, ctx->display);