aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/iowarrior.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/misc/iowarrior.c')
-rw-r--r--drivers/usb/misc/iowarrior.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index 095778ff984d..37c63cb39714 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -781,12 +781,6 @@ static int iowarrior_probe(struct usb_interface *interface,
781 iface_desc = interface->cur_altsetting; 781 iface_desc = interface->cur_altsetting;
782 dev->product_id = le16_to_cpu(udev->descriptor.idProduct); 782 dev->product_id = le16_to_cpu(udev->descriptor.idProduct);
783 783
784 if (iface_desc->desc.bNumEndpoints < 1) {
785 dev_err(&interface->dev, "Invalid number of endpoints\n");
786 retval = -EINVAL;
787 goto error;
788 }
789
790 /* set up the endpoint information */ 784 /* set up the endpoint information */
791 for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) { 785 for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
792 endpoint = &iface_desc->endpoint[i].desc; 786 endpoint = &iface_desc->endpoint[i].desc;
@@ -797,6 +791,21 @@ static int iowarrior_probe(struct usb_interface *interface,
797 /* this one will match for the IOWarrior56 only */ 791 /* this one will match for the IOWarrior56 only */
798 dev->int_out_endpoint = endpoint; 792 dev->int_out_endpoint = endpoint;
799 } 793 }
794
795 if (!dev->int_in_endpoint) {
796 dev_err(&interface->dev, "no interrupt-in endpoint found\n");
797 retval = -ENODEV;
798 goto error;
799 }
800
801 if (dev->product_id == USB_DEVICE_ID_CODEMERCS_IOW56) {
802 if (!dev->int_out_endpoint) {
803 dev_err(&interface->dev, "no interrupt-out endpoint found\n");
804 retval = -ENODEV;
805 goto error;
806 }
807 }
808
800 /* we have to check the report_size often, so remember it in the endianness suitable for our machine */ 809 /* we have to check the report_size often, so remember it in the endianness suitable for our machine */
801 dev->report_size = usb_endpoint_maxp(dev->int_in_endpoint); 810 dev->report_size = usb_endpoint_maxp(dev->int_in_endpoint);
802 if ((dev->interface->cur_altsetting->desc.bInterfaceNumber == 0) && 811 if ((dev->interface->cur_altsetting->desc.bInterfaceNumber == 0) &&