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, 7 insertions, 6 deletions
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index b6b5b2affad..a51983854ca 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -201,7 +201,7 @@ found:
201 201
202static void simple_callback (struct urb *urb) 202static void simple_callback (struct urb *urb)
203{ 203{
204 complete ((struct completion *) urb->context); 204 complete(urb->context);
205} 205}
206 206
207static struct urb *simple_alloc_urb ( 207static struct urb *simple_alloc_urb (
@@ -1046,7 +1046,7 @@ static void unlink1_callback (struct urb *urb)
1046 status = usb_submit_urb (urb, GFP_ATOMIC); 1046 status = usb_submit_urb (urb, GFP_ATOMIC);
1047 if (status) { 1047 if (status) {
1048 urb->status = status; 1048 urb->status = status;
1049 complete ((struct completion *) urb->context); 1049 complete(urb->context);
1050 } 1050 }
1051} 1051}
1052 1052
@@ -1136,7 +1136,7 @@ static int verify_not_halted (int ep, struct urb *urb)
1136 dbg ("ep %02x bogus status: %04x != 0", ep, status); 1136 dbg ("ep %02x bogus status: %04x != 0", ep, status);
1137 return -EINVAL; 1137 return -EINVAL;
1138 } 1138 }
1139 retval = simple_io (urb, 1, 0, 0, __FUNCTION__); 1139 retval = simple_io (urb, 1, 0, 0, __func__);
1140 if (retval != 0) 1140 if (retval != 0)
1141 return -EINVAL; 1141 return -EINVAL;
1142 return 0; 1142 return 0;
@@ -1158,7 +1158,7 @@ static int verify_halted (int ep, struct urb *urb)
1158 dbg ("ep %02x bogus status: %04x != 1", ep, status); 1158 dbg ("ep %02x bogus status: %04x != 1", ep, status);
1159 return -EINVAL; 1159 return -EINVAL;
1160 } 1160 }
1161 retval = simple_io (urb, 1, 0, -EPIPE, __FUNCTION__); 1161 retval = simple_io (urb, 1, 0, -EPIPE, __func__);
1162 if (retval != -EPIPE) 1162 if (retval != -EPIPE)
1163 return -EINVAL; 1163 return -EINVAL;
1164 retval = simple_io (urb, 1, 0, -EPIPE, "verify_still_halted"); 1164 retval = simple_io (urb, 1, 0, -EPIPE, "verify_still_halted");
@@ -1404,7 +1404,7 @@ static struct urb *iso_alloc_urb (
1404 return NULL; 1404 return NULL;
1405 maxp = 0x7ff & le16_to_cpu(desc->wMaxPacketSize); 1405 maxp = 0x7ff & le16_to_cpu(desc->wMaxPacketSize);
1406 maxp *= 1 + (0x3 & (le16_to_cpu(desc->wMaxPacketSize) >> 11)); 1406 maxp *= 1 + (0x3 & (le16_to_cpu(desc->wMaxPacketSize) >> 11));
1407 packets = (bytes + maxp - 1) / maxp; 1407 packets = DIV_ROUND_UP(bytes, maxp);
1408 1408
1409 urb = usb_alloc_urb (packets, GFP_KERNEL); 1409 urb = usb_alloc_urb (packets, GFP_KERNEL);
1410 if (!urb) 1410 if (!urb)
@@ -1564,7 +1564,8 @@ usbtest_ioctl (struct usb_interface *intf, unsigned int code, void *buf)
1564 if (mutex_lock_interruptible(&dev->lock)) 1564 if (mutex_lock_interruptible(&dev->lock))
1565 return -ERESTARTSYS; 1565 return -ERESTARTSYS;
1566 1566
1567 if (intf->dev.power.power_state.event != PM_EVENT_ON) { 1567 /* FIXME: What if a system sleep starts while a test is running? */
1568 if (!intf->is_active) {
1568 mutex_unlock(&dev->lock); 1569 mutex_unlock(&dev->lock);
1569 return -EHOSTUNREACH; 1570 return -EHOSTUNREACH;
1570 } 1571 }