]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/core/pcm.c
Merge branch 'upstream'
[linux-2.6-omap-h63xx.git] / sound / core / pcm.c
index 3da6a38c2d0fd6391da878e8bb6921f0e0b90274..122e10a61ab9c7e788c68e8991965ec3dd8beb6e 100644 (file)
@@ -196,7 +196,7 @@ static char *snd_pcm_format_names[] = {
        FORMAT(U18_3BE),
 };
 
-const char *snd_pcm_format_name(snd_pcm_format_t format)
+static const char *snd_pcm_format_name(snd_pcm_format_t format)
 {
        return snd_pcm_format_names[format];
 }
@@ -777,8 +777,9 @@ static void snd_pcm_tick_timer_func(unsigned long data)
        snd_pcm_tick_elapsed(substream);
 }
 
-int snd_pcm_open_substream(struct snd_pcm *pcm, int stream,
-                          struct snd_pcm_substream **rsubstream)
+int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream,
+                            struct file *file,
+                            struct snd_pcm_substream **rsubstream)
 {
        struct snd_pcm_str * pstr;
        struct snd_pcm_substream *substream;
@@ -793,7 +794,7 @@ int snd_pcm_open_substream(struct snd_pcm *pcm, int stream,
        *rsubstream = NULL;
        snd_assert(pcm != NULL, return -ENXIO);
        pstr = &pcm->streams[stream];
-       if (pstr->substream == NULL)
+       if (pstr->substream == NULL || pstr->substream_count == 0)
                return -ENODEV;
 
        card = pcm->card;
@@ -807,8 +808,6 @@ int snd_pcm_open_substream(struct snd_pcm *pcm, int stream,
        }
        up_read(&card->controls_rwsem);
 
-       if (pstr->substream_count == 0)
-               return -ENODEV;
        switch (stream) {
        case SNDRV_PCM_STREAM_PLAYBACK:
                if (pcm->info_flags & SNDRV_PCM_INFO_HALF_DUPLEX) {
@@ -874,12 +873,13 @@ int snd_pcm_open_substream(struct snd_pcm *pcm, int stream,
 
        substream->runtime = runtime;
        substream->private_data = pcm->private_data;
+       substream->ffile = file;
        pstr->substream_opened++;
        *rsubstream = substream;
        return 0;
 }
 
-void snd_pcm_release_substream(struct snd_pcm_substream *substream)
+void snd_pcm_detach_substream(struct snd_pcm_substream *substream)
 {
        struct snd_pcm_runtime *runtime;
        substream->file = NULL;
@@ -1111,8 +1111,6 @@ EXPORT_SYMBOL(snd_pcm_link_rwlock);
 EXPORT_SYMBOL(snd_pcm_suspend);
 EXPORT_SYMBOL(snd_pcm_suspend_all);
 #endif
-EXPORT_SYMBOL(snd_pcm_kernel_playback_ioctl);
-EXPORT_SYMBOL(snd_pcm_kernel_capture_ioctl);
 EXPORT_SYMBOL(snd_pcm_kernel_ioctl);
 EXPORT_SYMBOL(snd_pcm_mmap_data);
 #if SNDRV_PCM_INFO_MMAP_IOMEM