From b61f07def349644ec8077cb12b303d444e223c1b Mon Sep 17 00:00:00 2001 From: Michel Daenzer Date: Sat, 28 Feb 2004 11:52:19 +0000 Subject: More differentiated error codes for DRM(agp_acquire) Obtained from: Linux kernel --- linux-core/drm_agpsupport.c | 6 +++++- linux/drm_agpsupport.h | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/linux-core/drm_agpsupport.c b/linux-core/drm_agpsupport.c index 0f281b57..f83651af 100644 --- a/linux-core/drm_agpsupport.c +++ b/linux-core/drm_agpsupport.c @@ -104,7 +104,11 @@ int DRM(agp_acquire)(struct inode *inode, struct file *filp, drm_device_t *dev = priv->dev; int retcode; - if (!dev->agp || dev->agp->acquired || !drm_agp->acquire) + if (!dev->agp) + return -ENODEV; + if (dev->agp->acquired) + return -EBUSY; + if (!drm_agp->acquire) return -EINVAL; #ifndef VMAP_4_ARGS if ( dev->agp->cant_use_aperture ) diff --git a/linux/drm_agpsupport.h b/linux/drm_agpsupport.h index 0f281b57..f83651af 100644 --- a/linux/drm_agpsupport.h +++ b/linux/drm_agpsupport.h @@ -104,7 +104,11 @@ int DRM(agp_acquire)(struct inode *inode, struct file *filp, drm_device_t *dev = priv->dev; int retcode; - if (!dev->agp || dev->agp->acquired || !drm_agp->acquire) + if (!dev->agp) + return -ENODEV; + if (dev->agp->acquired) + return -EBUSY; + if (!drm_agp->acquire) return -EINVAL; #ifndef VMAP_4_ARGS if ( dev->agp->cant_use_aperture ) -- cgit v1.2.3