summaryrefslogtreecommitdiff
path: root/drivers/thunderbolt/tb.h
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2020-07-25 10:32:46 +0300
committerMika Westerberg <mika.westerberg@linux.intel.com>2020-09-03 12:21:08 +0300
commita3cfebdc1b3ab379646f61f095102f7d2b8f6f31 (patch)
treed04b92aa29522c8750c87645f4de4f0545cad65b /drivers/thunderbolt/tb.h
parent6de057ef915f167dc6518910de3675ab061d2a50 (diff)
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/tb.h')
-rw-r--r--drivers/thunderbolt/tb.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h
index a1d5de53a349..6aee18b4f53d 100644
--- a/drivers/thunderbolt/tb.h
+++ b/drivers/thunderbolt/tb.h
@@ -464,6 +464,11 @@ static inline bool tb_port_is_null(const struct tb_port *port)
return port && port->port && port->config.type == TB_TYPE_PORT;
}
+static inline bool tb_port_is_nhi(const struct tb_port *port)
+{
+ return port && port->config.type == TB_TYPE_NHI;
+}
+
static inline bool tb_port_is_pcie_down(const struct tb_port *port)
{
return port && port->config.type == TB_TYPE_PCIE_DOWN;