summaryrefslogtreecommitdiffstats
path: root/drivers/thunderbolt/switch.c
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2019-03-15 08:56:21 -0400
committerMika Westerberg <mika.westerberg@linux.intel.com>2019-04-18 04:18:51 -0400
commit8f965efd215a09c20b0b5e5bb4e20009a954472e (patch)
tree56a3dfec63c5cc2443e62bceef36b6fb8f3387a4 /drivers/thunderbolt/switch.c
parenta336b62769499202f27ed2c3b6b28bb44ba9bab8 (diff)
thunderbolt: Drop duplicated get_switch_at_route()
tb_switch_find_by_route() does the same already so use it instead and remove duplicated get_switch_at_route(). Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Lukas Wunner <lukas@wunner.de>
Diffstat (limited to 'drivers/thunderbolt/switch.c')
-rw-r--r--drivers/thunderbolt/switch.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 504365d46827..5c2c0201ae7f 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -644,24 +644,6 @@ int tb_switch_reset(struct tb *tb, u64 route)
644 return res.err; 644 return res.err;
645} 645}
646 646
647struct tb_switch *get_switch_at_route(struct tb_switch *sw, u64 route)
648{
649 u8 next_port = route; /*
650 * Routes use a stride of 8 bits,
651 * eventhough a port index has 6 bits at most.
652 * */
653 if (route == 0)
654 return sw;
655 if (next_port > sw->config.max_port_number)
656 return NULL;
657 if (tb_is_upstream_port(&sw->ports[next_port]))
658 return NULL;
659 if (!sw->ports[next_port].remote)
660 return NULL;
661 return get_switch_at_route(sw->ports[next_port].remote->sw,
662 route >> TB_ROUTE_SHIFT);
663}
664
665/** 647/**
666 * tb_plug_events_active() - enable/disable plug events on a switch 648 * tb_plug_events_active() - enable/disable plug events on a switch
667 * 649 *