Commit 84db6858 authored by Mika Westerberg's avatar Mika Westerberg Committed by Greg Kroah-Hartman

thunderbolt: No need to take tb->lock in domain suspend/complete

If the connection manager implementation needs to touch the domain
structures it ought to take the lock itself. Currently only ICM
implements these hooks and it does not need the lock because we there
will be no notifications before driver ready message is sent to it.
Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fdd92e89
...@@ -509,26 +509,13 @@ int tb_domain_resume_noirq(struct tb *tb) ...@@ -509,26 +509,13 @@ int tb_domain_resume_noirq(struct tb *tb)
int tb_domain_suspend(struct tb *tb) int tb_domain_suspend(struct tb *tb)
{ {
int ret; return tb->cm_ops->suspend ? tb->cm_ops->suspend(tb) : 0;
mutex_lock(&tb->lock);
if (tb->cm_ops->suspend) {
ret = tb->cm_ops->suspend(tb);
if (ret) {
mutex_unlock(&tb->lock);
return ret;
}
}
mutex_unlock(&tb->lock);
return 0;
} }
void tb_domain_complete(struct tb *tb) void tb_domain_complete(struct tb *tb)
{ {
mutex_lock(&tb->lock);
if (tb->cm_ops->complete) if (tb->cm_ops->complete)
tb->cm_ops->complete(tb); tb->cm_ops->complete(tb);
mutex_unlock(&tb->lock);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment