diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2023-09-04 08:09:34 +0200 |
---|---|---|
committer | Mika Westerberg <mika.westerberg@linux.intel.com> | 2023-10-20 17:18:01 +0200 |
commit | c4ff14436952c3d0dd05769d76cf48e73a253b48 (patch) | |
tree | a99548a8da42ac58a0d9ebb1db2c12face3ea334 /drivers/thunderbolt/tb.c | |
parent | thunderbolt: Introduce tb_for_each_upstream_port_on_path() (diff) | |
download | linux-c4ff14436952c3d0dd05769d76cf48e73a253b48.tar.xz linux-c4ff14436952c3d0dd05769d76cf48e73a253b48.zip |
thunderbolt: Introduce tb_switch_depth()
This is useful helper to find out the depth of a connected router.
Convert the existing users to call this helper instead of open-coding.
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.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c index ad7142be39cc..a0932545f439 100644 --- a/drivers/thunderbolt/tb.c +++ b/drivers/thunderbolt/tb.c @@ -255,13 +255,13 @@ static int tb_enable_clx(struct tb_switch *sw) * this in the future to cover the whole topology if it turns * out to be beneficial. */ - while (sw && sw->config.depth > 1) + while (sw && tb_switch_depth(sw) > 1) sw = tb_switch_parent(sw); if (!sw) return 0; - if (sw->config.depth != 1) + if (tb_switch_depth(sw) != 1) return 0; /* |