Skip to content

Commit cab96fa

Browse files
committed
thunderbolt: Drop tb_tunnel_restart()
It is pretty much the same as tb_tunnel_activate() excepts does check for already activated paths. This is not needed anymore and makes it more streamlined so drop tb_tunnel_restart() in favour of tb_tunnel_activate(). Signed-off-by: Mika Westerberg <[email protected]>
1 parent ae76578 commit cab96fa

File tree

3 files changed

+5
-27
lines changed

3 files changed

+5
-27
lines changed

drivers/thunderbolt/tb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3037,7 +3037,7 @@ static int tb_resume_noirq(struct tb *tb)
30373037
/* Only need to do it once */
30383038
usb3_delay = 0;
30393039
}
3040-
tb_tunnel_restart(tunnel);
3040+
tb_tunnel_activate(tunnel);
30413041
}
30423042
if (!list_empty(&tcm->tunnel_list)) {
30433043
/*
@@ -3147,7 +3147,7 @@ static int tb_runtime_resume(struct tb *tb)
31473147
tb_free_invalid_tunnels(tb);
31483148
tb_restore_children(tb->root_switch);
31493149
list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list)
3150-
tb_tunnel_restart(tunnel);
3150+
tb_tunnel_activate(tunnel);
31513151
tb_switch_enter_redrive(tb->root_switch);
31523152
tcm->hotplug_active = true;
31533153
mutex_unlock(&tb->lock);

drivers/thunderbolt/tunnel.c

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2170,12 +2170,12 @@ bool tb_tunnel_is_invalid(struct tb_tunnel *tunnel)
21702170
}
21712171

21722172
/**
2173-
* tb_tunnel_restart() - activate a tunnel after a hardware reset
2174-
* @tunnel: Tunnel to restart
2173+
* tb_tunnel_activate() - activate a tunnel
2174+
* @tunnel: Tunnel to activate
21752175
*
21762176
* Return: 0 on success and negative errno in case if failure
21772177
*/
2178-
int tb_tunnel_restart(struct tb_tunnel *tunnel)
2178+
int tb_tunnel_activate(struct tb_tunnel *tunnel)
21792179
{
21802180
int res, i;
21812181

@@ -2218,27 +2218,6 @@ int tb_tunnel_restart(struct tb_tunnel *tunnel)
22182218
return res;
22192219
}
22202220

2221-
/**
2222-
* tb_tunnel_activate() - activate a tunnel
2223-
* @tunnel: Tunnel to activate
2224-
*
2225-
* Return: Returns 0 on success or an error code on failure.
2226-
*/
2227-
int tb_tunnel_activate(struct tb_tunnel *tunnel)
2228-
{
2229-
int i;
2230-
2231-
for (i = 0; i < tunnel->npaths; i++) {
2232-
if (tunnel->paths[i]->activated) {
2233-
tb_tunnel_WARN(tunnel,
2234-
"trying to activate an already activated tunnel\n");
2235-
return -EINVAL;
2236-
}
2237-
}
2238-
2239-
return tb_tunnel_restart(tunnel);
2240-
}
2241-
22422221
/**
22432222
* tb_tunnel_deactivate() - deactivate a tunnel
22442223
* @tunnel: Tunnel to deactivate

drivers/thunderbolt/tunnel.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ struct tb_tunnel *tb_tunnel_alloc_usb3(struct tb *tb, struct tb_port *up,
106106

107107
void tb_tunnel_free(struct tb_tunnel *tunnel);
108108
int tb_tunnel_activate(struct tb_tunnel *tunnel);
109-
int tb_tunnel_restart(struct tb_tunnel *tunnel);
110109
void tb_tunnel_deactivate(struct tb_tunnel *tunnel);
111110
bool tb_tunnel_is_invalid(struct tb_tunnel *tunnel);
112111
bool tb_tunnel_port_on_path(const struct tb_tunnel *tunnel,

0 commit comments

Comments
 (0)