thunderbolt: Make usb4_switch_map_pcie_down() also return enabled ports
authorMika Westerberg <mika.westerberg@linux.intel.com>
Wed, 11 Mar 2020 13:12:50 +0000 (16:12 +0300)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 22 Jun 2020 16:58:20 +0000 (19:58 +0300)
Just for symmetry with the usb4_switch_map_usb3_down() make this one
also return ports that are enabled.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/tb.c
drivers/thunderbolt/usb4.c

index 82f62a0..9dbdb11 100644 (file)
@@ -520,7 +520,7 @@ static struct tb_port *tb_find_pcie_down(struct tb_switch *sw,
        if (down) {
                if (WARN_ON(!tb_port_is_pcie_down(down)))
                        goto out;
-               if (WARN_ON(tb_pci_port_is_enabled(down)))
+               if (tb_pci_port_is_enabled(down))
                        goto out;
 
                return down;
index 375a8c4..dd1c049 100644 (file)
@@ -728,7 +728,7 @@ struct tb_port *usb4_switch_map_pcie_down(struct tb_switch *sw,
                if (!tb_port_is_pcie_down(p))
                        continue;
 
-               if (pcie_idx == usb4_idx && !tb_pci_port_is_enabled(p))
+               if (pcie_idx == usb4_idx)
                        return p;
 
                pcie_idx++;