in most_cdev.c [320:342]
static int comp_disconnect_channel(struct most_interface *iface, int channel_id)
{
struct comp_channel *c;
c = get_channel(iface, channel_id);
if (!c)
return -EINVAL;
mutex_lock(&c->io_mutex);
spin_lock(&c->unlink);
c->dev = NULL;
spin_unlock(&c->unlink);
destroy_cdev(c);
if (c->access_ref) {
stop_channel(c);
wake_up_interruptible(&c->wq);
mutex_unlock(&c->io_mutex);
} else {
mutex_unlock(&c->io_mutex);
destroy_channel(c);
}
return 0;
}