Commit 52c0674a authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Jiri Slaby

Input: xpad - use proper endpoint type

commit a1f9a407 upstream.

The xpad wireless endpoint is not a bulk endpoint on my devices, but
rather an interrupt one, so the USB core complains when it is submitted.
I'm guessing that the author really did mean that this should be an
interrupt urb, but as there are a zillion different xpad devices out
there, let's cover out bases and handle both bulk and interrupt
endpoints just as easily.
Signed-off-by: default avatar"Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent 2c2bbb8a
...@@ -1039,9 +1039,19 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id ...@@ -1039,9 +1039,19 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
} }
ep_irq_in = &intf->cur_altsetting->endpoint[1].desc; ep_irq_in = &intf->cur_altsetting->endpoint[1].desc;
usb_fill_bulk_urb(xpad->bulk_out, udev, if (usb_endpoint_is_bulk_out(ep_irq_in)) {
usb_sndbulkpipe(udev, ep_irq_in->bEndpointAddress), usb_fill_bulk_urb(xpad->bulk_out, udev,
xpad->bdata, XPAD_PKT_LEN, xpad_bulk_out, xpad); usb_sndbulkpipe(udev,
ep_irq_in->bEndpointAddress),
xpad->bdata, XPAD_PKT_LEN,
xpad_bulk_out, xpad);
} else {
usb_fill_int_urb(xpad->bulk_out, udev,
usb_sndintpipe(udev,
ep_irq_in->bEndpointAddress),
xpad->bdata, XPAD_PKT_LEN,
xpad_bulk_out, xpad, 0);
}
/* /*
* Submit the int URB immediately rather than waiting for open * Submit the int URB immediately rather than waiting for open
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment