int drm_open_helper(struct inode *inode, struct file *filp, drm_device_t *dev) 
static int drm_open_helper(struct inode *inode, struct file *filp, drm_device_t *dev) 
int drm_open_helper(struct inode *inode, struct file *filp, drm_device_t *dev){	int	     minor = iminor(inode);	drm_file_t   *priv;	int ret;	if (filp->f_flags & O_EXCL)   return -EBUSY; /* No exclusive opens */	if (!drm_cpu_valid())        return -EINVAL;	DRM_DEBUG("pid = %d, minor = %d\n", current->pid, minor);	priv		    = drm_alloc(sizeof(*priv), DRM_MEM_FILES);	if(!priv) return -ENOMEM;	memset(priv, 0, sizeof(*priv));	filp->private_data  = priv;	priv->uid	    = current->euid;	priv->pid	    = current->pid;	priv->minor	    = minor;	priv->head          = drm_heads[minor];	priv->ioctl_count   = 0;	priv->authenticated = capable(CAP_SYS_ADMIN);	priv->lock_count    = 0;	if (dev->driver->open_helper) {		ret=dev->driver->open_helper(dev, priv);		if (ret < 0)			goto out_free;	}	down(&dev->struct_sem);	if (!dev->file_last) {		priv->next	= NULL;		priv->prev	= NULL;		dev->file_first = priv;		dev->file_last	= priv;	} else {		priv->next	     = NULL;		priv->prev	     = dev->file_last;		dev->file_last->next = priv;		dev->file_last	     = priv;	}	up(&dev->struct_sem);#ifdef __alpha__	/*	 * Default the hose	 */	if (!dev->hose) {		struct pci_dev *pci_dev;		pci_dev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, NULL);		if (pci_dev) {			dev->hose = pci_dev->sysdata;			pci_dev_put(pci_dev);		}		if (!dev->hose) {			struct pci_bus *b = pci_bus_b(pci_root_buses.next);			if (b) dev->hose = b->sysdata;		}	}#endif	return 0;out_free:	drm_free(priv, sizeof(*priv), DRM_MEM_FILES);	filp->private_data=NULL;	return ret;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/c94f70298529d99ac6e1ee7709f61eab00adeb39/drm_fops.c/clean/drivers/char/drm/drm_fops.c