Skip to content

Commit

Permalink
drm/exynos: convert to idr_alloc()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed Feb 28, 2013
1 parent 2e92881 commit 8550cb2
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions drivers/gpu/drm/exynos/exynos_drm_ipp.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,21 +137,15 @@ static int ipp_create_id(struct idr *id_idr, struct mutex *lock, void *obj,

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 */
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);
if (ret == -EAGAIN)
goto again;
if (ret < 0)
return ret;

return ret;
*idp = ret;
return 0;
}

static void *ipp_find_obj(struct idr *id_idr, struct mutex *lock, u32 id)
Expand Down

0 comments on commit 8550cb2

Please sign in to comment.