thunderbolt: Scan only valid NULL adapter ports in hotplug
[linux-2.6-block.git] / drivers / thunderbolt / tb.h
index 5b5ba8919086591458ecaf54dabcb072c9dcd591..260360ec59a9d3f483fc2065e0acd887ef7934e3 100644 (file)
@@ -350,6 +350,11 @@ static inline bool tb_port_has_remote(const struct tb_port *port)
        return true;
 }
 
+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_pcie_down(const struct tb_port *port)
 {
        return port && port->config.type == TB_TYPE_PCIE_DOWN;