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

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




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux