summaryrefslogtreecommitdiff
path: root/drivers/thunderbolt/tb.c
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2024-01-09 18:48:34 +0300
committerMika Westerberg <mika.westerberg@linux.intel.com>2024-02-16 13:29:23 +0300
commit769da9708ae62f3c0a491b67c9514a53e5769feb (patch)
tree52a9650c880fbecb2d500ca538b31e1e21c949c6 /drivers/thunderbolt/tb.c
parentfca0f40ac7ff1213ffc1757b9cd4d126c69d3931 (diff)
downloadlinux-769da9708ae62f3c0a491b67c9514a53e5769feb.tar.xz
thunderbolt: Introduce tb_tunnel_direction_downstream()
This helper takes tunnel as parameter. Convert existing code to call this where possible. No functional changes. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/tb.c')
-rw-r--r--drivers/thunderbolt/tb.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
index d23a80339a8d..e664045ad41c 100644
--- a/drivers/thunderbolt/tb.c
+++ b/drivers/thunderbolt/tb.c
@@ -1387,7 +1387,7 @@ tb_recalc_estimated_bandwidth_for_group(struct tb_bandwidth_group *group)
* - available bandwidth along the path
* - bandwidth allocated for USB 3.x but not used.
*/
- if (tb_port_path_direction_downstream(in, out))
+ if (tb_tunnel_direction_downstream(tunnel))
estimated_bw = estimated_down;
else
estimated_bw = estimated_up;
@@ -2388,11 +2388,11 @@ static void tb_handle_dp_bandwidth_request(struct work_struct *work)
{
struct tb_hotplug_event *ev = container_of(work, typeof(*ev), work);
int requested_bw, requested_up, requested_down, ret;
- struct tb_port *in, *out;
struct tb_tunnel *tunnel;
struct tb *tb = ev->tb;
struct tb_cm *tcm = tb_priv(tb);
struct tb_switch *sw;
+ struct tb_port *in;
pm_runtime_get_sync(&tb->dev);
@@ -2456,10 +2456,7 @@ static void tb_handle_dp_bandwidth_request(struct work_struct *work)
tb_port_dbg(in, "requested bandwidth %d Mb/s\n", requested_bw);
-
- out = tunnel->dst_port;
-
- if (tb_port_path_direction_downstream(in, out)) {
+ if (tb_tunnel_direction_downstream(tunnel)) {
requested_up = -1;
requested_down = requested_bw;
} else {