aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-02-27 20:04:09 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-27 22:10:15 -0500
commit8550cb2e3a3f4a5f2f6aa40b6c99691056f85b9d (patch)
tree1703c0bc1882eaa3c8e9cb275544acae0b92eca7 /drivers/gpu/drm
parent2e928815c1886fe628ed54623aa98d0889cf5509 (diff)
drm/exynos: convert to idr_alloc()
Convert to the much saner new idr interface. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: David Airlie <airlied@linux.ie> Cc: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_ipp.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
index 90398dfbfd75..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
140again:
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
157static void *ipp_find_obj(struct idr *id_idr, struct mutex *lock, u32 id) 151static void *ipp_find_obj(struct idr *id_idr, struct mutex *lock, u32 id)