From e39286eb5eab8846a228863abf8f1b8b07a9e29d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 19 Jul 2007 17:00:17 -0700 Subject: 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. --- bsd-core/drm_ioctl.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'bsd-core/drm_ioctl.c') diff --git a/bsd-core/drm_ioctl.c b/bsd-core/drm_ioctl.c index b5b5cf58..e450066c 100644 --- a/bsd-core/drm_ioctl.c +++ b/bsd-core/drm_ioctl.c @@ -48,7 +48,7 @@ int drm_getunique(DRM_IOCTL_ARGS) if (u.unique_len >= dev->unique_len) { if (DRM_COPY_TO_USER(u.unique, dev->unique, dev->unique_len)) - return DRM_ERR(EFAULT); + return EFAULT; } u.unique_len = dev->unique_len; @@ -71,15 +71,15 @@ int drm_setunique(DRM_IOCTL_ARGS) /* Check and copy in the submitted Bus ID */ if (!u.unique_len || u.unique_len > 1024) - return DRM_ERR(EINVAL); + return EINVAL; busid = malloc(u.unique_len + 1, M_DRM, M_WAITOK); if (busid == NULL) - return DRM_ERR(ENOMEM); + return ENOMEM; if (DRM_COPY_FROM_USER(busid, u.unique, u.unique_len)) { free(busid, M_DRM); - return DRM_ERR(EFAULT); + return EFAULT; } busid[u.unique_len] = '\0'; @@ -89,7 +89,7 @@ int drm_setunique(DRM_IOCTL_ARGS) ret = sscanf(busid, "PCI:%d:%d:%d", &bus, &slot, &func); if (ret != 3) { free(busid, M_DRM); - return DRM_ERR(EINVAL); + return EINVAL; } domain = bus >> 8; bus &= 0xff; @@ -99,14 +99,14 @@ int drm_setunique(DRM_IOCTL_ARGS) (slot != dev->pci_slot) || (func != dev->pci_func)) { free(busid, M_DRM); - return DRM_ERR(EINVAL); + return EINVAL; } /* Actually set the device's busid now. */ DRM_LOCK(); if (dev->unique_len || dev->unique) { DRM_UNLOCK(); - return DRM_ERR(EBUSY); + return EBUSY; } dev->unique_len = u.unique_len; @@ -158,7 +158,7 @@ int drm_getmap(DRM_IOCTL_ARGS) DRM_LOCK(); if (idx < 0) { DRM_UNLOCK(); - return DRM_ERR(EINVAL); + return EINVAL; } TAILQ_FOREACH(mapinlist, &dev->maplist, link) { -- cgit v1.2.3