diff options
author | Tejun Heo <tj@kernel.org> | 2013-02-27 20:04:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-27 22:10:16 -0500 |
commit | 36888db24765478a463ac6f443b175ad885dee25 (patch) | |
tree | 420e3fb5959e620cfbbc582bfc18d0666406becb /drivers/gpu/drm | |
parent | ff512357fe1bf7f901bd0ea19fc718025dff6b07 (diff) |
drm/via: 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>
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/via/via_mm.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/gpu/drm/via/via_mm.c b/drivers/gpu/drm/via/via_mm.c index 0d55432e02a2..0ab93ff09873 100644 --- a/drivers/gpu/drm/via/via_mm.c +++ b/drivers/gpu/drm/via/via_mm.c | |||
@@ -148,17 +148,10 @@ int via_mem_alloc(struct drm_device *dev, void *data, | |||
148 | if (retval) | 148 | if (retval) |
149 | goto fail_alloc; | 149 | goto fail_alloc; |
150 | 150 | ||
151 | again: | 151 | retval = idr_alloc(&dev_priv->object_idr, item, 1, 0, GFP_KERNEL); |
152 | if (idr_pre_get(&dev_priv->object_idr, GFP_KERNEL) == 0) { | 152 | if (retval < 0) |
153 | retval = -ENOMEM; | ||
154 | goto fail_idr; | ||
155 | } | ||
156 | |||
157 | retval = idr_get_new_above(&dev_priv->object_idr, item, 1, &user_key); | ||
158 | if (retval == -EAGAIN) | ||
159 | goto again; | ||
160 | if (retval) | ||
161 | goto fail_idr; | 153 | goto fail_idr; |
154 | user_key = retval; | ||
162 | 155 | ||
163 | list_add(&item->owner_list, &file_priv->obj_list); | 156 | list_add(&item->owner_list, &file_priv->obj_list); |
164 | mutex_unlock(&dev->struct_mutex); | 157 | mutex_unlock(&dev->struct_mutex); |