Also fix the unknown ioctl return code
Signed-off-by: Alan Cox <alan@redhat.com>
diff --git a/drivers/usb/misc/auerswald.c b/drivers/usb/misc/auerswald.c
index 0939386..d2f61d5 100644
--- a/drivers/usb/misc/auerswald.c
+++ b/drivers/usb/misc/auerswald.c
@@ -1421,7 +1421,8 @@ ofail: mutex_unlock(&cp->mutex);
/* 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;
int ret = 0;
@@ -1452,7 +1453,7 @@ static int auerchar_ioctl (struct inode *inode, struct file *file, unsigned int
mutex_unlock(&ccp->mutex);
return -ENODEV;
}
-
+ lock_kernel();
switch (cmd) {
/* return != 0 if Transmitt channel ready to send */
@@ -1547,9 +1548,10 @@ static int auerchar_ioctl (struct inode *inode, struct file *file, unsigned int
default:
dbg ("IOCTL_AU_UNKNOWN");
- ret = -ENOIOCTLCMD;
+ ret = -ENOTTY;
break;
}
+ unlock_kernel();
/* release the mutexes */
mutex_unlock(&cp->mutex);
mutex_unlock(&ccp->mutex);
@@ -1860,7 +1862,7 @@ static const struct file_operations auerswald_fops =
.llseek = no_llseek,
.read = auerchar_read,
.write = auerchar_write,
- .ioctl = auerchar_ioctl,
+ .unlocked_ioctl = auerchar_ioctl,
.open = auerchar_open,
.release = auerchar_release,
};
--
| Joe Perches | [PATCH 010/148] include/asm-x86/bitops.h: checkpatch cleanups - formatting only |
| Con Kolivas | Re: [REPORT] cfs-v4 vs sd-0.44 |
| Randy Dunlap | Re: 2.6.25-rc2-mm1 (wakeup) |
| Greg Kroah-Hartman | [PATCH 006/196] Chinese: add translation of oops-tracing.txt |
git: | |
| Kevin Ballard | Re: git on MacOSX and files with decomposed utf-8 file names |
| Ingo Molnar | [OT] Your branch is ahead of the tracked remote branch 'origin/master' by 50 commi... |
| Mark Levedahl | rc4 - make quick-install-doc is broken |
| Dmitry Potapov | Re: I'm a total push-over.. |
| Richard Stallman | Real men don't attack straw men |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Richard Stallman | Re: Real men don't attack straw men |
| David Newman | setting dscp or tos bits |
| Radu Rendec | Endianness problem with u32 classifier hash masks |
| Bruno Randolf | [PATCH] add macro for printing mac addresses |
| Jeff Kirsher | [NET-NEXT PATCH 0/9] e1000: update and cleanups |
| Andrew Morton | Re: [BUG] New Kernel Bugs |
