aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-06-01 17:04:45 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-10 17:35:36 -0400
commit3b759c75febd8f9ce91a05705ec43eb7f4b5ed3d (patch)
tree56b5dcc1d2c83af6548ebb5951f582630a96653b
parent1548b13b75a2ec06f46220004e91c37818be6c18 (diff)
USB: mon: kill BKL usage
compat_ioctl does not use the BKL, so I assume that the native function does not need it either. The open function is already protected by the driver's mutex, the BKL is probably not needed here either. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/mon/mon_bin.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c
index 61c76b13f0f1..1be0b9f93366 100644
--- a/drivers/usb/mon/mon_bin.c
+++ b/drivers/usb/mon/mon_bin.c
@@ -646,17 +646,14 @@ static int mon_bin_open(struct inode *inode, struct file *file)
646 size_t size; 646 size_t size;
647 int rc; 647 int rc;
648 648
649 lock_kernel();
650 mutex_lock(&mon_lock); 649 mutex_lock(&mon_lock);
651 if ((mbus = mon_bus_lookup(iminor(inode))) == NULL) { 650 if ((mbus = mon_bus_lookup(iminor(inode))) == NULL) {
652 mutex_unlock(&mon_lock); 651 mutex_unlock(&mon_lock);
653 unlock_kernel();
654 return -ENODEV; 652 return -ENODEV;
655 } 653 }
656 if (mbus != &mon_bus0 && mbus->u_bus == NULL) { 654 if (mbus != &mon_bus0 && mbus->u_bus == NULL) {
657 printk(KERN_ERR TAG ": consistency error on open\n"); 655 printk(KERN_ERR TAG ": consistency error on open\n");
658 mutex_unlock(&mon_lock); 656 mutex_unlock(&mon_lock);
659 unlock_kernel();
660 return -ENODEV; 657 return -ENODEV;
661 } 658 }
662 659
@@ -689,7 +686,6 @@ static int mon_bin_open(struct inode *inode, struct file *file)
689 686
690 file->private_data = rp; 687 file->private_data = rp;
691 mutex_unlock(&mon_lock); 688 mutex_unlock(&mon_lock);
692 unlock_kernel();
693 return 0; 689 return 0;
694 690
695err_allocbuff: 691err_allocbuff:
@@ -698,7 +694,6 @@ err_allocvec:
698 kfree(rp); 694 kfree(rp);
699err_alloc: 695err_alloc:
700 mutex_unlock(&mon_lock); 696 mutex_unlock(&mon_lock);
701 unlock_kernel();
702 return rc; 697 return rc;
703} 698}
704 699
@@ -954,7 +949,7 @@ static int mon_bin_queued(struct mon_reader_bin *rp)
954 949
955/* 950/*
956 */ 951 */
957static int mon_bin_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 952static long mon_bin_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
958{ 953{
959 struct mon_reader_bin *rp = file->private_data; 954 struct mon_reader_bin *rp = file->private_data;
960 // struct mon_bus* mbus = rp->r.m_bus; 955 // struct mon_bus* mbus = rp->r.m_bus;
@@ -1094,19 +1089,6 @@ static int mon_bin_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
1094 return ret; 1089 return ret;
1095} 1090}
1096 1091
1097static long mon_bin_unlocked_ioctl(struct file *file, unsigned int cmd,
1098 unsigned long arg)
1099{
1100 int ret;
1101
1102 lock_kernel();
1103 ret = mon_bin_ioctl(file, cmd, arg);
1104 unlock_kernel();
1105
1106 return ret;
1107}
1108
1109
1110#ifdef CONFIG_COMPAT 1092#ifdef CONFIG_COMPAT
1111static long mon_bin_compat_ioctl(struct file *file, 1093static long mon_bin_compat_ioctl(struct file *file,
1112 unsigned int cmd, unsigned long arg) 1094 unsigned int cmd, unsigned long arg)
@@ -1250,7 +1232,7 @@ static const struct file_operations mon_fops_binary = {
1250 .read = mon_bin_read, 1232 .read = mon_bin_read,
1251 /* .write = mon_text_write, */ 1233 /* .write = mon_text_write, */
1252 .poll = mon_bin_poll, 1234 .poll = mon_bin_poll,
1253 .unlocked_ioctl = mon_bin_unlocked_ioctl, 1235 .unlocked_ioctl = mon_bin_ioctl,
1254#ifdef CONFIG_COMPAT 1236#ifdef CONFIG_COMPAT
1255 .compat_ioctl = mon_bin_compat_ioctl, 1237 .compat_ioctl = mon_bin_compat_ioctl,
1256#endif 1238#endif