thunderbolt: Fix lane bonding log when bonding not possible

Currently if lane bonding is not possible or not supported, we continue
and read the updated number of Total Buffers from lane adapters unnecessarily
and incorrectly log the bonding as successful.

Fix this by bailing out early when bonding is not possible, avoiding
the unnecessary read and the misleading log message.

Signed-off-by: Gil Fine <gil.fine@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
This commit is contained in:
Gil Fine 2026-05-06 15:37:04 +03:00 committed by Mika Westerberg
parent 95c4379e37
commit 0ab4771834

View File

@ -2977,14 +2977,14 @@ static int tb_switch_lane_bonding_enable(struct tb_switch *sw)
int ret;
if (!tb_switch_lane_bonding_possible(sw))
return 0;
return -EOPNOTSUPP;
up = tb_upstream_port(sw);
down = tb_switch_downstream_port(sw);
if (!tb_port_width_supported(up, TB_LINK_WIDTH_DUAL) ||
!tb_port_width_supported(down, TB_LINK_WIDTH_DUAL))
return 0;
return -EOPNOTSUPP;
/*
* Both lanes need to be in CL0. Here we assume lane 0 already be in