diff mbox

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

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

Commit Message

Ajay Kumar Nov. 28, 2014, 11:14 a.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 122c851..528420c 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -295,6 +295,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;
@@ -307,7 +309,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;
@@ -1075,8 +1082,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);