Commit b9434540 authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Takashi Iwai

ALSA: firewire-digi00x: unify stop and release method for duplex streams

>From callbacks for pcm and rawmidi interfaces, the functions to stop
and release duplex streams are called at the same time. This commit
merges the two functions.
Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent eccd895c
...@@ -37,7 +37,6 @@ static int midi_close(struct snd_rawmidi_substream *substream) ...@@ -37,7 +37,6 @@ static int midi_close(struct snd_rawmidi_substream *substream)
mutex_lock(&dg00x->mutex); mutex_lock(&dg00x->mutex);
--dg00x->substreams_counter; --dg00x->substreams_counter;
snd_dg00x_stream_stop_duplex(dg00x); snd_dg00x_stream_stop_duplex(dg00x);
snd_dg00x_stream_release_duplex(dg00x);
mutex_unlock(&dg00x->mutex); mutex_unlock(&dg00x->mutex);
snd_dg00x_stream_lock_release(dg00x); snd_dg00x_stream_lock_release(dg00x);
......
...@@ -189,7 +189,6 @@ static int pcm_hw_free(struct snd_pcm_substream *substream) ...@@ -189,7 +189,6 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
--dg00x->substreams_counter; --dg00x->substreams_counter;
snd_dg00x_stream_stop_duplex(dg00x); snd_dg00x_stream_stop_duplex(dg00x);
snd_dg00x_stream_release_duplex(dg00x);
mutex_unlock(&dg00x->mutex); mutex_unlock(&dg00x->mutex);
......
...@@ -293,14 +293,6 @@ int snd_dg00x_stream_reserve_duplex(struct snd_dg00x *dg00x, unsigned int rate) ...@@ -293,14 +293,6 @@ int snd_dg00x_stream_reserve_duplex(struct snd_dg00x *dg00x, unsigned int rate)
return 0; return 0;
} }
void snd_dg00x_stream_release_duplex(struct snd_dg00x *dg00x)
{
if (dg00x->substreams_counter == 0) {
fw_iso_resources_free(&dg00x->tx_resources);
fw_iso_resources_free(&dg00x->rx_resources);
}
}
int snd_dg00x_stream_start_duplex(struct snd_dg00x *dg00x) int snd_dg00x_stream_start_duplex(struct snd_dg00x *dg00x)
{ {
unsigned int generation = dg00x->rx_resources.generation; unsigned int generation = dg00x->rx_resources.generation;
...@@ -372,8 +364,12 @@ int snd_dg00x_stream_start_duplex(struct snd_dg00x *dg00x) ...@@ -372,8 +364,12 @@ int snd_dg00x_stream_start_duplex(struct snd_dg00x *dg00x)
void snd_dg00x_stream_stop_duplex(struct snd_dg00x *dg00x) void snd_dg00x_stream_stop_duplex(struct snd_dg00x *dg00x)
{ {
if (dg00x->substreams_counter == 0) if (dg00x->substreams_counter == 0) {
finish_session(dg00x); finish_session(dg00x);
fw_iso_resources_free(&dg00x->tx_resources);
fw_iso_resources_free(&dg00x->rx_resources);
}
} }
void snd_dg00x_stream_update_duplex(struct snd_dg00x *dg00x) void snd_dg00x_stream_update_duplex(struct snd_dg00x *dg00x)
......
...@@ -143,7 +143,6 @@ int snd_dg00x_stream_init_duplex(struct snd_dg00x *dg00x); ...@@ -143,7 +143,6 @@ int snd_dg00x_stream_init_duplex(struct snd_dg00x *dg00x);
int snd_dg00x_stream_reserve_duplex(struct snd_dg00x *dg00x, unsigned int rate); int snd_dg00x_stream_reserve_duplex(struct snd_dg00x *dg00x, unsigned int rate);
int snd_dg00x_stream_start_duplex(struct snd_dg00x *dg00x); int snd_dg00x_stream_start_duplex(struct snd_dg00x *dg00x);
void snd_dg00x_stream_stop_duplex(struct snd_dg00x *dg00x); void snd_dg00x_stream_stop_duplex(struct snd_dg00x *dg00x);
void snd_dg00x_stream_release_duplex(struct snd_dg00x *dg00x);
void snd_dg00x_stream_update_duplex(struct snd_dg00x *dg00x); void snd_dg00x_stream_update_duplex(struct snd_dg00x *dg00x);
void snd_dg00x_stream_destroy_duplex(struct snd_dg00x *dg00x); void snd_dg00x_stream_destroy_duplex(struct snd_dg00x *dg00x);
......
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