aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_gem.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-08-04 09:19:46 -0400
committerDave Airlie <airlied@redhat.com>2010-08-09 20:46:55 -0400
commitbf79cb914dbfe848add8bb76cbb8ff89110d29ff (patch)
tree999c982fe33a39b5000fa16887bc439ff66d678f /drivers/gpu/drm/radeon/radeon_gem.c
parenta44d2f37253cb7a8dc302e345d8909828b093e3c (diff)
drm: Use ENOENT consistently for the error return for an unmatched handle.
This is consistent with trying to access a filename that not exist within a directory which is a good analogy here. The main reason for the change is that it is easy to confuse the error code of EBADF as an performing an ioctl on an invalid file descriptor (rather than an unknown object). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_gem.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_gem.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
index a72a3ee5d69b..c578f265b24c 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -226,7 +226,7 @@ int radeon_gem_set_domain_ioctl(struct drm_device *dev, void *data,
226 /* just do a BO wait for now */ 226 /* just do a BO wait for now */
227 gobj = drm_gem_object_lookup(dev, filp, args->handle); 227 gobj = drm_gem_object_lookup(dev, filp, args->handle);
228 if (gobj == NULL) { 228 if (gobj == NULL) {
229 return -EINVAL; 229 return -ENOENT;
230 } 230 }
231 robj = gobj->driver_private; 231 robj = gobj->driver_private;
232 232
@@ -245,7 +245,7 @@ int radeon_gem_mmap_ioctl(struct drm_device *dev, void *data,
245 245
246 gobj = drm_gem_object_lookup(dev, filp, args->handle); 246 gobj = drm_gem_object_lookup(dev, filp, args->handle);
247 if (gobj == NULL) { 247 if (gobj == NULL) {
248 return -EINVAL; 248 return -ENOENT;
249 } 249 }
250 robj = gobj->driver_private; 250 robj = gobj->driver_private;
251 args->addr_ptr = radeon_bo_mmap_offset(robj); 251 args->addr_ptr = radeon_bo_mmap_offset(robj);
@@ -264,7 +264,7 @@ int radeon_gem_busy_ioctl(struct drm_device *dev, void *data,
264 264
265 gobj = drm_gem_object_lookup(dev, filp, args->handle); 265 gobj = drm_gem_object_lookup(dev, filp, args->handle);
266 if (gobj == NULL) { 266 if (gobj == NULL) {
267 return -EINVAL; 267 return -ENOENT;
268 } 268 }
269 robj = gobj->driver_private; 269 robj = gobj->driver_private;
270 r = radeon_bo_wait(robj, &cur_placement, true); 270 r = radeon_bo_wait(robj, &cur_placement, true);
@@ -294,7 +294,7 @@ int radeon_gem_wait_idle_ioctl(struct drm_device *dev, void *data,
294 294
295 gobj = drm_gem_object_lookup(dev, filp, args->handle); 295 gobj = drm_gem_object_lookup(dev, filp, args->handle);
296 if (gobj == NULL) { 296 if (gobj == NULL) {
297 return -EINVAL; 297 return -ENOENT;
298 } 298 }
299 robj = gobj->driver_private; 299 robj = gobj->driver_private;
300 r = radeon_bo_wait(robj, NULL, false); 300 r = radeon_bo_wait(robj, NULL, false);
@@ -316,7 +316,7 @@ int radeon_gem_set_tiling_ioctl(struct drm_device *dev, void *data,
316 DRM_DEBUG("%d \n", args->handle); 316 DRM_DEBUG("%d \n", args->handle);
317 gobj = drm_gem_object_lookup(dev, filp, args->handle); 317 gobj = drm_gem_object_lookup(dev, filp, args->handle);
318 if (gobj == NULL) 318 if (gobj == NULL)
319 return -EINVAL; 319 return -ENOENT;
320 robj = gobj->driver_private; 320 robj = gobj->driver_private;
321 r = radeon_bo_set_tiling_flags(robj, args->tiling_flags, args->pitch); 321 r = radeon_bo_set_tiling_flags(robj, args->tiling_flags, args->pitch);
322 drm_gem_object_unreference_unlocked(gobj); 322 drm_gem_object_unreference_unlocked(gobj);
@@ -334,7 +334,7 @@ int radeon_gem_get_tiling_ioctl(struct drm_device *dev, void *data,
334 DRM_DEBUG("\n"); 334 DRM_DEBUG("\n");
335 gobj = drm_gem_object_lookup(dev, filp, args->handle); 335 gobj = drm_gem_object_lookup(dev, filp, args->handle);
336 if (gobj == NULL) 336 if (gobj == NULL)
337 return -EINVAL; 337 return -ENOENT;
338 rbo = gobj->driver_private; 338 rbo = gobj->driver_private;
339 r = radeon_bo_reserve(rbo, false); 339 r = radeon_bo_reserve(rbo, false);
340 if (unlikely(r != 0)) 340 if (unlikely(r != 0))