aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/misc')
-rw-r--r--drivers/usb/misc/auerswald.c10
-rw-r--r--drivers/usb/misc/emi62.c2
-rw-r--r--drivers/usb/misc/ftdi-elan.c24
-rw-r--r--drivers/usb/misc/iowarrior.c8
-rw-r--r--drivers/usb/misc/rio500.c8
-rw-r--r--drivers/usb/misc/sisusbvga/sisusb.c13
-rw-r--r--drivers/usb/misc/usblcd.c6
7 files changed, 25 insertions, 46 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};
diff --git a/drivers/usb/misc/emi62.c b/drivers/usb/misc/emi62.c
index 20886c21e739..5d859ded5bbf 100644
--- a/drivers/usb/misc/emi62.c
+++ b/drivers/usb/misc/emi62.c
@@ -6,8 +6,6 @@
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License, as published by 7 * it under the terms of the GNU General Public License, as published by
8 * the Free Software Foundation, version 2. 8 * the Free Software Foundation, version 2.
9 *
10 * $Id: emi62.c,v 1.15 2002/04/23 06:13:59 tapio Exp $
11 */ 9 */
12#include <linux/kernel.h> 10#include <linux/kernel.h>
13#include <linux/errno.h> 11#include <linux/errno.h>
diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c
index ec88b3bfee46..97c280971532 100644
--- a/drivers/usb/misc/ftdi-elan.c
+++ b/drivers/usb/misc/ftdi-elan.c
@@ -656,29 +656,6 @@ static int ftdi_elan_release(struct inode *inode, struct file *file)
656} 656}
657 657
658 658
659#define FTDI_ELAN_IOC_MAGIC 0xA1
660#define FTDI_ELAN_IOCDEBUG _IOC(_IOC_WRITE, FTDI_ELAN_IOC_MAGIC, 1, 132)
661static int ftdi_elan_ioctl(struct inode *inode, struct file *file,
662 unsigned int cmd, unsigned long arg)
663{
664 switch (cmd) {
665 case FTDI_ELAN_IOCDEBUG:{
666 char line[132];
667 int size = strncpy_from_user(line,
668 (const char __user *)arg, sizeof(line));
669 if (size < 0) {
670 return -EINVAL;
671 } else {
672 printk(KERN_ERR "TODO: ioctl %s\n", line);
673 return 0;
674 }
675 }
676 default:
677 return -EFAULT;
678 }
679}
680
681
682/* 659/*
683* 660*
684* blocking bulk reads are used to get data from the device 661* blocking bulk reads are used to get data from the device
@@ -1222,7 +1199,6 @@ error_1:
1222static const struct file_operations ftdi_elan_fops = { 1199static const struct file_operations ftdi_elan_fops = {
1223 .owner = THIS_MODULE, 1200 .owner = THIS_MODULE,
1224 .llseek = no_llseek, 1201 .llseek = no_llseek,
1225 .ioctl = ftdi_elan_ioctl,
1226 .read = ftdi_elan_read, 1202 .read = ftdi_elan_read,
1227 .write = ftdi_elan_write, 1203 .write = ftdi_elan_write,
1228 .open = ftdi_elan_open, 1204 .open = ftdi_elan_open,
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index 1cb54a28347f..e6ca9979e3ae 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -474,8 +474,8 @@ exit:
474/** 474/**
475 * iowarrior_ioctl 475 * iowarrior_ioctl
476 */ 476 */
477static int iowarrior_ioctl(struct inode *inode, struct file *file, 477static long iowarrior_ioctl(struct file *file, unsigned int cmd,
478 unsigned int cmd, unsigned long arg) 478 unsigned long arg)
479{ 479{
480 struct iowarrior *dev = NULL; 480 struct iowarrior *dev = NULL;
481 __u8 *buffer; 481 __u8 *buffer;
@@ -493,6 +493,7 @@ static int iowarrior_ioctl(struct inode *inode, struct file *file,
493 return -ENOMEM; 493 return -ENOMEM;
494 494
495 /* lock this object */ 495 /* lock this object */
496 lock_kernel();
496 mutex_lock(&dev->mutex); 497 mutex_lock(&dev->mutex);
497 498
498 /* verify that the device wasn't unplugged */ 499 /* verify that the device wasn't unplugged */
@@ -584,6 +585,7 @@ static int iowarrior_ioctl(struct inode *inode, struct file *file,
584error_out: 585error_out:
585 /* unlock the device */ 586 /* unlock the device */
586 mutex_unlock(&dev->mutex); 587 mutex_unlock(&dev->mutex);
588 unlock_kernel();
587 kfree(buffer); 589 kfree(buffer);
588 return retval; 590 return retval;
589} 591}
@@ -719,7 +721,7 @@ static const struct file_operations iowarrior_fops = {
719 .owner = THIS_MODULE, 721 .owner = THIS_MODULE,
720 .write = iowarrior_write, 722 .write = iowarrior_write,
721 .read = iowarrior_read, 723 .read = iowarrior_read,
722 .ioctl = iowarrior_ioctl, 724 .unlocked_ioctl = iowarrior_ioctl,
723 .open = iowarrior_open, 725 .open = iowarrior_open,
724 .release = iowarrior_release, 726 .release = iowarrior_release,
725 .poll = iowarrior_poll, 727 .poll = iowarrior_poll,
diff --git a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c
index 330c18e390b8..248a12aacef6 100644
--- a/drivers/usb/misc/rio500.c
+++ b/drivers/usb/misc/rio500.c
@@ -104,9 +104,7 @@ static int close_rio(struct inode *inode, struct file *file)
104 return 0; 104 return 0;
105} 105}
106 106
107static int 107static long ioctl_rio(struct file *file, unsigned int cmd, unsigned long arg)
108ioctl_rio(struct inode *inode, struct file *file, unsigned int cmd,
109 unsigned long arg)
110{ 108{
111 struct RioCommand rio_cmd; 109 struct RioCommand rio_cmd;
112 struct rio_usb_data *rio = &rio_instance; 110 struct rio_usb_data *rio = &rio_instance;
@@ -116,6 +114,7 @@ ioctl_rio(struct inode *inode, struct file *file, unsigned int cmd,
116 int retries; 114 int retries;
117 int retval=0; 115 int retval=0;
118 116
117 lock_kernel();
119 mutex_lock(&(rio->lock)); 118 mutex_lock(&(rio->lock));
120 /* Sanity check to make sure rio is connected, powered, etc */ 119 /* Sanity check to make sure rio is connected, powered, etc */
121 if (rio->present == 0 || rio->rio_dev == NULL) { 120 if (rio->present == 0 || rio->rio_dev == NULL) {
@@ -254,6 +253,7 @@ ioctl_rio(struct inode *inode, struct file *file, unsigned int cmd,
254 253
255err_out: 254err_out:
256 mutex_unlock(&(rio->lock)); 255 mutex_unlock(&(rio->lock));
256 unlock_kernel();
257 return retval; 257 return retval;
258} 258}
259 259
@@ -433,7 +433,7 @@ file_operations usb_rio_fops = {
433 .owner = THIS_MODULE, 433 .owner = THIS_MODULE,
434 .read = read_rio, 434 .read = read_rio,
435 .write = write_rio, 435 .write = write_rio,
436 .ioctl = ioctl_rio, 436 .unlocked_ioctl = ioctl_rio,
437 .open = open_rio, 437 .open = open_rio,
438 .release = close_rio, 438 .release = close_rio,
439}; 439};
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c
index 33182f4c2267..fbace41a7cba 100644
--- a/drivers/usb/misc/sisusbvga/sisusb.c
+++ b/drivers/usb/misc/sisusbvga/sisusb.c
@@ -2982,9 +2982,8 @@ sisusb_handle_command(struct sisusb_usb_data *sisusb, struct sisusb_command *y,
2982 return retval; 2982 return retval;
2983} 2983}
2984 2984
2985static int 2985static long
2986sisusb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 2986sisusb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
2987 unsigned long arg)
2988{ 2987{
2989 struct sisusb_usb_data *sisusb; 2988 struct sisusb_usb_data *sisusb;
2990 struct sisusb_info x; 2989 struct sisusb_info x;
@@ -2995,6 +2994,7 @@ sisusb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
2995 if (!(sisusb = (struct sisusb_usb_data *)file->private_data)) 2994 if (!(sisusb = (struct sisusb_usb_data *)file->private_data))
2996 return -ENODEV; 2995 return -ENODEV;
2997 2996
2997 lock_kernel();
2998 mutex_lock(&sisusb->lock); 2998 mutex_lock(&sisusb->lock);
2999 2999
3000 /* Sanity check */ 3000 /* Sanity check */
@@ -3053,6 +3053,7 @@ sisusb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
3053 3053
3054err_out: 3054err_out:
3055 mutex_unlock(&sisusb->lock); 3055 mutex_unlock(&sisusb->lock);
3056 unlock_kernel();
3056 return retval; 3057 return retval;
3057} 3058}
3058 3059
@@ -3066,9 +3067,7 @@ sisusb_compat_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
3066 case SISUSB_GET_CONFIG_SIZE: 3067 case SISUSB_GET_CONFIG_SIZE:
3067 case SISUSB_GET_CONFIG: 3068 case SISUSB_GET_CONFIG:
3068 case SISUSB_COMMAND: 3069 case SISUSB_COMMAND:
3069 lock_kernel(); 3070 retval = sisusb_ioctl(f, cmd, arg);
3070 retval = sisusb_ioctl(f->f_path.dentry->d_inode, f, cmd, arg);
3071 unlock_kernel();
3072 return retval; 3071 return retval;
3073 3072
3074 default: 3073 default:
@@ -3087,7 +3086,7 @@ static const struct file_operations usb_sisusb_fops = {
3087#ifdef SISUSB_NEW_CONFIG_COMPAT 3086#ifdef SISUSB_NEW_CONFIG_COMPAT
3088 .compat_ioctl = sisusb_compat_ioctl, 3087 .compat_ioctl = sisusb_compat_ioctl,
3089#endif 3088#endif
3090 .ioctl = sisusb_ioctl 3089 .unlocked_ioctl = sisusb_ioctl
3091}; 3090};
3092 3091
3093static struct usb_class_driver usb_sisusb_class = { 3092static struct usb_class_driver usb_sisusb_class = {
diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c
index 7f7021ee4189..2db4228fbb01 100644
--- a/drivers/usb/misc/usblcd.c
+++ b/drivers/usb/misc/usblcd.c
@@ -146,7 +146,7 @@ static ssize_t lcd_read(struct file *file, char __user * buffer, size_t count, l
146 return retval; 146 return retval;
147} 147}
148 148
149static int lcd_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) 149static long lcd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
150{ 150{
151 struct usb_lcd *dev; 151 struct usb_lcd *dev;
152 u16 bcdDevice; 152 u16 bcdDevice;
@@ -158,12 +158,14 @@ static int lcd_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
158 158
159 switch (cmd) { 159 switch (cmd) {
160 case IOCTL_GET_HARD_VERSION: 160 case IOCTL_GET_HARD_VERSION:
161 lock_kernel();
161 bcdDevice = le16_to_cpu((dev->udev)->descriptor.bcdDevice); 162 bcdDevice = le16_to_cpu((dev->udev)->descriptor.bcdDevice);
162 sprintf(buf,"%1d%1d.%1d%1d", 163 sprintf(buf,"%1d%1d.%1d%1d",
163 (bcdDevice & 0xF000)>>12, 164 (bcdDevice & 0xF000)>>12,
164 (bcdDevice & 0xF00)>>8, 165 (bcdDevice & 0xF00)>>8,
165 (bcdDevice & 0xF0)>>4, 166 (bcdDevice & 0xF0)>>4,
166 (bcdDevice & 0xF)); 167 (bcdDevice & 0xF));
168 unlock_kernel();
167 if (copy_to_user((void __user *)arg,buf,strlen(buf))!=0) 169 if (copy_to_user((void __user *)arg,buf,strlen(buf))!=0)
168 return -EFAULT; 170 return -EFAULT;
169 break; 171 break;
@@ -272,7 +274,7 @@ static const struct file_operations lcd_fops = {
272 .read = lcd_read, 274 .read = lcd_read,
273 .write = lcd_write, 275 .write = lcd_write,
274 .open = lcd_open, 276 .open = lcd_open,
275 .ioctl = lcd_ioctl, 277 .unlocked_ioctl = lcd_ioctl,
276 .release = lcd_release, 278 .release = lcd_release,
277}; 279};
278 280