mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
USB: Push BKL on open down into the drivers
Straightforward push into the drivers to allow auditing individual drivers separately Signed-off-by: Oliver Neukum <[email protected]> Acked-by: Mauro Carvalho Chehab <[email protected]> Cc: Jiri Kosina <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
f9de332ebf
commit
86266452f8
20 changed files with 99 additions and 15 deletions
|
|
@ -616,10 +616,12 @@ static int dabusb_open (struct inode *inode, struct file *file)
|
|||
{
|
||||
int devnum = iminor(inode);
|
||||
pdabusb_t s;
|
||||
int r;
|
||||
|
||||
if (devnum < DABUSB_MINOR || devnum >= (DABUSB_MINOR + NRDABUSB))
|
||||
return -EIO;
|
||||
|
||||
lock_kernel();
|
||||
s = &dabusb[devnum - DABUSB_MINOR];
|
||||
|
||||
dbg("dabusb_open");
|
||||
|
|
@ -634,6 +636,7 @@ static int dabusb_open (struct inode *inode, struct file *file)
|
|||
msleep_interruptible(500);
|
||||
|
||||
if (signal_pending (current)) {
|
||||
unlock_kernel();
|
||||
return -EAGAIN;
|
||||
}
|
||||
mutex_lock(&s->mutex);
|
||||
|
|
@ -641,6 +644,7 @@ static int dabusb_open (struct inode *inode, struct file *file)
|
|||
if (usb_set_interface (s->usbdev, _DABUSB_IF, 1) < 0) {
|
||||
mutex_unlock(&s->mutex);
|
||||
dev_err(&s->usbdev->dev, "set_interface failed\n");
|
||||
unlock_kernel();
|
||||
return -EINVAL;
|
||||
}
|
||||
s->opened = 1;
|
||||
|
|
@ -649,7 +653,9 @@ static int dabusb_open (struct inode *inode, struct file *file)
|
|||
file->f_pos = 0;
|
||||
file->private_data = s;
|
||||
|
||||
return nonseekable_open(inode, file);
|
||||
r = nonseekable_open(inode, file);
|
||||
unlock_kernel();
|
||||
return r;
|
||||
}
|
||||
|
||||
static int dabusb_release (struct inode *inode, struct file *file)
|
||||
|
|
|
|||
Loading…
Reference in a new issue