diff options
Diffstat (limited to 'drivers/usb/misc')
-rw-r--r-- | drivers/usb/misc/adutux.c | 1 | ||||
-rw-r--r-- | drivers/usb/misc/cypress_cy7c63.c | 1 | ||||
-rw-r--r-- | drivers/usb/misc/cytherm.c | 1 | ||||
-rw-r--r-- | drivers/usb/misc/emi26.c | 1 | ||||
-rw-r--r-- | drivers/usb/misc/emi62.c | 1 | ||||
-rw-r--r-- | drivers/usb/misc/ezusb.c | 1 | ||||
-rw-r--r-- | drivers/usb/misc/idmouse.c | 3 | ||||
-rw-r--r-- | drivers/usb/misc/iowarrior.c | 3 | ||||
-rw-r--r-- | drivers/usb/misc/ldusb.c | 1 | ||||
-rw-r--r-- | drivers/usb/misc/legousbtower.c | 1 | ||||
-rw-r--r-- | drivers/usb/misc/rio500.c | 1 | ||||
-rw-r--r-- | drivers/usb/misc/sisusbvga/sisusb_init.c | 1 | ||||
-rw-r--r-- | drivers/usb/misc/trancevibrator.c | 1 | ||||
-rw-r--r-- | drivers/usb/misc/usblcd.c | 1 | ||||
-rw-r--r-- | drivers/usb/misc/usbled.c | 1 | ||||
-rw-r--r-- | drivers/usb/misc/usbsevseg.c | 3 | ||||
-rw-r--r-- | drivers/usb/misc/usbtest.c | 42 | ||||
-rw-r--r-- | drivers/usb/misc/yurex.c | 3 |
18 files changed, 38 insertions, 29 deletions
diff --git a/drivers/usb/misc/adutux.c b/drivers/usb/misc/adutux.c index 3eaa83f0508..493c7f268b6 100644 --- a/drivers/usb/misc/adutux.c +++ b/drivers/usb/misc/adutux.c @@ -22,7 +22,6 @@ #include <linux/kernel.h> #include <linux/errno.h> -#include <linux/init.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/usb.h> diff --git a/drivers/usb/misc/cypress_cy7c63.c b/drivers/usb/misc/cypress_cy7c63.c index 3f7c1a92579..402b94dd253 100644 --- a/drivers/usb/misc/cypress_cy7c63.c +++ b/drivers/usb/misc/cypress_cy7c63.c @@ -29,7 +29,6 @@ * published by the Free Software Foundation, version 2. */ -#include <linux/init.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/slab.h> diff --git a/drivers/usb/misc/cytherm.c b/drivers/usb/misc/cytherm.c index 5b9831b95d9..9bab1a33bc1 100644 --- a/drivers/usb/misc/cytherm.c +++ b/drivers/usb/misc/cytherm.c @@ -16,7 +16,6 @@ #include <linux/kernel.h> #include <linux/errno.h> -#include <linux/init.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/usb.h> diff --git a/drivers/usb/misc/emi26.c b/drivers/usb/misc/emi26.c index d65984dee75..8950fa5e973 100644 --- a/drivers/usb/misc/emi26.c +++ b/drivers/usb/misc/emi26.c @@ -13,7 +13,6 @@ #include <linux/errno.h> #include <linux/slab.h> #include <linux/module.h> -#include <linux/init.h> #include <linux/usb.h> #include <linux/delay.h> #include <linux/firmware.h> diff --git a/drivers/usb/misc/emi62.c b/drivers/usb/misc/emi62.c index ae794b90766..1d9be4431b7 100644 --- a/drivers/usb/misc/emi62.c +++ b/drivers/usb/misc/emi62.c @@ -10,7 +10,6 @@ #include <linux/kernel.h> #include <linux/errno.h> #include <linux/slab.h> -#include <linux/init.h> #include <linux/module.h> #include <linux/usb.h> #include <linux/delay.h> diff --git a/drivers/usb/misc/ezusb.c b/drivers/usb/misc/ezusb.c index e712afed947..947811bc812 100644 --- a/drivers/usb/misc/ezusb.c +++ b/drivers/usb/misc/ezusb.c @@ -9,7 +9,6 @@ */ #include <linux/kernel.h> -#include <linux/init.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/usb.h> diff --git a/drivers/usb/misc/idmouse.c b/drivers/usb/misc/idmouse.c index ce978384fda..4e38683c653 100644 --- a/drivers/usb/misc/idmouse.c +++ b/drivers/usb/misc/idmouse.c @@ -19,7 +19,6 @@ #include <linux/kernel.h> #include <linux/errno.h> #include <linux/delay.h> -#include <linux/init.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/completion.h> @@ -386,7 +385,7 @@ static int idmouse_probe(struct usb_interface *interface, result = usb_register_dev(interface, &idmouse_class); if (result) { /* something prevented us from registering this device */ - dev_err(&interface->dev, "Unble to allocate minor number.\n"); + dev_err(&interface->dev, "Unable to allocate minor number.\n"); usb_set_intfdata(interface, NULL); idmouse_delete(dev); return result; diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index d36f34e25be..20bcfdd7eac 100644 --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c @@ -15,7 +15,6 @@ #include <linux/module.h> #include <linux/usb.h> -#include <linux/init.h> #include <linux/slab.h> #include <linux/sched.h> #include <linux/mutex.h> @@ -300,7 +299,7 @@ static ssize_t iowarrior_read(struct file *file, char __user *buffer, do { atomic_set(&dev->overflow_flag, 0); if ((read_idx = read_index(dev)) == -1) { - /* queue emty */ + /* queue empty */ if (file->f_flags & O_NONBLOCK) return -EAGAIN; else { diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c index b1d59532ac2..82503a7ff6c 100644 --- a/drivers/usb/misc/ldusb.c +++ b/drivers/usb/misc/ldusb.c @@ -24,7 +24,6 @@ #include <linux/kernel.h> #include <linux/errno.h> -#include <linux/init.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/mutex.h> diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c index eb37c954205..97cd9e24bd2 100644 --- a/drivers/usb/misc/legousbtower.c +++ b/drivers/usb/misc/legousbtower.c @@ -79,7 +79,6 @@ #include <linux/kernel.h> #include <linux/errno.h> -#include <linux/init.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/completion.h> diff --git a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c index b9b356a9dd1..13731d51262 100644 --- a/drivers/usb/misc/rio500.c +++ b/drivers/usb/misc/rio500.c @@ -36,7 +36,6 @@ #include <linux/errno.h> #include <linux/random.h> #include <linux/poll.h> -#include <linux/init.h> #include <linux/slab.h> #include <linux/spinlock.h> #include <linux/usb.h> diff --git a/drivers/usb/misc/sisusbvga/sisusb_init.c b/drivers/usb/misc/sisusbvga/sisusb_init.c index cb8a3d91f97..bf0032ca35e 100644 --- a/drivers/usb/misc/sisusbvga/sisusb_init.c +++ b/drivers/usb/misc/sisusbvga/sisusb_init.c @@ -40,7 +40,6 @@ #include <linux/kernel.h> #include <linux/errno.h> #include <linux/poll.h> -#include <linux/init.h> #include <linux/spinlock.h> #include "sisusb.h" diff --git a/drivers/usb/misc/trancevibrator.c b/drivers/usb/misc/trancevibrator.c index 741efed4a23..4145314a515 100644 --- a/drivers/usb/misc/trancevibrator.c +++ b/drivers/usb/misc/trancevibrator.c @@ -21,7 +21,6 @@ /* Standard include files */ #include <linux/kernel.h> #include <linux/errno.h> -#include <linux/init.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/usb.h> diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c index 89927bcff97..1184390508e 100644 --- a/drivers/usb/misc/usblcd.c +++ b/drivers/usb/misc/usblcd.c @@ -14,7 +14,6 @@ *****************************************************************************/ #include <linux/module.h> #include <linux/kernel.h> -#include <linux/init.h> #include <linux/slab.h> #include <linux/errno.h> #include <linux/mutex.h> diff --git a/drivers/usb/misc/usbled.c b/drivers/usb/misc/usbled.c index 12d03e7ad63..78eb4ff3326 100644 --- a/drivers/usb/misc/usbled.c +++ b/drivers/usb/misc/usbled.c @@ -11,7 +11,6 @@ #include <linux/kernel.h> #include <linux/errno.h> -#include <linux/init.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/usb.h> diff --git a/drivers/usb/misc/usbsevseg.c b/drivers/usb/misc/usbsevseg.c index b2d82b93739..1fe6b73c22f 100644 --- a/drivers/usb/misc/usbsevseg.c +++ b/drivers/usb/misc/usbsevseg.c @@ -12,7 +12,6 @@ #include <linux/kernel.h> #include <linux/errno.h> -#include <linux/init.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/string.h> @@ -57,7 +56,7 @@ struct usb_sevsegdev { * if str commands are used, we would assume the end of string * so mem commands are used. */ -inline size_t my_memlen(const char *buf, size_t count) +static inline size_t my_memlen(const char *buf, size_t count) { if (count > 0 && buf[count-1] == '\n') return count - 1; diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index b4152820d65..f6568b5e9b0 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c @@ -10,6 +10,7 @@ #include <linux/usb.h> +#define SIMPLE_IO_TIMEOUT 10000 /* in milliseconds */ /*-------------------------------------------------------------------------*/ @@ -366,6 +367,7 @@ static int simple_io( int max = urb->transfer_buffer_length; struct completion completion; int retval = 0; + unsigned long expire; urb->context = &completion; while (retval == 0 && iterations-- > 0) { @@ -378,9 +380,15 @@ static int simple_io( if (retval != 0) break; - /* NOTE: no timeouts; can't be broken out of by interrupt */ - wait_for_completion(&completion); - retval = urb->status; + expire = msecs_to_jiffies(SIMPLE_IO_TIMEOUT); + if (!wait_for_completion_timeout(&completion, expire)) { + usb_kill_urb(urb); + retval = (urb->status == -ENOENT ? + -ETIMEDOUT : urb->status); + } else { + retval = urb->status; + } + urb->dev = udev; if (retval == 0 && usb_pipein(urb->pipe)) retval = simple_check_buf(tdev, urb); @@ -619,8 +627,8 @@ static int is_good_ext(struct usbtest_dev *tdev, u8 *buf) } attr = le32_to_cpu(ext->bmAttributes); - /* bits[1:4] is used and others are reserved */ - if (attr & ~0x1e) { /* reserved == 0 */ + /* bits[1:15] is used and others are reserved */ + if (attr & ~0xfffe) { /* reserved == 0 */ ERROR(tdev, "reserved bits set\n"); return 0; } @@ -763,7 +771,7 @@ static int ch9_postconfig(struct usbtest_dev *dev) * there's always [9.4.3] a bos device descriptor [9.6.2] in USB * 3.0 spec */ - if (le16_to_cpu(udev->descriptor.bcdUSB) >= 0x0300) { + if (le16_to_cpu(udev->descriptor.bcdUSB) >= 0x0210) { struct usb_bos_descriptor *bos = NULL; struct usb_dev_cap_header *header = NULL; unsigned total, num, length; @@ -944,7 +952,7 @@ struct ctrl_ctx { int last; }; -#define NUM_SUBCASES 15 /* how many test subcases here? */ +#define NUM_SUBCASES 16 /* how many test subcases here? */ struct subcase { struct usb_ctrlrequest setup; @@ -1218,6 +1226,15 @@ test_ctrl_queue(struct usbtest_dev *dev, struct usbtest_param *param) } expected = -EREMOTEIO; break; + case 15: + req.wValue = cpu_to_le16(USB_DT_BOS << 8); + if (udev->bos) + len = le16_to_cpu(udev->bos->desc->wTotalLength); + else + len = sizeof(struct usb_bos_descriptor); + if (le16_to_cpu(udev->descriptor.bcdUSB) < 0x0201) + expected = -EPIPE; + break; default: ERROR(dev, "bogus number of ctrl queue testcases!\n"); context.status = -EINVAL; @@ -1537,8 +1554,17 @@ static int test_halt(struct usbtest_dev *tdev, int ep, struct urb *urb) return retval; } retval = verify_halted(tdev, ep, urb); - if (retval < 0) + if (retval < 0) { + int ret; + + /* clear halt anyways, else further tests will fail */ + ret = usb_clear_halt(urb->dev, urb->pipe); + if (ret) + ERROR(tdev, "ep %02x couldn't clear halt, %d\n", + ep, ret); + return retval; + } /* clear halt (tests API + protocol), verify it worked */ retval = usb_clear_halt(urb->dev, urb->pipe); diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c index b6ab515bfc6..24278208bf7 100644 --- a/drivers/usb/misc/yurex.c +++ b/drivers/usb/misc/yurex.c @@ -11,7 +11,6 @@ #include <linux/kernel.h> #include <linux/errno.h> -#include <linux/init.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/kref.h> @@ -464,7 +463,7 @@ static ssize_t yurex_write(struct file *file, const char *user_buffer, size_t co goto error; mutex_lock(&dev->io_mutex); - if (!dev->interface) { /* alreaday disconnected */ + if (!dev->interface) { /* already disconnected */ mutex_unlock(&dev->io_mutex); retval = -ENODEV; goto error; |