Commit f1b5a7fe authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman

USB: auerwald: Push down the BKL into the driver

Also fix the unknown ioctl return code
Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 824f16fd
...@@ -1421,7 +1421,8 @@ ofail: mutex_unlock(&cp->mutex); ...@@ -1421,7 +1421,8 @@ ofail: mutex_unlock(&cp->mutex);
/* IOCTL functions */ /* IOCTL functions */
static int auerchar_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) static long auerchar_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
{ {
pauerchar_t ccp = (pauerchar_t) file->private_data; pauerchar_t ccp = (pauerchar_t) file->private_data;
int ret = 0; int ret = 0;
...@@ -1452,7 +1453,7 @@ static int auerchar_ioctl (struct inode *inode, struct file *file, unsigned int ...@@ -1452,7 +1453,7 @@ static int auerchar_ioctl (struct inode *inode, struct file *file, unsigned int
mutex_unlock(&ccp->mutex); mutex_unlock(&ccp->mutex);
return -ENODEV; return -ENODEV;
} }
lock_kernel();
switch (cmd) { switch (cmd) {
/* return != 0 if Transmitt channel ready to send */ /* 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,9 +1548,10 @@ static int auerchar_ioctl (struct inode *inode, struct file *file, unsigned int
default: default:
dbg ("IOCTL_AU_UNKNOWN"); dbg ("IOCTL_AU_UNKNOWN");
ret = -ENOIOCTLCMD; ret = -ENOTTY;
break; break;
} }
unlock_kernel();
/* release the mutexes */ /* release the mutexes */
mutex_unlock(&cp->mutex); mutex_unlock(&cp->mutex);
mutex_unlock(&ccp->mutex); mutex_unlock(&ccp->mutex);
...@@ -1860,7 +1862,7 @@ static const struct file_operations auerswald_fops = ...@@ -1860,7 +1862,7 @@ static const struct file_operations auerswald_fops =
.llseek = no_llseek, .llseek = no_llseek,
.read = auerchar_read, .read = auerchar_read,
.write = auerchar_write, .write = auerchar_write,
.ioctl = auerchar_ioctl, .unlocked_ioctl = auerchar_ioctl,
.open = auerchar_open, .open = auerchar_open,
.release = auerchar_release, .release = auerchar_release,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment