diff options
author | Arnd Bergmann <arnd@arndb.de> | 2010-04-26 18:24:05 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2010-05-16 23:27:41 -0400 |
commit | 55929332c92e5d34d65a8f784604c92677ea3e15 (patch) | |
tree | 555e922d470336d07ace32bb564ac5358379a3c4 /drivers/char/applicom.c | |
parent | 703c631ebbcadcfd861d01e697fdda7c388fec9a (diff) |
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>
Diffstat (limited to 'drivers/char/applicom.c')
-rw-r--r-- | drivers/char/applicom.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c index a7424bf7eacf..63313a33ba5f 100644 --- a/drivers/char/applicom.c +++ b/drivers/char/applicom.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/sched.h> | 26 | #include <linux/sched.h> |
27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
28 | #include <linux/errno.h> | 28 | #include <linux/errno.h> |
29 | #include <linux/smp_lock.h> | ||
29 | #include <linux/miscdevice.h> | 30 | #include <linux/miscdevice.h> |
30 | #include <linux/pci.h> | 31 | #include <linux/pci.h> |
31 | #include <linux/wait.h> | 32 | #include <linux/wait.h> |
@@ -106,8 +107,7 @@ static unsigned int DeviceErrorCount; /* number of device error */ | |||
106 | 107 | ||
107 | static ssize_t ac_read (struct file *, char __user *, size_t, loff_t *); | 108 | static ssize_t ac_read (struct file *, char __user *, size_t, loff_t *); |
108 | static ssize_t ac_write (struct file *, const char __user *, size_t, loff_t *); | 109 | static ssize_t ac_write (struct file *, const char __user *, size_t, loff_t *); |
109 | static int ac_ioctl(struct inode *, struct file *, unsigned int, | 110 | static long ac_ioctl(struct file *, unsigned int, unsigned long); |
110 | unsigned long); | ||
111 | static irqreturn_t ac_interrupt(int, void *); | 111 | static irqreturn_t ac_interrupt(int, void *); |
112 | 112 | ||
113 | static const struct file_operations ac_fops = { | 113 | static const struct file_operations ac_fops = { |
@@ -115,7 +115,7 @@ static const struct file_operations ac_fops = { | |||
115 | .llseek = no_llseek, | 115 | .llseek = no_llseek, |
116 | .read = ac_read, | 116 | .read = ac_read, |
117 | .write = ac_write, | 117 | .write = ac_write, |
118 | .ioctl = ac_ioctl, | 118 | .unlocked_ioctl = ac_ioctl, |
119 | }; | 119 | }; |
120 | 120 | ||
121 | static struct miscdevice ac_miscdev = { | 121 | static struct miscdevice ac_miscdev = { |
@@ -689,7 +689,7 @@ static irqreturn_t ac_interrupt(int vec, void *dev_instance) | |||
689 | 689 | ||
690 | 690 | ||
691 | 691 | ||
692 | static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) | 692 | static long ac_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
693 | 693 | ||
694 | { /* @ ADG ou ATO selon le cas */ | 694 | { /* @ ADG ou ATO selon le cas */ |
695 | int i; | 695 | int i; |
@@ -711,7 +711,8 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un | |||
711 | kfree(adgl); | 711 | kfree(adgl); |
712 | return -EFAULT; | 712 | return -EFAULT; |
713 | } | 713 | } |
714 | 714 | ||
715 | lock_kernel(); | ||
715 | IndexCard = adgl->num_card-1; | 716 | IndexCard = adgl->num_card-1; |
716 | 717 | ||
717 | if(cmd != 6 && ((IndexCard >= MAX_BOARD) || !apbs[IndexCard].RamIO)) { | 718 | 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 | |||
721 | warncount--; | 722 | warncount--; |
722 | } | 723 | } |
723 | kfree(adgl); | 724 | kfree(adgl); |
725 | unlock_kernel(); | ||
724 | return -EINVAL; | 726 | return -EINVAL; |
725 | } | 727 | } |
726 | 728 | ||
@@ -838,6 +840,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un | |||
838 | } | 840 | } |
839 | Dummy = readb(apbs[IndexCard].RamIO + VERS); | 841 | Dummy = readb(apbs[IndexCard].RamIO + VERS); |
840 | kfree(adgl); | 842 | kfree(adgl); |
843 | unlock_kernel(); | ||
841 | return 0; | 844 | return 0; |
842 | } | 845 | } |
843 | 846 | ||