Skip to content

Commit af26bac

Browse files
takaswietiwai
authored andcommitted
ALSA: fireface: 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: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 9628fc8 commit af26bac

3 files changed

Lines changed: 5 additions & 11 deletions

File tree

‎sound/firewire/fireface/ff-pcm.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
233233
--ff->substreams_counter;
234234

235235
snd_ff_stream_stop_duplex(ff);
236-
snd_ff_stream_release_duplex(ff);
237236

238237
mutex_unlock(&ff->mutex);
239238

‎sound/firewire/fireface/ff-stream.c‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,6 @@ int snd_ff_stream_reserve_duplex(struct snd_ff *ff, unsigned int rate)
149149
return 0;
150150
}
151151

152-
void snd_ff_stream_release_duplex(struct snd_ff *ff)
153-
{
154-
if (ff->substreams_counter == 0) {
155-
fw_iso_resources_free(&ff->tx_resources);
156-
fw_iso_resources_free(&ff->rx_resources);
157-
}
158-
}
159-
160152
int snd_ff_stream_start_duplex(struct snd_ff *ff, unsigned int rate)
161153
{
162154
int err;
@@ -217,8 +209,12 @@ int snd_ff_stream_start_duplex(struct snd_ff *ff, unsigned int rate)
217209

218210
void snd_ff_stream_stop_duplex(struct snd_ff *ff)
219211
{
220-
if (ff->substreams_counter == 0)
212+
if (ff->substreams_counter == 0) {
221213
finish_session(ff);
214+
215+
fw_iso_resources_free(&ff->tx_resources);
216+
fw_iso_resources_free(&ff->rx_resources);
217+
}
222218
}
223219

224220
void snd_ff_stream_update_duplex(struct snd_ff *ff)

‎sound/firewire/fireface/ff.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ int snd_ff_stream_get_multiplier_mode(enum cip_sfc sfc,
139139
int snd_ff_stream_init_duplex(struct snd_ff *ff);
140140
void snd_ff_stream_destroy_duplex(struct snd_ff *ff);
141141
int snd_ff_stream_reserve_duplex(struct snd_ff *ff, unsigned int rate);
142-
void snd_ff_stream_release_duplex(struct snd_ff *ff);
143142
int snd_ff_stream_start_duplex(struct snd_ff *ff, unsigned int rate);
144143
void snd_ff_stream_stop_duplex(struct snd_ff *ff);
145144
void snd_ff_stream_update_duplex(struct snd_ff *ff);

0 commit comments

Comments
 (0)