Merge tag 'thunderbolt-for-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel...
[platform/kernel/linux-starfive.git] / drivers / thunderbolt / switch.c
index 59f786a..be2ea8f 100644 (file)
@@ -3783,14 +3783,18 @@ int tb_switch_pcie_l1_enable(struct tb_switch *sw)
  */
 int tb_switch_xhci_connect(struct tb_switch *sw)
 {
-       bool usb_port1, usb_port3, xhci_port1, xhci_port3;
        struct tb_port *port1, *port3;
        int ret;
 
+       if (sw->generation != 3)
+               return 0;
+
        port1 = &sw->ports[1];
        port3 = &sw->ports[3];
 
        if (tb_switch_is_alpine_ridge(sw)) {
+               bool usb_port1, usb_port3, xhci_port1, xhci_port3;
+
                usb_port1 = tb_lc_is_usb_plugged(port1);
                usb_port3 = tb_lc_is_usb_plugged(port3);
                xhci_port1 = tb_lc_is_xhci_connected(port1);