if (err < 0)
goto end;
+ mutex_lock(&efw->mutex);
atomic_inc(&efw->capture_substreams);
err = snd_efw_stream_start_duplex(efw, 0);
+ mutex_unlock(&efw->mutex);
if (err < 0)
snd_efw_stream_lock_release(efw);
if (err < 0)
goto end;
+ mutex_lock(&efw->mutex);
atomic_inc(&efw->playback_substreams);
err = snd_efw_stream_start_duplex(efw, 0);
+ mutex_unlock(&efw->mutex);
if (err < 0)
snd_efw_stream_lock_release(efw);
end:
{
struct snd_efw *efw = substream->rmidi->private_data;
+ mutex_lock(&efw->mutex);
atomic_dec(&efw->capture_substreams);
snd_efw_stream_stop_duplex(efw);
+ mutex_unlock(&efw->mutex);
snd_efw_stream_lock_release(efw);
return 0;
{
struct snd_efw *efw = substream->rmidi->private_data;
+ mutex_lock(&efw->mutex);
atomic_dec(&efw->playback_substreams);
snd_efw_stream_stop_duplex(efw);
+ mutex_unlock(&efw->mutex);
snd_efw_stream_lock_release(efw);
return 0;