]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
HID: nintendo: Don't fail on setting baud rate
authorMax Staudt <max@enpas.org>
Fri, 15 Mar 2024 16:57:29 +0000 (01:57 +0900)
committerJiri Kosina <jkosina@suse.com>
Wed, 3 Apr 2024 11:39:19 +0000 (13:39 +0200)
Some third-party controllers can't change the baud rate.

We can still use the gamepad as-is, so let's do that.

Signed-off-by: Max Staudt <max@enpas.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/hid-nintendo.c

index ce88ac7617fd597b8ad74ff1d546cd167fa55fa8..e311b092e758fc0fd330f3c917494921e3a85cc8 100644 (file)
@@ -2503,8 +2503,11 @@ static int joycon_init(struct hid_device *hdev)
                /* set baudrate for improved latency */
                ret = joycon_send_usb(ctlr, JC_USB_CMD_BAUDRATE_3M, HZ);
                if (ret) {
-                       hid_err(hdev, "Failed to set baudrate; ret=%d\n", ret);
-                       goto out_unlock;
+                       /*
+                        * We can function with the default baudrate.
+                        * Provide a warning, and continue on.
+                        */
+                       hid_warn(hdev, "Failed to set baudrate (ret=%d), continuing anyway\n", ret);
                }
                /* handshake */
                ret = joycon_send_usb(ctlr, JC_USB_CMD_HANDSHAKE, HZ);