Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: xpad - use proper endpoint type

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: "Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Greg Kroah-Hartman and committed by
Dmitry Torokhov
a1f9a407 d0ab5478

+13 -3
+13 -3
drivers/input/joystick/xpad.c
··· 1179 1179 } 1180 1180 1181 1181 ep_irq_in = &intf->cur_altsetting->endpoint[1].desc; 1182 - usb_fill_bulk_urb(xpad->bulk_out, udev, 1183 - usb_sndbulkpipe(udev, ep_irq_in->bEndpointAddress), 1184 - xpad->bdata, XPAD_PKT_LEN, xpad_bulk_out, xpad); 1182 + if (usb_endpoint_is_bulk_out(ep_irq_in)) { 1183 + usb_fill_bulk_urb(xpad->bulk_out, udev, 1184 + usb_sndbulkpipe(udev, 1185 + ep_irq_in->bEndpointAddress), 1186 + xpad->bdata, XPAD_PKT_LEN, 1187 + xpad_bulk_out, xpad); 1188 + } else { 1189 + usb_fill_int_urb(xpad->bulk_out, udev, 1190 + usb_sndintpipe(udev, 1191 + ep_irq_in->bEndpointAddress), 1192 + xpad->bdata, XPAD_PKT_LEN, 1193 + xpad_bulk_out, xpad, 0); 1194 + } 1185 1195 1186 1196 /* 1187 1197 * Submit the int URB immediately rather than waiting for open