diff options
Diffstat (limited to 'drivers/gpu/drm/exynos')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_ipp.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index 1a556354e92f..1adce07ecb5b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c | |||
@@ -137,21 +137,15 @@ static int ipp_create_id(struct idr *id_idr, struct mutex *lock, void *obj, | |||
137 | 137 | ||
138 | DRM_DEBUG_KMS("%s\n", __func__); | 138 | DRM_DEBUG_KMS("%s\n", __func__); |
139 | 139 | ||
140 | again: | ||
141 | /* ensure there is space available to allocate a handle */ | ||
142 | if (idr_pre_get(id_idr, GFP_KERNEL) == 0) { | ||
143 | DRM_ERROR("failed to get idr.\n"); | ||
144 | return -ENOMEM; | ||
145 | } | ||
146 | |||
147 | /* do the allocation under our mutexlock */ | 140 | /* do the allocation under our mutexlock */ |
148 | mutex_lock(lock); | 141 | mutex_lock(lock); |
149 | ret = idr_get_new_above(id_idr, obj, 1, (int *)idp); | 142 | ret = idr_alloc(id_idr, obj, 1, 0, GFP_KERNEL); |
150 | mutex_unlock(lock); | 143 | mutex_unlock(lock); |
151 | if (ret == -EAGAIN) | 144 | if (ret < 0) |
152 | goto again; | 145 | return ret; |
153 | 146 | ||
154 | return ret; | 147 | *idp = ret; |
148 | return 0; | ||
155 | } | 149 | } |
156 | 150 | ||
157 | static void *ipp_find_obj(struct idr *id_idr, struct mutex *lock, u32 id) | 151 | static void *ipp_find_obj(struct idr *id_idr, struct mutex *lock, u32 id) |
@@ -1786,8 +1780,6 @@ err_iommu: | |||
1786 | drm_iommu_detach_device(drm_dev, ippdrv->dev); | 1780 | drm_iommu_detach_device(drm_dev, ippdrv->dev); |
1787 | 1781 | ||
1788 | err_idr: | 1782 | err_idr: |
1789 | idr_remove_all(&ctx->ipp_idr); | ||
1790 | idr_remove_all(&ctx->prop_idr); | ||
1791 | idr_destroy(&ctx->ipp_idr); | 1783 | idr_destroy(&ctx->ipp_idr); |
1792 | idr_destroy(&ctx->prop_idr); | 1784 | idr_destroy(&ctx->prop_idr); |
1793 | return ret; | 1785 | return ret; |
@@ -1965,8 +1957,6 @@ static int ipp_remove(struct platform_device *pdev) | |||
1965 | exynos_drm_subdrv_unregister(&ctx->subdrv); | 1957 | exynos_drm_subdrv_unregister(&ctx->subdrv); |
1966 | 1958 | ||
1967 | /* remove,destroy ipp idr */ | 1959 | /* remove,destroy ipp idr */ |
1968 | idr_remove_all(&ctx->ipp_idr); | ||
1969 | idr_remove_all(&ctx->prop_idr); | ||
1970 | idr_destroy(&ctx->ipp_idr); | 1960 | idr_destroy(&ctx->ipp_idr); |
1971 | idr_destroy(&ctx->prop_idr); | 1961 | idr_destroy(&ctx->prop_idr); |
1972 | 1962 | ||