summaryrefslogtreecommitdiff
path: root/sound/firewire/tascam
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2019-06-02 16:12:47 +0900
committerTakashi Iwai <tiwai@suse.de>2019-06-11 11:36:19 +0200
commita364af2eecfa3f5927460cda18e7e84881b8392f (patch)
treef0801331232c5b27c141c3512b0a15b03da31efe /sound/firewire/tascam
parent810b37ff294d67c75cd608184a5a834f1fc3117f (diff)
ALSA: firewire-tascam: code refactoring for release of isochronous resources
This commit is a part of preparation to perform allocation/release of isochronous channels in pcm.hw_params/hw_free callbacks. This commit obsoletes a helper function to release isochronous resources for both direction. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/tascam')
-rw-r--r--sound/firewire/tascam/tascam-stream.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/sound/firewire/tascam/tascam-stream.c b/sound/firewire/tascam/tascam-stream.c
index fc963469f6b0..6ad149274050 100644
--- a/sound/firewire/tascam/tascam-stream.c
+++ b/sound/firewire/tascam/tascam-stream.c
@@ -269,13 +269,6 @@ static int begin_session(struct snd_tscm *tscm)
&reg, sizeof(reg), 0);
}
-static void release_resources(struct snd_tscm *tscm)
-{
- // Release isochronous resources.
- fw_iso_resources_free(&tscm->tx_resources);
- fw_iso_resources_free(&tscm->rx_resources);
-}
-
static int keep_resources(struct snd_tscm *tscm, unsigned int rate,
struct amdtp_stream *stream)
{
@@ -374,7 +367,8 @@ int snd_tscm_stream_start_duplex(struct snd_tscm *tscm, unsigned int rate)
amdtp_stream_stop(&tscm->rx_stream);
amdtp_stream_stop(&tscm->tx_stream);
- release_resources(tscm);
+ fw_iso_resources_free(&tscm->tx_resources);
+ fw_iso_resources_free(&tscm->rx_resources);
}
if (!amdtp_stream_running(&tscm->rx_stream)) {
@@ -427,7 +421,9 @@ error:
amdtp_stream_stop(&tscm->tx_stream);
finish_session(tscm);
- release_resources(tscm);
+
+ fw_iso_resources_free(&tscm->tx_resources);
+ fw_iso_resources_free(&tscm->rx_resources);
return err;
}
@@ -441,7 +437,9 @@ void snd_tscm_stream_stop_duplex(struct snd_tscm *tscm)
amdtp_stream_stop(&tscm->rx_stream);
finish_session(tscm);
- release_resources(tscm);
+
+ fw_iso_resources_free(&tscm->tx_resources);
+ fw_iso_resources_free(&tscm->rx_resources);
}
void snd_tscm_stream_lock_changed(struct snd_tscm *tscm)