From 86e6325e5ab848c15c422f20133445fe6c1caa09 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 22 Oct 2003 22:08:53 +0000 Subject: - Add DRM_GET_PRIV_WITH_RETURN macro. This can be used in shared code to get the drm_file_t * based on the filp passed in ioctl handlers. - Use this macro on BSD for simplification and improve its error reporting. Make failure to find the drm_file_t * print as an error, not debug. This failure may be part of the problem with KDE. - Make debug and error print macros include the pid on BSD. --- bsd/drm_drv.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'bsd/drm_drv.h') diff --git a/bsd/drm_drv.h b/bsd/drm_drv.h index 7d753836..582a4112 100644 --- a/bsd/drm_drv.h +++ b/bsd/drm_drv.h @@ -824,7 +824,7 @@ int DRM(close)(dev_t kdev, int flags, int fmt, DRM_STRUCTPROC *p) priv = DRM(find_file_by_proc)(dev, p); if (!priv) { DRM_UNLOCK(); - DRM_DEBUG("can't find authenticator\n"); + DRM_ERROR("can't find authenticator\n"); return EINVAL; } @@ -938,13 +938,7 @@ int DRM(ioctl)(dev_t kdev, u_long cmd, caddr_t data, int flags, int nr = DRM_IOCTL_NR(cmd); drm_file_t *priv; - DRM_LOCK(); - priv = (drm_file_t *) DRM(find_file_by_proc)(dev, p); - DRM_UNLOCK(); - if (priv == NULL) { - DRM_DEBUG("can't find authenticator\n"); - return EINVAL; - } + DRM_GET_PRIV_WITH_RETURN(priv, (DRMFILE)DRM_CURRENTPID); atomic_inc( &dev->counts[_DRM_STAT_IOCTLS] ); ++priv->ioctl_count; -- cgit v1.2.3