summaryrefslogtreecommitdiffstats
path: root/drivers/thunderbolt
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2018-07-25 11:03:18 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-25 10:15:24 +0200
commit84db68587651d453a9b5e901c787a49866e34b1e (patch)
tree4bfb7590a09e5bbe158c142f01090ec08d466429 /drivers/thunderbolt
parentfdd92e89a492142a113f270dcd7e490805922b71 (diff)
downloadlinux-stable-84db68587651d453a9b5e901c787a49866e34b1e.tar.gz
linux-stable-84db68587651d453a9b5e901c787a49866e34b1e.tar.bz2
linux-stable-84db68587651d453a9b5e901c787a49866e34b1e.zip
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: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/thunderbolt')
-rw-r--r--drivers/thunderbolt/domain.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/thunderbolt/domain.c b/drivers/thunderbolt/domain.c
index a923ebdeb73c..e377128663e9 100644
--- a/drivers/thunderbolt/domain.c
+++ b/drivers/thunderbolt/domain.c
@@ -509,26 +509,13 @@ int tb_domain_resume_noirq(struct tb *tb)
int tb_domain_suspend(struct tb *tb)
{
- int ret;
-
- 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;
+ return tb->cm_ops->suspend ? tb->cm_ops->suspend(tb) : 0;
}
void tb_domain_complete(struct tb *tb)
{
- mutex_lock(&tb->lock);
if (tb->cm_ops->complete)
tb->cm_ops->complete(tb);
- mutex_unlock(&tb->lock);
}
/**