diff options
Diffstat (limited to 'drivers/usb/input/yealink.c')
-rw-r--r-- | drivers/usb/input/yealink.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/usb/input/yealink.c b/drivers/usb/input/yealink.c index 905bf6398257..caff8e6d7448 100644 --- a/drivers/usb/input/yealink.c +++ b/drivers/usb/input/yealink.c | |||
@@ -859,10 +859,8 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
859 | 859 | ||
860 | interface = intf->cur_altsetting; | 860 | interface = intf->cur_altsetting; |
861 | endpoint = &interface->endpoint[0].desc; | 861 | endpoint = &interface->endpoint[0].desc; |
862 | if (!(endpoint->bEndpointAddress & USB_DIR_IN)) | 862 | if (!usb_endpoint_is_int_in(endpoint)) |
863 | return -EIO; | 863 | return -ENODEV; |
864 | if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) | ||
865 | return -EIO; | ||
866 | 864 | ||
867 | yld = kzalloc(sizeof(struct yealink_dev), GFP_KERNEL); | 865 | yld = kzalloc(sizeof(struct yealink_dev), GFP_KERNEL); |
868 | if (!yld) | 866 | if (!yld) |
@@ -876,17 +874,17 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
876 | 874 | ||
877 | /* allocate usb buffers */ | 875 | /* allocate usb buffers */ |
878 | yld->irq_data = usb_buffer_alloc(udev, USB_PKT_LEN, | 876 | yld->irq_data = usb_buffer_alloc(udev, USB_PKT_LEN, |
879 | SLAB_ATOMIC, &yld->irq_dma); | 877 | GFP_ATOMIC, &yld->irq_dma); |
880 | if (yld->irq_data == NULL) | 878 | if (yld->irq_data == NULL) |
881 | return usb_cleanup(yld, -ENOMEM); | 879 | return usb_cleanup(yld, -ENOMEM); |
882 | 880 | ||
883 | yld->ctl_data = usb_buffer_alloc(udev, USB_PKT_LEN, | 881 | yld->ctl_data = usb_buffer_alloc(udev, USB_PKT_LEN, |
884 | SLAB_ATOMIC, &yld->ctl_dma); | 882 | GFP_ATOMIC, &yld->ctl_dma); |
885 | if (!yld->ctl_data) | 883 | if (!yld->ctl_data) |
886 | return usb_cleanup(yld, -ENOMEM); | 884 | return usb_cleanup(yld, -ENOMEM); |
887 | 885 | ||
888 | yld->ctl_req = usb_buffer_alloc(udev, sizeof(*(yld->ctl_req)), | 886 | yld->ctl_req = usb_buffer_alloc(udev, sizeof(*(yld->ctl_req)), |
889 | SLAB_ATOMIC, &yld->ctl_req_dma); | 887 | GFP_ATOMIC, &yld->ctl_req_dma); |
890 | if (yld->ctl_req == NULL) | 888 | if (yld->ctl_req == NULL) |
891 | return usb_cleanup(yld, -ENOMEM); | 889 | return usb_cleanup(yld, -ENOMEM); |
892 | 890 | ||