USB: usbtest: support test device with only one iso-in or iso-out endpoint
authorMing Lei <tom.leiming@gmail.com>
Mon, 2 Aug 2010 14:09:17 +0000 (22:09 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 10 Aug 2010 21:35:45 +0000 (14:35 -0700)
It is very common that one altsetting may include only one iso-in or iso-out
single endpoint, especially for high bandwidth endpoint, so support it.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/misc/usbtest.c

index d92b7ec9a230d370e1f74e470f3669ea1364ff72..eef370eb7a54d0ef814ddcaa2310b8837f086467 100644 (file)
@@ -136,7 +136,7 @@ try_iso:
                                        iso_out = e;
                        }
                }
-               if ((in && out)  ||  (iso_in && iso_out))
+               if ((in && out)  ||  iso_in || iso_out)
                        goto found;
        }
        return -EINVAL;
@@ -162,6 +162,9 @@ found:
                dev->in_iso_pipe = usb_rcvisocpipe (udev,
                                iso_in->desc.bEndpointAddress
                                        & USB_ENDPOINT_NUMBER_MASK);
+       }
+
+       if (iso_out) {
                dev->iso_out = &iso_out->desc;
                dev->out_iso_pipe = usb_sndisocpipe (udev,
                                iso_out->desc.bEndpointAddress