diff options
author | anholt <anholt@FreeBSD.org> | 2002-04-29 00:25:10 +0000 |
---|---|---|
committer | anholt <anholt@FreeBSD.org> | 2002-04-29 00:25:10 +0000 |
commit | bb589e7417c17ba35f6dde61a74770697973f0c4 (patch) | |
tree | a41daedb2e90cf5f6d51ea1940bf76edec4de6a0 /sys/dev/drm/radeon_cp.c | |
parent | 730253b82fd8aee07046e5d6a79003eac5811fdf (diff) | |
download | FreeBSD-src-bb589e7417c17ba35f6dde61a74770697973f0c4.zip FreeBSD-src-bb589e7417c17ba35f6dde61a74770697973f0c4.tar.gz |
Diff reduction to my experimental code: clean up return code handling.
Approved by: des
Diffstat (limited to 'sys/dev/drm/radeon_cp.c')
-rw-r--r-- | sys/dev/drm/radeon_cp.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/sys/dev/drm/radeon_cp.c b/sys/dev/drm/radeon_cp.c index d69d3cd..821d8e4 100644 --- a/sys/dev/drm/radeon_cp.c +++ b/sys/dev/drm/radeon_cp.c @@ -371,7 +371,7 @@ static int radeon_do_pixcache_flush( drm_radeon_private_t *dev_priv ) DRM_ERROR( "failed!\n" ); radeon_status( dev_priv ); #endif - DRM_OS_RETURN( EBUSY ); + return DRM_OS_ERR(EBUSY); } static int radeon_do_wait_for_fifo( drm_radeon_private_t *dev_priv, @@ -390,7 +390,7 @@ static int radeon_do_wait_for_fifo( drm_radeon_private_t *dev_priv, DRM_ERROR( "failed!\n" ); radeon_status( dev_priv ); #endif - DRM_OS_RETURN( EBUSY ); + return DRM_OS_ERR(EBUSY); } static int radeon_do_wait_for_idle( drm_radeon_private_t *dev_priv ) @@ -417,7 +417,7 @@ static int radeon_do_wait_for_idle( drm_radeon_private_t *dev_priv ) DRM_ERROR( "failed!\n" ); radeon_status( dev_priv ); #endif - DRM_OS_RETURN( EBUSY ); + return DRM_OS_ERR(EBUSY); } @@ -675,7 +675,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) dev_priv = DRM(alloc)( sizeof(drm_radeon_private_t), DRM_MEM_DRIVER ); if ( dev_priv == NULL ) - DRM_OS_RETURN( ENOMEM ); + return DRM_OS_ERR(ENOMEM); memset( dev_priv, 0, sizeof(drm_radeon_private_t) ); @@ -688,7 +688,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) DRM_ERROR( "PCI GART not yet supported for Radeon!\n" ); dev->dev_private = (void *)dev_priv; radeon_do_cleanup_cp(dev); - DRM_OS_RETURN( EINVAL ); + return DRM_OS_ERR(EINVAL); } #endif @@ -696,7 +696,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) DRM_ERROR( "PCI GART memory not allocated!\n" ); dev->dev_private = (void *)dev_priv; radeon_do_cleanup_cp(dev); - DRM_OS_RETURN( EINVAL ); + return DRM_OS_ERR(EINVAL); } dev_priv->usec_timeout = init->usec_timeout; @@ -705,7 +705,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) DRM_DEBUG( "TIMEOUT problem!\n" ); dev->dev_private = (void *)dev_priv; radeon_do_cleanup_cp(dev); - DRM_OS_RETURN( EINVAL ); + return DRM_OS_ERR(EINVAL); } dev_priv->cp_mode = init->cp_mode; @@ -723,7 +723,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) DRM_DEBUG( "BAD cp_mode (%x)!\n", init->cp_mode ); dev->dev_private = (void *)dev_priv; radeon_do_cleanup_cp(dev); - DRM_OS_RETURN( EINVAL ); + return DRM_OS_ERR(EINVAL); } switch ( init->fb_bpp ) { @@ -815,7 +815,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) DRM_ERROR("could not find sarea!\n"); dev->dev_private = (void *)dev_priv; radeon_do_cleanup_cp(dev); - DRM_OS_RETURN(EINVAL); + return DRM_OS_ERR(EINVAL); } DRM_FIND_MAP( dev_priv->fb, init->fb_offset ); @@ -823,35 +823,35 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) DRM_ERROR("could not find framebuffer!\n"); dev->dev_private = (void *)dev_priv; radeon_do_cleanup_cp(dev); - DRM_OS_RETURN(EINVAL); + return DRM_OS_ERR(EINVAL); } DRM_FIND_MAP( dev_priv->mmio, init->mmio_offset ); if(!dev_priv->mmio) { DRM_ERROR("could not find mmio region!\n"); dev->dev_private = (void *)dev_priv; radeon_do_cleanup_cp(dev); - DRM_OS_RETURN(EINVAL); + return DRM_OS_ERR(EINVAL); } DRM_FIND_MAP( dev_priv->cp_ring, init->ring_offset ); if(!dev_priv->cp_ring) { DRM_ERROR("could not find cp ring region!\n"); dev->dev_private = (void *)dev_priv; radeon_do_cleanup_cp(dev); - DRM_OS_RETURN(EINVAL); + return DRM_OS_ERR(EINVAL); } DRM_FIND_MAP( dev_priv->ring_rptr, init->ring_rptr_offset ); if(!dev_priv->ring_rptr) { DRM_ERROR("could not find ring read pointer!\n"); dev->dev_private = (void *)dev_priv; radeon_do_cleanup_cp(dev); - DRM_OS_RETURN(EINVAL); + return DRM_OS_ERR(EINVAL); } DRM_FIND_MAP( dev_priv->buffers, init->buffers_offset ); if(!dev_priv->buffers) { DRM_ERROR("could not find dma buffer region!\n"); dev->dev_private = (void *)dev_priv; radeon_do_cleanup_cp(dev); - DRM_OS_RETURN(EINVAL); + return DRM_OS_ERR(EINVAL); } if ( !dev_priv->is_pci ) { @@ -861,7 +861,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) DRM_ERROR("could not find agp texture region!\n"); dev->dev_private = (void *)dev_priv; radeon_do_cleanup_cp(dev); - DRM_OS_RETURN(EINVAL); + return DRM_OS_ERR(EINVAL); } } @@ -879,7 +879,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) DRM_ERROR("could not find ioremap agp regions!\n"); dev->dev_private = (void *)dev_priv; radeon_do_cleanup_cp(dev); - DRM_OS_RETURN(EINVAL); + return DRM_OS_ERR(EINVAL); } } else { dev_priv->cp_ring->handle = @@ -966,7 +966,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) DRM_ERROR( "failed to init PCI GART!\n" ); dev->dev_private = (void *)dev_priv; radeon_do_cleanup_cp(dev); - DRM_OS_RETURN(ENOMEM); + return DRM_OS_ERR(ENOMEM); } /* Turn on PCI GART */ @@ -1057,7 +1057,7 @@ int radeon_cp_init( DRM_OS_IOCTL ) return radeon_do_cleanup_cp( dev ); } - DRM_OS_RETURN( EINVAL ); + return DRM_OS_ERR(EINVAL); } int radeon_cp_start( DRM_OS_IOCTL ) @@ -1142,7 +1142,7 @@ int radeon_cp_reset( DRM_OS_IOCTL ) if ( !dev_priv ) { DRM_DEBUG( "%s called before init done\n", __FUNCTION__ ); - DRM_OS_RETURN( EINVAL ); + return DRM_OS_ERR(EINVAL); } radeon_do_cp_reset( dev_priv ); @@ -1229,7 +1229,7 @@ int radeon_fullscreen( DRM_OS_IOCTL ) return radeon_do_cleanup_pageflip( dev ); } - DRM_OS_RETURN( EINVAL ); + return DRM_OS_ERR(EINVAL); } @@ -1252,7 +1252,7 @@ static int radeon_freelist_init( drm_device_t *dev ) dev_priv->head = DRM(alloc)( sizeof(drm_radeon_freelist_t), DRM_MEM_DRIVER ); if ( dev_priv->head == NULL ) - DRM_OS_RETURN( ENOMEM ); + return DRM_OS_ERR(ENOMEM); memset( dev_priv->head, 0, sizeof(drm_radeon_freelist_t) ); dev_priv->head->age = RADEON_BUFFER_USED; @@ -1263,7 +1263,7 @@ static int radeon_freelist_init( drm_device_t *dev ) entry = DRM(alloc)( sizeof(drm_radeon_freelist_t), DRM_MEM_DRIVER ); - if ( !entry ) DRM_OS_RETURN( ENOMEM ); + if ( !entry ) return DRM_OS_ERR(ENOMEM); entry->age = RADEON_BUFFER_FREE; entry->buf = buf; @@ -1393,7 +1393,7 @@ int radeon_wait_ring( drm_radeon_private_t *dev_priv, int n ) radeon_status( dev_priv ); DRM_ERROR( "failed!\n" ); #endif - DRM_OS_RETURN( EBUSY ); + return DRM_OS_ERR(EBUSY); } static int radeon_cp_get_buffers( drm_device_t *dev, drm_dma_t *d ) @@ -1403,16 +1403,16 @@ static int radeon_cp_get_buffers( drm_device_t *dev, drm_dma_t *d ) for ( i = d->granted_count ; i < d->request_count ; i++ ) { buf = radeon_freelist_get( dev ); - if ( !buf ) DRM_OS_RETURN( EAGAIN ); + if ( !buf ) return DRM_OS_ERR(EAGAIN); buf->pid = DRM_OS_CURRENTPID; if (DRM_OS_COPYTOUSR( &d->request_indices[i], &buf->idx, sizeof(buf->idx) ) ) - DRM_OS_RETURN( EFAULT ); + return DRM_OS_ERR(EFAULT); if (DRM_OS_COPYTOUSR( &d->request_sizes[i], &buf->total, sizeof(buf->total) ) ) - DRM_OS_RETURN( EFAULT ); + return DRM_OS_ERR(EFAULT); d->granted_count++; } @@ -1435,7 +1435,7 @@ int radeon_cp_buffers( DRM_OS_IOCTL ) if ( d.send_count != 0 ) { DRM_ERROR( "Process %d trying to send %d buffers via drmDMA\n", DRM_OS_CURRENTPID, d.send_count ); - DRM_OS_RETURN( EINVAL ); + return DRM_OS_ERR(EINVAL); } /* We'll send you buffers. @@ -1443,7 +1443,7 @@ int radeon_cp_buffers( DRM_OS_IOCTL ) if ( d.request_count < 0 || d.request_count > dma->buf_count ) { DRM_ERROR( "Process %d trying to get %d buffers (of %d max)\n", DRM_OS_CURRENTPID, d.request_count, dma->buf_count ); - DRM_OS_RETURN( EINVAL ); + return DRM_OS_ERR(EINVAL); } d.granted_count = 0; |