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>
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);
}
/**