aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/usbtest.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-25 15:40:57 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-25 15:40:57 -0400
commit37b05b17985ecc43a33e2a8cbdaa220115de4703 (patch)
tree8213bf790182711677018ed322a9ccf61470242e /drivers/usb/misc/usbtest.c
parentce1d5b23a8d1e19866ab82bdec0dc41fde5273d8 (diff)
parent4953d141dc5db748475001cfbfdcc42e66cf900e (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (120 commits) usb: don't update devnum for wusb devices wusb: make ep0_reinit available for modules wusb: devices dont use a set address wusb: teach choose_address() about wireless devices wusb: add link wusb-usb device wusb: add authenticathed bit to usb_dev USB: remove unnecessary type casting of urb->context usb serial: more fixes and groundwork for tty changes USB: replace remaining __FUNCTION__ occurrences USB: usbfs: export the URB_NO_INTERRUPT flag to userspace USB: fix compile problems in ehci-hcd USB: ehci: qh_completions cleanup and bugfix USB: cdc-acm: signedness fix USB: add documentation about callbacks USB: don't explicitly reenable root-hub status interrupts USB: OHCI: turn off RD when remote wakeup is disabled USB: HCDs use the do_remote_wakeup flag USB: g_file_storage: ignore bulk-out data after invalid CBW USB: serial: remove endpoints setting checks from core and header USB: serial: remove unneeded number endpoints settings ...
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 b6b5b2affad1..a51983854ca0 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 }