git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.3
[linux-2.6.git]
/
drivers
/
char
/
drm
/
drm_fops.h
diff --git
a/drivers/char/drm/drm_fops.h
b/drivers/char/drm/drm_fops.h
index
0aa0244
..
0e91190
100644
(file)
--- a/
drivers/char/drm/drm_fops.h
+++ b/
drivers/char/drm/drm_fops.h
@@
-53,6
+53,7
@@
int DRM(open_helper)(struct inode *inode, struct file *filp, drm_device_t *dev)
{
int minor = iminor(inode);
drm_file_t *priv;
{
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;
if (filp->f_flags & O_EXCL) return -EBUSY; /* No exclusive opens */
if (!DRM(cpu_valid)()) return -EINVAL;
@@
-72,7
+73,11
@@
int DRM(open_helper)(struct inode *inode, struct file *filp, drm_device_t *dev)
priv->authenticated = capable(CAP_SYS_ADMIN);
priv->lock_count = 0;
priv->authenticated = capable(CAP_SYS_ADMIN);
priv->lock_count = 0;
- DRIVER_OPEN_HELPER( priv, dev );
+ if (dev->fn_tbl.open_helper) {
+ ret=dev->fn_tbl.open_helper(dev, priv);
+ if (ret < 0)
+ goto out_free;
+ }
down(&dev->struct_sem);
if (!dev->file_last) {
down(&dev->struct_sem);
if (!dev->file_last) {
@@
-104,6
+109,10
@@
int DRM(open_helper)(struct inode *inode, struct file *filp, drm_device_t *dev)
#endif
return 0;
#endif
return 0;
+out_free:
+ DRM(free)(priv, sizeof(*priv), DRM_MEM_FILES);
+ filp->private_data=NULL;
+ return ret;
}
/** No-op. */
}
/** No-op. */
@@
-130,19
+139,15
@@
int DRM(fasync)(int fd, struct file *filp, int on)
return 0;
}
return 0;
}
-#if !__HAVE_DRIVER_FOPS_POLL
/** No-op. */
unsigned int DRM(poll)(struct file *filp, struct poll_table_struct *wait)
{
return 0;
}
/** No-op. */
unsigned int DRM(poll)(struct file *filp, struct poll_table_struct *wait)
{
return 0;
}
-#endif
-#if !__HAVE_DRIVER_FOPS_READ
/** No-op. */
ssize_t DRM(read)(struct file *filp, char __user *buf, size_t count, loff_t *off)
{
return 0;
}
/** No-op. */
ssize_t DRM(read)(struct file *filp, char __user *buf, size_t count, loff_t *off)
{
return 0;
}
-#endif