drivers: Push down BKL into various drivers
These are the last remaining device drivers using the ->ioctl file operation in the drivers directory (except from v4l drivers). [fweisbec: drop i8k pushdown as it has been done from procfs pushdown branch already] Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
This commit is contained in:
committed by
Frederic Weisbecker
parent
703c631ebb
commit
55929332c9
@@ -26,6 +26,7 @@
|
||||
#include <linux/sched.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/miscdevice.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/wait.h>
|
||||
@@ -106,8 +107,7 @@ static unsigned int DeviceErrorCount; /* number of device error */
|
||||
|
||||
static ssize_t ac_read (struct file *, char __user *, size_t, loff_t *);
|
||||
static ssize_t ac_write (struct file *, const char __user *, size_t, loff_t *);
|
||||
static int ac_ioctl(struct inode *, struct file *, unsigned int,
|
||||
unsigned long);
|
||||
static long ac_ioctl(struct file *, unsigned int, unsigned long);
|
||||
static irqreturn_t ac_interrupt(int, void *);
|
||||
|
||||
static const struct file_operations ac_fops = {
|
||||
@@ -115,7 +115,7 @@ static const struct file_operations ac_fops = {
|
||||
.llseek = no_llseek,
|
||||
.read = ac_read,
|
||||
.write = ac_write,
|
||||
.ioctl = ac_ioctl,
|
||||
.unlocked_ioctl = ac_ioctl,
|
||||
};
|
||||
|
||||
static struct miscdevice ac_miscdev = {
|
||||
@@ -689,7 +689,7 @@ static irqreturn_t ac_interrupt(int vec, void *dev_instance)
|
||||
|
||||
|
||||
|
||||
static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
|
||||
static long ac_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
|
||||
{ /* @ ADG ou ATO selon le cas */
|
||||
int i;
|
||||
@@ -711,7 +711,8 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
|
||||
kfree(adgl);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
|
||||
lock_kernel();
|
||||
IndexCard = adgl->num_card-1;
|
||||
|
||||
if(cmd != 6 && ((IndexCard >= MAX_BOARD) || !apbs[IndexCard].RamIO)) {
|
||||
@@ -721,6 +722,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
|
||||
warncount--;
|
||||
}
|
||||
kfree(adgl);
|
||||
unlock_kernel();
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -838,6 +840,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
|
||||
}
|
||||
Dummy = readb(apbs[IndexCard].RamIO + VERS);
|
||||
kfree(adgl);
|
||||
unlock_kernel();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user