staging: Pushdown bkl to easycap ioctl handlers
These were amongst the last users of struct file_operations:ioctl Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
This commit is contained in:
parent
d9a145fb6e
commit
5ef06839f5
3 changed files with 51 additions and 47 deletions
|
@ -463,15 +463,12 @@ struct data_buffer audio_buffer[];
|
|||
void easycap_complete(struct urb *);
|
||||
int easycap_open(struct inode *, struct file *);
|
||||
int easycap_release(struct inode *, struct file *);
|
||||
int easycap_ioctl(struct inode *, struct file *, \
|
||||
unsigned int, unsigned long);
|
||||
long easycap_ioctl(struct file *, unsigned int, unsigned long);
|
||||
|
||||
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
||||
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
|
||||
int easycap_open_noinode(struct file *);
|
||||
int easycap_release_noinode(struct file *);
|
||||
long easycap_ioctl_noinode(struct file *, \
|
||||
unsigned int, unsigned long);
|
||||
int videodev_release(struct video_device *);
|
||||
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
|
||||
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
|
||||
|
@ -515,8 +512,7 @@ void easysnd_complete(struct urb *);
|
|||
ssize_t easysnd_read(struct file *, char __user *, size_t, loff_t *);
|
||||
int easysnd_open(struct inode *, struct file *);
|
||||
int easysnd_release(struct inode *, struct file *);
|
||||
int easysnd_ioctl(struct inode *, struct file *, \
|
||||
unsigned int, unsigned long);
|
||||
long easysnd_ioctl(struct file *, unsigned int, unsigned long);
|
||||
unsigned int easysnd_poll(struct file *, poll_table *);
|
||||
void easysnd_delete(struct kref *);
|
||||
int submit_audio_urbs(struct easycap *);
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
*/
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <linux/smp_lock.h>
|
||||
#include "easycap.h"
|
||||
#include "easycap_debug.h"
|
||||
#include "easycap_standard.h"
|
||||
|
@ -773,18 +774,9 @@ while (0xFFFFFFFF != easycap_control[i1].id) {
|
|||
SAY("WARNING: failed to adjust mute: control not found\n");
|
||||
return -ENOENT;
|
||||
}
|
||||
/****************************************************************************/
|
||||
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
||||
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
|
||||
long
|
||||
easycap_ioctl_noinode(struct file *file, unsigned int cmd, unsigned long arg)\
|
||||
{
|
||||
return easycap_ioctl((struct inode *)NULL, file, cmd, arg);
|
||||
}
|
||||
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
|
||||
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
int easycap_ioctl(struct inode *inode, struct file *file, \
|
||||
static int easycap_ioctl_bkl(struct inode *inode, struct file *file,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
static struct easycap *peasycap;
|
||||
|
@ -1956,18 +1948,21 @@ default: {
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
/****************************************************************************/
|
||||
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
||||
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
|
||||
long
|
||||
easysnd_ioctl_noinode(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
|
||||
long easycap_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
return easysnd_ioctl((struct inode *)NULL, file, cmd, arg);
|
||||
struct inode *inode = file->f_dentry->d_inode;
|
||||
long ret;
|
||||
|
||||
lock_kernel();
|
||||
ret = easycap_ioctl_bkl(inode, file, cmd, arg);
|
||||
unlock_kernel();
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
|
||||
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
int easysnd_ioctl(struct inode *inode, struct file *file, \
|
||||
static int easysnd_ioctl_bkl(struct inode *inode, struct file *file,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct easycap *peasycap;
|
||||
|
@ -2158,6 +2153,19 @@ default: {
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
long easysnd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct inode *inode = file->f_dentry->d_inode;
|
||||
long ret;
|
||||
|
||||
lock_kernel();
|
||||
ret = easysnd_ioctl_bkl(inode, file, cmd, arg);
|
||||
unlock_kernel();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
int explain_ioctl(__u32 wot)
|
||||
{
|
||||
|
|
|
@ -63,7 +63,7 @@ const struct file_operations easycap_fops = {
|
|||
.owner = THIS_MODULE,
|
||||
.open = easycap_open,
|
||||
.release = easycap_release,
|
||||
.ioctl = easycap_ioctl,
|
||||
.unlocked_ioctl = easycap_ioctl,
|
||||
.poll = easycap_poll,
|
||||
.mmap = easycap_mmap,
|
||||
.llseek = no_llseek,
|
||||
|
@ -86,7 +86,7 @@ const struct v4l2_file_operations v4l2_fops = {
|
|||
.owner = THIS_MODULE,
|
||||
.open = easycap_open_noinode,
|
||||
.release = easycap_release_noinode,
|
||||
.ioctl = easycap_ioctl_noinode,
|
||||
.unlocked_ioctl = easycap_ioctl,
|
||||
.poll = easycap_poll,
|
||||
.mmap = easycap_mmap,
|
||||
};
|
||||
|
@ -105,7 +105,7 @@ const struct file_operations easysnd_fops = {
|
|||
.owner = THIS_MODULE,
|
||||
.open = easysnd_open,
|
||||
.release = easysnd_release,
|
||||
.ioctl = easysnd_ioctl,
|
||||
.unlocked_ioctl = easysnd_ioctl,
|
||||
.read = easysnd_read,
|
||||
.llseek = no_llseek,
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue