aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hid/usbhid/hid-core.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index f0339aefc798..d746bf8284dd 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -849,12 +849,6 @@ static int usbhid_start(struct hid_device *hid)
849 } 849 }
850 } 850 }
851 851
852 if (!usbhid->urbin) {
853 err_hid("couldn't find an input interrupt endpoint");
854 ret = -ENODEV;
855 goto fail;
856 }
857
858 init_waitqueue_head(&usbhid->wait); 852 init_waitqueue_head(&usbhid->wait);
859 INIT_WORK(&usbhid->reset_work, hid_reset); 853 INIT_WORK(&usbhid->reset_work, hid_reset);
860 setup_timer(&usbhid->io_retry, hid_retry_timeout, (unsigned long) hid); 854 setup_timer(&usbhid->io_retry, hid_retry_timeout, (unsigned long) hid);
@@ -948,15 +942,26 @@ static struct hid_ll_driver usb_hid_driver = {
948 942
949static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id) 943static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id)
950{ 944{
945 struct usb_host_interface *interface = intf->cur_altsetting;
951 struct usb_device *dev = interface_to_usbdev(intf); 946 struct usb_device *dev = interface_to_usbdev(intf);
952 struct usbhid_device *usbhid; 947 struct usbhid_device *usbhid;
953 struct hid_device *hid; 948 struct hid_device *hid;
949 unsigned int n, has_in = 0;
954 size_t len; 950 size_t len;
955 int ret; 951 int ret;
956 952
957 dbg_hid("HID probe called for ifnum %d\n", 953 dbg_hid("HID probe called for ifnum %d\n",
958 intf->altsetting->desc.bInterfaceNumber); 954 intf->altsetting->desc.bInterfaceNumber);
959 955
956 for (n = 0; n < interface->desc.bNumEndpoints; n++)
957 if (usb_endpoint_is_int_in(&interface->endpoint[n].desc))
958 has_in++;
959 if (!has_in) {
960 dev_err(&intf->dev, "couldn't find an input interrupt "
961 "endpoint\n");
962 return -ENODEV;
963 }
964
960 hid = hid_allocate_device(); 965 hid = hid_allocate_device();
961 if (IS_ERR(hid)) 966 if (IS_ERR(hid))
962 return PTR_ERR(hid); 967 return PTR_ERR(hid);