summaryrefslogtreecommitdiffstats
path: root/drivers/thunderbolt/tb.c
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2020-03-11 14:00:46 +0100
committerMika Westerberg <mika.westerberg@linux.intel.com>2020-06-22 18:58:20 +0200
commit77cfa40fcdea9f75255a9785d345fa25e4a3ad0b (patch)
treef439978ea3040b8cba44e3bea39338c6d788a964 /drivers/thunderbolt/tb.c
parentthunderbolt: Do not tunnel USB3 if link is not USB4 (diff)
downloadlinux-77cfa40fcdea9f75255a9785d345fa25e4a3ad0b.tar.xz
linux-77cfa40fcdea9f75255a9785d345fa25e4a3ad0b.zip
thunderbolt: Make usb4_switch_map_usb3_down() also return enabled ports
We need to call this on enabled ports in order to find the mapping from host router USB4 port to a USB 3.x downstream adapter, so make the function return enabled ports as well. While there fix parameter alignment in tb_find_usb3_down(). Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/tb.c')
-rw-r--r--drivers/thunderbolt/tb.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
index 2da82259e77c..82f62a023a4b 100644
--- a/drivers/thunderbolt/tb.c
+++ b/drivers/thunderbolt/tb.c
@@ -206,22 +206,14 @@ static struct tb_port *tb_find_unused_port(struct tb_switch *sw,
}
static struct tb_port *tb_find_usb3_down(struct tb_switch *sw,
- const struct tb_port *port)
+ const struct tb_port *port)
{
struct tb_port *down;
down = usb4_switch_map_usb3_down(sw, port);
- if (down) {
- if (WARN_ON(!tb_port_is_usb3_down(down)))
- goto out;
- if (WARN_ON(tb_usb3_port_is_enabled(down)))
- goto out;
-
+ if (down && !tb_usb3_port_is_enabled(down))
return down;
- }
-
-out:
- return tb_find_unused_port(sw, TB_TYPE_USB3_DOWN);
+ return NULL;
}
static int tb_tunnel_usb3(struct tb *tb, struct tb_switch *sw)