Skip to content

Commit 9628fc8

Browse files
takaswietiwai
authored andcommitted
ALSA: firewire-tascam: 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 15d472e commit 9628fc8

3 files changed

Lines changed: 5 additions & 11 deletions

File tree

‎sound/firewire/tascam/tascam-pcm.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
118118
--tscm->substreams_counter;
119119

120120
snd_tscm_stream_stop_duplex(tscm);
121-
snd_tscm_stream_release_duplex(tscm);
122121

123122
mutex_unlock(&tscm->mutex);
124123

‎sound/firewire/tascam/tascam-stream.c‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -380,14 +380,6 @@ int snd_tscm_stream_reserve_duplex(struct snd_tscm *tscm, unsigned int rate)
380380
return 0;
381381
}
382382

383-
void snd_tscm_stream_release_duplex(struct snd_tscm *tscm)
384-
{
385-
if (tscm->substreams_counter == 0) {
386-
fw_iso_resources_free(&tscm->tx_resources);
387-
fw_iso_resources_free(&tscm->rx_resources);
388-
}
389-
}
390-
391383
int snd_tscm_stream_start_duplex(struct snd_tscm *tscm, unsigned int rate)
392384
{
393385
unsigned int generation = tscm->rx_resources.generation;
@@ -455,8 +447,12 @@ int snd_tscm_stream_start_duplex(struct snd_tscm *tscm, unsigned int rate)
455447

456448
void snd_tscm_stream_stop_duplex(struct snd_tscm *tscm)
457449
{
458-
if (tscm->substreams_counter == 0)
450+
if (tscm->substreams_counter == 0) {
459451
finish_session(tscm);
452+
453+
fw_iso_resources_free(&tscm->tx_resources);
454+
fw_iso_resources_free(&tscm->rx_resources);
455+
}
460456
}
461457

462458
void snd_tscm_stream_lock_changed(struct snd_tscm *tscm)

‎sound/firewire/tascam/tascam.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ int snd_tscm_stream_init_duplex(struct snd_tscm *tscm);
148148
void snd_tscm_stream_update_duplex(struct snd_tscm *tscm);
149149
void snd_tscm_stream_destroy_duplex(struct snd_tscm *tscm);
150150
int snd_tscm_stream_reserve_duplex(struct snd_tscm *tscm, unsigned int rate);
151-
void snd_tscm_stream_release_duplex(struct snd_tscm *tscm);
152151
int snd_tscm_stream_start_duplex(struct snd_tscm *tscm, unsigned int rate);
153152
void snd_tscm_stream_stop_duplex(struct snd_tscm *tscm);
154153

0 commit comments

Comments
 (0)