Skip to content

Commit a1f9a40

Browse files
gregkhdtor
authored andcommitted
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>
1 parent d0ab547 commit a1f9a40

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

‎drivers/input/joystick/xpad.c‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,9 +1179,19 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
11791179
}
11801180

11811181
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+
}
11851195

11861196
/*
11871197
* Submit the int URB immediately rather than waiting for open

0 commit comments

Comments
 (0)