Commit 8550cb2e authored by Tejun Heo's avatar Tejun Heo Committed by Linus Torvalds

drm/exynos: convert to idr_alloc()

Convert to the much saner new idr interface.
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarDavid Airlie <airlied@linux.ie>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2e928815
...@@ -137,21 +137,15 @@ static int ipp_create_id(struct idr *id_idr, struct mutex *lock, void *obj, ...@@ -137,21 +137,15 @@ static int ipp_create_id(struct idr *id_idr, struct mutex *lock, void *obj,
DRM_DEBUG_KMS("%s\n", __func__); DRM_DEBUG_KMS("%s\n", __func__);
again:
/* ensure there is space available to allocate a handle */
if (idr_pre_get(id_idr, GFP_KERNEL) == 0) {
DRM_ERROR("failed to get idr.\n");
return -ENOMEM;
}
/* do the allocation under our mutexlock */ /* do the allocation under our mutexlock */
mutex_lock(lock); mutex_lock(lock);
ret = idr_get_new_above(id_idr, obj, 1, (int *)idp); ret = idr_alloc(id_idr, obj, 1, 0, GFP_KERNEL);
mutex_unlock(lock); mutex_unlock(lock);
if (ret == -EAGAIN) if (ret < 0)
goto again; return ret;
return ret; *idp = ret;
return 0;
} }
static void *ipp_find_obj(struct idr *id_idr, struct mutex *lock, u32 id) static void *ipp_find_obj(struct idr *id_idr, struct mutex *lock, u32 id)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment