summaryrefslogtreecommitdiffstats
path: root/drivers/thunderbolt/switch.c
diff options
context:
space:
mode:
authorMika Westerberg2017-10-12 15:45:50 +0200
committerMika Westerberg2019-04-18 10:18:53 +0200
commite78db6f08b6a2a50eea9ed4146f019026491d63c (patch)
tree149d4dd58b84d74859d8721cb21fe9ba939656a5 /drivers/thunderbolt/switch.c
parentthunderbolt: Scan only valid NULL adapter ports in hotplug (diff)
downloadkernel-qcow2-linux-e78db6f08b6a2a50eea9ed4146f019026491d63c.tar.gz
kernel-qcow2-linux-e78db6f08b6a2a50eea9ed4146f019026491d63c.tar.xz
kernel-qcow2-linux-e78db6f08b6a2a50eea9ed4146f019026491d63c.zip
thunderbolt: Generalize port finding routines to support all port types
We will be needing these routines to find Display Port adapters as well so modify them to take port type as the second parameter. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/switch.c')
-rw-r--r--drivers/thunderbolt/switch.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 00aec2124f79..028e9a293382 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -731,6 +731,22 @@ struct tb_port *tb_next_port_on_path(struct tb_port *start, struct tb_port *end,
}
/**
+ * tb_port_is_enabled() - Is the adapter port enabled
+ * @port: Port to check
+ */
+bool tb_port_is_enabled(struct tb_port *port)
+{
+ switch (port->config.type) {
+ case TB_TYPE_PCIE_UP:
+ case TB_TYPE_PCIE_DOWN:
+ return tb_pci_port_is_enabled(port);
+
+ default:
+ return false;
+ }
+}
+
+/**
* tb_pci_port_is_enabled() - Is the PCIe adapter port enabled
* @port: PCIe port to check
*/