aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/i915_mem.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-08-25 05:22:43 -0400
committerDave Airlie <airlied@optimus.(none)>2007-10-14 20:38:19 -0400
commit20caafa6ecb2487d9b223aa33e7cc704f912a758 (patch)
tree7df033fdee81305dad0a67ceba79f51ead7c1b8b /drivers/char/drm/i915_mem.c
parent23fd50450a34f2558070ceabb0bfebc1c9604af5 (diff)
drm: Remove DRM_ERR OS macro.
This was used to make all ioctl handlers return -errno on linux and errno on *BSD. Instead, just return -errno in shared code, and flip sign on return f shared code to *BSD code. Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/i915_mem.c')
-rw-r--r--drivers/char/drm/i915_mem.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/char/drm/i915_mem.c b/drivers/char/drm/i915_mem.c
index 50b4bacef0e0..d3ffad61c6b8 100644
--- a/drivers/char/drm/i915_mem.c
+++ b/drivers/char/drm/i915_mem.c
@@ -276,7 +276,7 @@ int i915_mem_alloc(DRM_IOCTL_ARGS)
276 276
277 if (!dev_priv) { 277 if (!dev_priv) {
278 DRM_ERROR("%s called with no initialization\n", __FUNCTION__); 278 DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
279 return DRM_ERR(EINVAL); 279 return -EINVAL;
280 } 280 }
281 281
282 DRM_COPY_FROM_USER_IOCTL(alloc, (drm_i915_mem_alloc_t __user *) data, 282 DRM_COPY_FROM_USER_IOCTL(alloc, (drm_i915_mem_alloc_t __user *) data,
@@ -284,7 +284,7 @@ int i915_mem_alloc(DRM_IOCTL_ARGS)
284 284
285 heap = get_heap(dev_priv, alloc.region); 285 heap = get_heap(dev_priv, alloc.region);
286 if (!heap || !*heap) 286 if (!heap || !*heap)
287 return DRM_ERR(EFAULT); 287 return -EFAULT;
288 288
289 /* Make things easier on ourselves: all allocations at least 289 /* Make things easier on ourselves: all allocations at least
290 * 4k aligned. 290 * 4k aligned.
@@ -295,13 +295,13 @@ int i915_mem_alloc(DRM_IOCTL_ARGS)
295 block = alloc_block(*heap, alloc.size, alloc.alignment, filp); 295 block = alloc_block(*heap, alloc.size, alloc.alignment, filp);
296 296
297 if (!block) 297 if (!block)
298 return DRM_ERR(ENOMEM); 298 return -ENOMEM;
299 299
300 mark_block(dev, block, 1); 300 mark_block(dev, block, 1);
301 301
302 if (DRM_COPY_TO_USER(alloc.region_offset, &block->start, sizeof(int))) { 302 if (DRM_COPY_TO_USER(alloc.region_offset, &block->start, sizeof(int))) {
303 DRM_ERROR("copy_to_user\n"); 303 DRM_ERROR("copy_to_user\n");
304 return DRM_ERR(EFAULT); 304 return -EFAULT;
305 } 305 }
306 306
307 return 0; 307 return 0;
@@ -316,7 +316,7 @@ int i915_mem_free(DRM_IOCTL_ARGS)
316 316
317 if (!dev_priv) { 317 if (!dev_priv) {
318 DRM_ERROR("%s called with no initialization\n", __FUNCTION__); 318 DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
319 return DRM_ERR(EINVAL); 319 return -EINVAL;
320 } 320 }
321 321
322 DRM_COPY_FROM_USER_IOCTL(memfree, (drm_i915_mem_free_t __user *) data, 322 DRM_COPY_FROM_USER_IOCTL(memfree, (drm_i915_mem_free_t __user *) data,
@@ -324,14 +324,14 @@ int i915_mem_free(DRM_IOCTL_ARGS)
324 324
325 heap = get_heap(dev_priv, memfree.region); 325 heap = get_heap(dev_priv, memfree.region);
326 if (!heap || !*heap) 326 if (!heap || !*heap)
327 return DRM_ERR(EFAULT); 327 return -EFAULT;
328 328
329 block = find_block(*heap, memfree.region_offset); 329 block = find_block(*heap, memfree.region_offset);
330 if (!block) 330 if (!block)
331 return DRM_ERR(EFAULT); 331 return -EFAULT;
332 332
333 if (block->filp != filp) 333 if (block->filp != filp)
334 return DRM_ERR(EPERM); 334 return -EPERM;
335 335
336 mark_block(dev, block, 0); 336 mark_block(dev, block, 0);
337 free_block(block); 337 free_block(block);
@@ -347,7 +347,7 @@ int i915_mem_init_heap(DRM_IOCTL_ARGS)
347 347
348 if (!dev_priv) { 348 if (!dev_priv) {
349 DRM_ERROR("%s called with no initialization\n", __FUNCTION__); 349 DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
350 return DRM_ERR(EINVAL); 350 return -EINVAL;
351 } 351 }
352 352
353 DRM_COPY_FROM_USER_IOCTL(initheap, 353 DRM_COPY_FROM_USER_IOCTL(initheap,
@@ -356,11 +356,11 @@ int i915_mem_init_heap(DRM_IOCTL_ARGS)
356 356
357 heap = get_heap(dev_priv, initheap.region); 357 heap = get_heap(dev_priv, initheap.region);
358 if (!heap) 358 if (!heap)
359 return DRM_ERR(EFAULT); 359 return -EFAULT;
360 360
361 if (*heap) { 361 if (*heap) {
362 DRM_ERROR("heap already initialized?"); 362 DRM_ERROR("heap already initialized?");
363 return DRM_ERR(EFAULT); 363 return -EFAULT;
364 } 364 }
365 365
366 return init_heap(heap, initheap.start, initheap.size); 366 return init_heap(heap, initheap.start, initheap.size);
@@ -375,7 +375,7 @@ int i915_mem_destroy_heap( DRM_IOCTL_ARGS )
375 375
376 if ( !dev_priv ) { 376 if ( !dev_priv ) {
377 DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); 377 DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
378 return DRM_ERR(EINVAL); 378 return -EINVAL;
379 } 379 }
380 380
381 DRM_COPY_FROM_USER_IOCTL( destroyheap, (drm_i915_mem_destroy_heap_t *)data, 381 DRM_COPY_FROM_USER_IOCTL( destroyheap, (drm_i915_mem_destroy_heap_t *)data,
@@ -384,12 +384,12 @@ int i915_mem_destroy_heap( DRM_IOCTL_ARGS )
384 heap = get_heap( dev_priv, destroyheap.region ); 384 heap = get_heap( dev_priv, destroyheap.region );
385 if (!heap) { 385 if (!heap) {
386 DRM_ERROR("get_heap failed"); 386 DRM_ERROR("get_heap failed");
387 return DRM_ERR(EFAULT); 387 return -EFAULT;
388 } 388 }
389 389
390 if (!*heap) { 390 if (!*heap) {
391 DRM_ERROR("heap not initialized?"); 391 DRM_ERROR("heap not initialized?");
392 return DRM_ERR(EFAULT); 392 return -EFAULT;
393 } 393 }
394 394
395 i915_mem_takedown( heap ); 395 i915_mem_takedown( heap );