aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/usbtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/misc/usbtest.c')
-rw-r--r--drivers/usb/misc/usbtest.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index a9f06d76960f..a21cce6f7403 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -213,8 +213,9 @@ static struct urb *simple_alloc_urb (
213} 213}
214 214
215static unsigned pattern = 0; 215static unsigned pattern = 0;
216module_param (pattern, uint, S_IRUGO); 216static unsigned mod_pattern;
217MODULE_PARM_DESC(pattern, "i/o pattern (0 == zeroes)"); 217module_param_named(pattern, mod_pattern, uint, S_IRUGO | S_IWUSR);
218MODULE_PARM_DESC(mod_pattern, "i/o pattern (0 == zeroes)");
218 219
219static inline void simple_fill_buf (struct urb *urb) 220static inline void simple_fill_buf (struct urb *urb)
220{ 221{
@@ -1567,6 +1568,8 @@ usbtest_ioctl (struct usb_interface *intf, unsigned int code, void *buf)
1567 1568
1568 // FIXME USBDEVFS_CONNECTINFO doesn't say how fast the device is. 1569 // FIXME USBDEVFS_CONNECTINFO doesn't say how fast the device is.
1569 1570
1571 pattern = mod_pattern;
1572
1570 if (code != USBTEST_REQUEST) 1573 if (code != USBTEST_REQUEST)
1571 return -EOPNOTSUPP; 1574 return -EOPNOTSUPP;
1572 1575
@@ -1577,10 +1580,6 @@ usbtest_ioctl (struct usb_interface *intf, unsigned int code, void *buf)
1577 return -ERESTARTSYS; 1580 return -ERESTARTSYS;
1578 1581
1579 /* FIXME: What if a system sleep starts while a test is running? */ 1582 /* FIXME: What if a system sleep starts while a test is running? */
1580 if (!intf->is_active) {
1581 mutex_unlock(&dev->lock);
1582 return -EHOSTUNREACH;
1583 }
1584 1583
1585 /* some devices, like ez-usb default devices, need a non-default 1584 /* some devices, like ez-usb default devices, need a non-default
1586 * altsetting to have any active endpoints. some tests change 1585 * altsetting to have any active endpoints. some tests change
@@ -2098,7 +2097,7 @@ static struct usbtest_info generic_info = {
2098#endif 2097#endif
2099 2098
2100 2099
2101static struct usb_device_id id_table [] = { 2100static const struct usb_device_id id_table[] = {
2102 2101
2103 /*-------------------------------------------------------------*/ 2102 /*-------------------------------------------------------------*/
2104 2103