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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



check error status for drm_iommu_attach_device() and make sure
it propagates till the caller.

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

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);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux