diff options
author | Eric Anholt <eric@anholt.net> | 2007-08-25 11:22:43 +0200 |
---|---|---|
committer | Dave Airlie <airlied@optimus.(none)> | 2007-10-15 02:38:19 +0200 |
commit | 20caafa6ecb2487d9b223aa33e7cc704f912a758 (patch) | |
tree | 7df033fdee81305dad0a67ceba79f51ead7c1b8b /drivers/char/drm/mga_state.c | |
parent | Fix compile while compiling drivers/mmc/host/mmc_spi.o with !BLOCK (diff) | |
download | linux-20caafa6ecb2487d9b223aa33e7cc704f912a758.tar.xz linux-20caafa6ecb2487d9b223aa33e7cc704f912a758.zip |
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/mga_state.c')
-rw-r--r-- | drivers/char/drm/mga_state.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/char/drm/mga_state.c b/drivers/char/drm/mga_state.c index d448b0aef33c..4e9867161170 100644 --- a/drivers/char/drm/mga_state.c +++ b/drivers/char/drm/mga_state.c @@ -392,7 +392,7 @@ static int mga_verify_context(drm_mga_private_t * dev_priv) ctx->dstorg, dev_priv->front_offset, dev_priv->back_offset); ctx->dstorg = 0; - return DRM_ERR(EINVAL); + return -EINVAL; } return 0; @@ -411,7 +411,7 @@ static int mga_verify_tex(drm_mga_private_t * dev_priv, int unit) if (org == (MGA_TEXORGMAP_SYSMEM | MGA_TEXORGACC_PCI)) { DRM_ERROR("*** bad TEXORG: 0x%x, unit %d\n", tex->texorg, unit); tex->texorg = 0; - return DRM_ERR(EINVAL); + return -EINVAL; } return 0; @@ -453,13 +453,13 @@ static int mga_verify_iload(drm_mga_private_t * dev_priv, dstorg + length > (dev_priv->texture_offset + dev_priv->texture_size)) { DRM_ERROR("*** bad iload DSTORG: 0x%x\n", dstorg); - return DRM_ERR(EINVAL); + return -EINVAL; } if (length & MGA_ILOAD_MASK) { DRM_ERROR("*** bad iload length: 0x%x\n", length & MGA_ILOAD_MASK); - return DRM_ERR(EINVAL); + return -EINVAL; } return 0; @@ -471,7 +471,7 @@ static int mga_verify_blit(drm_mga_private_t * dev_priv, if ((srcorg & 0x3) == (MGA_SRCACC_PCI | MGA_SRCMAP_SYSMEM) || (dstorg & 0x3) == (MGA_SRCACC_PCI | MGA_SRCMAP_SYSMEM)) { DRM_ERROR("*** bad blit: src=0x%x dst=0x%x\n", srcorg, dstorg); - return DRM_ERR(EINVAL); + return -EINVAL; } return 0; } @@ -892,7 +892,7 @@ static int mga_dma_vertex(DRM_IOCTL_ARGS) sizeof(vertex)); if (vertex.idx < 0 || vertex.idx > dma->buf_count) - return DRM_ERR(EINVAL); + return -EINVAL; buf = dma->buflist[vertex.idx]; buf_priv = buf->dev_private; @@ -906,7 +906,7 @@ static int mga_dma_vertex(DRM_IOCTL_ARGS) buf_priv->dispatched = 0; mga_freelist_put(dev, buf); } - return DRM_ERR(EINVAL); + return -EINVAL; } WRAP_TEST_WITH_RETURN(dev_priv); @@ -932,7 +932,7 @@ static int mga_dma_indices(DRM_IOCTL_ARGS) sizeof(indices)); if (indices.idx < 0 || indices.idx > dma->buf_count) - return DRM_ERR(EINVAL); + return -EINVAL; buf = dma->buflist[indices.idx]; buf_priv = buf->dev_private; @@ -946,7 +946,7 @@ static int mga_dma_indices(DRM_IOCTL_ARGS) buf_priv->dispatched = 0; mga_freelist_put(dev, buf); } - return DRM_ERR(EINVAL); + return -EINVAL; } WRAP_TEST_WITH_RETURN(dev_priv); @@ -975,18 +975,18 @@ static int mga_dma_iload(DRM_IOCTL_ARGS) if (mga_do_wait_for_idle(dev_priv) < 0) { if (MGA_DMA_DEBUG) DRM_INFO("%s: -EBUSY\n", __FUNCTION__); - return DRM_ERR(EBUSY); + return -EBUSY; } #endif if (iload.idx < 0 || iload.idx > dma->buf_count) - return DRM_ERR(EINVAL); + return -EINVAL; buf = dma->buflist[iload.idx]; buf_priv = buf->dev_private; if (mga_verify_iload(dev_priv, iload.dstorg, iload.length)) { mga_freelist_put(dev, buf); - return DRM_ERR(EINVAL); + return -EINVAL; } WRAP_TEST_WITH_RETURN(dev_priv); @@ -1017,7 +1017,7 @@ static int mga_dma_blit(DRM_IOCTL_ARGS) sarea_priv->nbox = MGA_NR_SAREA_CLIPRECTS; if (mga_verify_blit(dev_priv, blit.srcorg, blit.dstorg)) - return DRM_ERR(EINVAL); + return -EINVAL; WRAP_TEST_WITH_RETURN(dev_priv); @@ -1039,7 +1039,7 @@ static int mga_getparam(DRM_IOCTL_ARGS) if (!dev_priv) { DRM_ERROR("%s called with no initialization\n", __FUNCTION__); - return DRM_ERR(EINVAL); + return -EINVAL; } DRM_COPY_FROM_USER_IOCTL(param, (drm_mga_getparam_t __user *) data, @@ -1055,12 +1055,12 @@ static int mga_getparam(DRM_IOCTL_ARGS) value = dev_priv->chipset; break; default: - return DRM_ERR(EINVAL); + return -EINVAL; } if (DRM_COPY_TO_USER(param.value, &value, sizeof(int))) { DRM_ERROR("copy_to_user\n"); - return DRM_ERR(EFAULT); + return -EFAULT; } return 0; @@ -1075,7 +1075,7 @@ static int mga_set_fence(DRM_IOCTL_ARGS) if (!dev_priv) { DRM_ERROR("%s called with no initialization\n", __FUNCTION__); - return DRM_ERR(EINVAL); + return -EINVAL; } DRM_DEBUG("pid=%d\n", DRM_CURRENTPID); @@ -1095,7 +1095,7 @@ static int mga_set_fence(DRM_IOCTL_ARGS) if (DRM_COPY_TO_USER((u32 __user *) data, &temp, sizeof(u32))) { DRM_ERROR("copy_to_user\n"); - return DRM_ERR(EFAULT); + return -EFAULT; } return 0; @@ -1109,7 +1109,7 @@ static int mga_wait_fence(DRM_IOCTL_ARGS) if (!dev_priv) { DRM_ERROR("%s called with no initialization\n", __FUNCTION__); - return DRM_ERR(EINVAL); + return -EINVAL; } DRM_COPY_FROM_USER_IOCTL(fence, (u32 __user *) data, sizeof(u32)); @@ -1120,7 +1120,7 @@ static int mga_wait_fence(DRM_IOCTL_ARGS) if (DRM_COPY_TO_USER((u32 __user *) data, &fence, sizeof(u32))) { DRM_ERROR("copy_to_user\n"); - return DRM_ERR(EFAULT); + return -EFAULT; } return 0; |