summaryrefslogtreecommitdiff
path: root/drivers/thunderbolt/tb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thunderbolt/tb.c')
-rw-r--r--drivers/thunderbolt/tb.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
index 9dbdb11685fa..53f9673c1395 100644
--- a/drivers/thunderbolt/tb.c
+++ b/drivers/thunderbolt/tb.c
@@ -535,7 +535,7 @@ static int tb_available_bw(struct tb_cm *tcm, struct tb_port *in,
{
struct tb_switch *sw = out->sw;
struct tb_tunnel *tunnel;
- int bw, available_bw = 40000;
+ int ret, bw, available_bw = 40000;
while (sw && sw != in->sw) {
bw = sw->link_speed * sw->link_width * 1000; /* Mb/s */
@@ -553,9 +553,10 @@ static int tb_available_bw(struct tb_cm *tcm, struct tb_port *in,
if (!tb_tunnel_switch_on_path(tunnel, sw))
continue;
- consumed_bw = tb_tunnel_consumed_bandwidth(tunnel);
- if (consumed_bw < 0)
- return consumed_bw;
+ ret = tb_tunnel_consumed_bandwidth(tunnel, NULL,
+ &consumed_bw);
+ if (ret)
+ return ret;
bw -= consumed_bw;
}