summaryrefslogtreecommitdiffstats
path: root/drivers/thunderbolt/switch.c
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2020-07-25 09:32:46 +0200
committerMika Westerberg <mika.westerberg@linux.intel.com>2020-09-03 11:21:08 +0200
commita3cfebdc1b3ab379646f61f095102f7d2b8f6f31 (patch)
treed04b92aa29522c8750c87645f4de4f0545cad65b /drivers/thunderbolt/switch.c
parentthunderbolt: Introduce tb_switch_next_cap() (diff)
downloadlinux-a3cfebdc1b3ab379646f61f095102f7d2b8f6f31.tar.xz
linux-a3cfebdc1b3ab379646f61f095102f7d2b8f6f31.zip
thunderbolt: Introduce tb_port_is_nhi()
This is useful if one needs to check if adapter (port) is the host interface (NHI). Make tb_port_alloc_hopid() take advantage of this. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/thunderbolt/switch.c')
-rw-r--r--drivers/thunderbolt/switch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index d3c54020a5be..9c00c2810d03 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -789,7 +789,7 @@ static int tb_port_alloc_hopid(struct tb_port *port, bool in, int min_hopid,
* NHI can use HopIDs 1-max for other adapters HopIDs 0-7 are
* reserved.
*/
- if (port->config.type != TB_TYPE_NHI && min_hopid < TB_PATH_MIN_HOPID)
+ if (!tb_port_is_nhi(port) && min_hopid < TB_PATH_MIN_HOPID)
min_hopid = TB_PATH_MIN_HOPID;
if (max_hopid < 0 || max_hopid > port_max_hopid)