aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2008-05-22 17:46:25 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-07-21 18:16:20 -0400
commitf1b5a7fe1718393f67fa6222a1cc27f97e12c4b3 (patch)
tree5c56c6225a5450a43f993984c009bd2fb89e5690
parent824f16fda56a88267aba9b2580d7566cf56a0860 (diff)
USB: auerwald: Push down the BKL into the driver
Also fix the unknown ioctl return code Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/misc/auerswald.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/misc/auerswald.c b/drivers/usb/misc/auerswald.c
index 093938697426..d2f61d5510e7 100644
--- a/drivers/usb/misc/auerswald.c
+++ b/drivers/usb/misc/auerswald.c
@@ -1421,7 +1421,8 @@ ofail: mutex_unlock(&cp->mutex);
1421 1421
1422 1422
1423/* IOCTL functions */ 1423/* IOCTL functions */
1424static int auerchar_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) 1424static long auerchar_ioctl(struct file *file, unsigned int cmd,
1425 unsigned long arg)
1425{ 1426{
1426 pauerchar_t ccp = (pauerchar_t) file->private_data; 1427 pauerchar_t ccp = (pauerchar_t) file->private_data;
1427 int ret = 0; 1428 int ret = 0;
@@ -1452,7 +1453,7 @@ static int auerchar_ioctl (struct inode *inode, struct file *file, unsigned int
1452 mutex_unlock(&ccp->mutex); 1453 mutex_unlock(&ccp->mutex);
1453 return -ENODEV; 1454 return -ENODEV;
1454 } 1455 }
1455 1456 lock_kernel();
1456 switch (cmd) { 1457 switch (cmd) {
1457 1458
1458 /* return != 0 if Transmitt channel ready to send */ 1459 /* return != 0 if Transmitt channel ready to send */
@@ -1547,9 +1548,10 @@ static int auerchar_ioctl (struct inode *inode, struct file *file, unsigned int
1547 1548
1548 default: 1549 default:
1549 dbg ("IOCTL_AU_UNKNOWN"); 1550 dbg ("IOCTL_AU_UNKNOWN");
1550 ret = -ENOIOCTLCMD; 1551 ret = -ENOTTY;
1551 break; 1552 break;
1552 } 1553 }
1554 unlock_kernel();
1553 /* release the mutexes */ 1555 /* release the mutexes */
1554 mutex_unlock(&cp->mutex); 1556 mutex_unlock(&cp->mutex);
1555 mutex_unlock(&ccp->mutex); 1557 mutex_unlock(&ccp->mutex);
@@ -1860,7 +1862,7 @@ static const struct file_operations auerswald_fops =
1860 .llseek = no_llseek, 1862 .llseek = no_llseek,
1861 .read = auerchar_read, 1863 .read = auerchar_read,
1862 .write = auerchar_write, 1864 .write = auerchar_write,
1863 .ioctl = auerchar_ioctl, 1865 .unlocked_ioctl = auerchar_ioctl,
1864 .open = auerchar_open, 1866 .open = auerchar_open,
1865 .release = auerchar_release, 1867 .release = auerchar_release,
1866}; 1868};