Skip to content

Commit 35ecea2

Browse files
superm1dtor
authored andcommitted
Input: xpad - adjust error handling for disconnect
When a device supporting xpad is disconnected it's expected that a URB will fail to transmit. Only show an error message when the error isn't -ENODEV. Fixes: 7fc595f ("Input: xpad - correctly handle concurrent LED and FF requests") Signed-off-by: Mario Limonciello <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent f4b048a commit 35ecea2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/input/joystick/xpad.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,9 +1344,10 @@ static int xpad_try_sending_next_out_packet(struct usb_xpad *xpad)
13441344
usb_anchor_urb(xpad->irq_out, &xpad->irq_out_anchor);
13451345
error = usb_submit_urb(xpad->irq_out, GFP_ATOMIC);
13461346
if (error) {
1347-
dev_err(&xpad->intf->dev,
1348-
"%s - usb_submit_urb failed with result %d\n",
1349-
__func__, error);
1347+
if (error != -ENODEV)
1348+
dev_err(&xpad->intf->dev,
1349+
"%s - usb_submit_urb failed with result %d\n",
1350+
__func__, error);
13501351
usb_unanchor_urb(xpad->irq_out);
13511352
return -EIO;
13521353
}

0 commit comments

Comments
 (0)