]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
USB: serial: ftdi_sio: rewrite 8u2232c quirk
authorJohan Hovold <johan@kernel.org>
Mon, 10 Nov 2025 11:12:07 +0000 (12:12 +0100)
committerJohan Hovold <johan@kernel.org>
Mon, 17 Nov 2025 10:23:15 +0000 (11:23 +0100)
Rewrite the 8u2232c quirk to avoid the manufacturer and product string
comparisons for the second port which will always be bound.

Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/ftdi_sio.c

index 05b3c558d1e2931060bf993855c375f2663d5cb4..3f224e3c3322f6238f0917d28f921fac4213ca55 100644 (file)
@@ -2302,16 +2302,21 @@ static int ftdi_jtag_probe(struct usb_serial *serial)
 
 static int ftdi_8u2232c_probe(struct usb_serial *serial)
 {
+       struct usb_interface *intf = serial->interface;
        struct usb_device *udev = serial->dev;
+       int ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
 
-       if (udev->manufacturer && !strcmp(udev->manufacturer, "CALAO Systems"))
-               return ftdi_jtag_probe(serial);
+       if (ifnum == 0) {
+               if (udev->manufacturer &&
+                               !strcmp(udev->manufacturer, "CALAO Systems"))
+                       return -ENODEV;
 
-       if (udev->product &&
-               (!strcmp(udev->product, "Arrow USB Blaster") ||
-                !strcmp(udev->product, "BeagleBone/XDS100V2") ||
-                !strcmp(udev->product, "SNAP Connect E10")))
-               return ftdi_jtag_probe(serial);
+               if (udev->product &&
+                               (!strcmp(udev->product, "Arrow USB Blaster") ||
+                                !strcmp(udev->product, "BeagleBone/XDS100V2") ||
+                                !strcmp(udev->product, "SNAP Connect E10")))
+                       return -ENODEV;
+       }
 
        return 0;
 }