diff options
author | Ajay Kumar <ajaykumar.rs@samsung.com> | 2015-01-11 11:57:07 -0500 |
---|---|---|
committer | Inki Dae <daeinki@gmail.com> | 2015-01-25 07:28:09 -0500 |
commit | efa75bcdad59fc796152a4c73bb65ae2ab7ce035 (patch) | |
tree | 51673f9624d419e3d7a5c415a3cbcb704032a2ff /drivers | |
parent | adf5691c333620560fb90f2c551a42da8ed14f15 (diff) |
drm/exynos: fimd: check error status for drm_iommu_attach_device
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>
Signed-off-by: Inki Dae <daeinki@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fimd.c | 17 |
1 files 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 d54ca07658c9..682806ef4d33 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c | |||
@@ -296,12 +296,19 @@ static int fimd_ctx_initialize(struct fimd_context *ctx, | |||
296 | 296 | ||
297 | /* attach this sub driver to iommu mapping if supported. */ | 297 | /* attach this sub driver to iommu mapping if supported. */ |
298 | if (is_drm_iommu_supported(ctx->drm_dev)) { | 298 | if (is_drm_iommu_supported(ctx->drm_dev)) { |
299 | int ret; | ||
300 | |||
299 | /* | 301 | /* |
300 | * If any channel is already active, iommu will throw | 302 | * If any channel is already active, iommu will throw |
301 | * a PAGE FAULT when enabled. So clear any channel if enabled. | 303 | * a PAGE FAULT when enabled. So clear any channel if enabled. |
302 | */ | 304 | */ |
303 | fimd_clear_channel(ctx->crtc); | 305 | fimd_clear_channel(ctx->crtc); |
304 | drm_iommu_attach_device(ctx->drm_dev, ctx->dev); | 306 | ret = drm_iommu_attach_device(ctx->drm_dev, ctx->dev); |
307 | if (ret) { | ||
308 | DRM_ERROR("drm_iommu_attach failed.\n"); | ||
309 | return ret; | ||
310 | } | ||
311 | |||
305 | } | 312 | } |
306 | 313 | ||
307 | return 0; | 314 | return 0; |
@@ -1056,6 +1063,7 @@ static int fimd_bind(struct device *dev, struct device *master, void *data) | |||
1056 | { | 1063 | { |
1057 | struct fimd_context *ctx = dev_get_drvdata(dev); | 1064 | struct fimd_context *ctx = dev_get_drvdata(dev); |
1058 | struct drm_device *drm_dev = data; | 1065 | struct drm_device *drm_dev = data; |
1066 | int ret; | ||
1059 | 1067 | ||
1060 | ctx->crtc = exynos_drm_crtc_create(drm_dev, ctx->pipe, | 1068 | ctx->crtc = exynos_drm_crtc_create(drm_dev, ctx->pipe, |
1061 | EXYNOS_DISPLAY_TYPE_LCD, | 1069 | EXYNOS_DISPLAY_TYPE_LCD, |
@@ -1063,7 +1071,12 @@ static int fimd_bind(struct device *dev, struct device *master, void *data) | |||
1063 | if (IS_ERR(ctx->crtc)) | 1071 | if (IS_ERR(ctx->crtc)) |
1064 | return PTR_ERR(ctx->crtc); | 1072 | return PTR_ERR(ctx->crtc); |
1065 | 1073 | ||
1066 | fimd_ctx_initialize(ctx, drm_dev); | 1074 | ret = fimd_ctx_initialize(ctx, drm_dev); |
1075 | if (ret) { | ||
1076 | DRM_ERROR("fimd_ctx_initialize failed.\n"); | ||
1077 | return ret; | ||
1078 | } | ||
1079 | |||
1067 | 1080 | ||
1068 | if (ctx->display) | 1081 | if (ctx->display) |
1069 | exynos_drm_create_enc_conn(drm_dev, ctx->display); | 1082 | exynos_drm_create_enc_conn(drm_dev, ctx->display); |