diff mbox series

[1/2] Input: xpad: Adjust error handling for disconnect

Message ID 20250609014718.236827-2-superm1@kernel.org
State New
Headers show
Series Adjustments to xpad handling for unplug | expand

Commit Message

Mario Limonciello June 9, 2025, 1:46 a.m. UTC
From: Mario Limonciello <mario.limonciello@amd.com>

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.

Cc: Vicki Pfau <vi@endrift.com>
Fixes: 7fc595f4c0263 ("Input: xpad - correctly handle concurrent LED and FF requests")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/input/joystick/xpad.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index c066a4da7c140..714a694fc0e5e 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -1344,9 +1344,10 @@  static int xpad_try_sending_next_out_packet(struct usb_xpad *xpad)
 		usb_anchor_urb(xpad->irq_out, &xpad->irq_out_anchor);
 		error = usb_submit_urb(xpad->irq_out, GFP_ATOMIC);
 		if (error) {
-			dev_err(&xpad->intf->dev,
-				"%s - usb_submit_urb failed with result %d\n",
-				__func__, error);
+			if (error != -ENODEV)
+				dev_err(&xpad->intf->dev,
+					"%s - usb_submit_urb failed with result %d\n",
+					__func__, error);
 			usb_unanchor_urb(xpad->irq_out);
 			return -EIO;
 		}