- substream->hw_opened = 0;
- }
- if (substream->pcm_release) {
- substream->pcm_release(substream);
- substream->pcm_release = NULL;
- }
- snd_pcm_detach_substream(substream);
-}
-
-int snd_pcm_open_substream(struct snd_pcm *pcm, int stream,
- struct file *file,
- struct snd_pcm_substream **rsubstream)
-{
- struct snd_pcm_substream *substream;
- int err;
-
- err = snd_pcm_attach_substream(pcm, stream, file, &substream);
- if (err < 0)
- return err;
- substream->no_mmap_ctrl = 0;
- err = snd_pcm_hw_constraints_init(substream);
- if (err < 0) {
- snd_printd("snd_pcm_hw_constraints_init failed\n");
- goto error;