summaryrefslogtreecommitdiff
path: root/bsd-core/drm_context.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-07-19 17:00:17 -0700
committerEric Anholt <eric@anholt.net>2007-07-20 12:53:52 -0700
commite39286eb5eab8846a228863abf8f1b8b07a9e29d (patch)
tree7f0f599e514917546e195f2ec19eb869deb141c1 /bsd-core/drm_context.c
parent5dc9fd96d7bf48003db832f145ad8acb4bcb73b4 (diff)
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 from shared code to *BSD code.
Diffstat (limited to 'bsd-core/drm_context.c')
-rw-r--r--bsd-core/drm_context.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/bsd-core/drm_context.c b/bsd-core/drm_context.c
index 8e009540..e8df7df5 100644
--- a/bsd-core/drm_context.c
+++ b/bsd-core/drm_context.c
@@ -109,7 +109,7 @@ int drm_ctxbitmap_init(drm_device_t *dev)
dev->ctx_bitmap = malloc(PAGE_SIZE, M_DRM, M_NOWAIT | M_ZERO);
if ( dev->ctx_bitmap == NULL ) {
DRM_UNLOCK();
- return DRM_ERR(ENOMEM);
+ return ENOMEM;
}
dev->context_sareas = NULL;
dev->max_context = -1;
@@ -148,7 +148,7 @@ int drm_getsareactx( DRM_IOCTL_ARGS )
DRM_LOCK();
if (dev->max_context < 0 || request.ctx_id >= (unsigned) dev->max_context) {
DRM_UNLOCK();
- return DRM_ERR(EINVAL);
+ return EINVAL;
}
map = dev->context_sareas[request.ctx_id];
@@ -185,7 +185,7 @@ int drm_setsareactx( DRM_IOCTL_ARGS )
bad:
DRM_UNLOCK();
- return DRM_ERR(EINVAL);
+ return EINVAL;
}
/* ================================================================
@@ -196,7 +196,7 @@ int drm_context_switch(drm_device_t *dev, int old, int new)
{
if ( test_and_set_bit( 0, &dev->context_flag ) ) {
DRM_ERROR( "Reentering -- FIXME\n" );
- return DRM_ERR(EBUSY);
+ return EBUSY;
}
DRM_DEBUG( "Context switch from %d to %d\n", old, new );
@@ -239,7 +239,7 @@ int drm_resctx(DRM_IOCTL_ARGS)
ctx.handle = i;
if ( DRM_COPY_TO_USER( &res.contexts[i],
&ctx, sizeof(ctx) ) )
- return DRM_ERR(EFAULT);
+ return EFAULT;
}
}
res.count = DRM_RESERVED_CONTEXTS;
@@ -265,7 +265,7 @@ int drm_addctx(DRM_IOCTL_ARGS)
if ( ctx.handle == -1 ) {
DRM_DEBUG( "Not enough free contexts.\n" );
/* Should this return -EBUSY instead? */
- return DRM_ERR(ENOMEM);
+ return ENOMEM;
}
if (dev->driver.context_ctor && ctx.handle != DRM_KERNEL_CONTEXT) {