aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/pcm_native.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-10-26 17:51:43 -0400
committerTakashi Iwai <tiwai@suse.de>2011-10-26 17:51:43 -0400
commitd22665702226e9c40bc331098559e3d55e7cd43d (patch)
tree6e92734c9835dc9e064b20182624939f3486d28d /sound/core/pcm_native.c
parent5cdf745ebae0f5bcf9b798d8fd5cb57add592cc1 (diff)
parentdde7ad8dee274763c8958769779aea8c993c950e (diff)
Merge branch 'topic/misc' into for-linus
Diffstat (limited to 'sound/core/pcm_native.c')
-rw-r--r--sound/core/pcm_native.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index b4bf4a4d94a9..77d7df22e7c8 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -2058,16 +2058,12 @@ EXPORT_SYMBOL(snd_pcm_open_substream);
2058 2058
2059static int snd_pcm_open_file(struct file *file, 2059static int snd_pcm_open_file(struct file *file,
2060 struct snd_pcm *pcm, 2060 struct snd_pcm *pcm,
2061 int stream, 2061 int stream)
2062 struct snd_pcm_file **rpcm_file)
2063{ 2062{
2064 struct snd_pcm_file *pcm_file; 2063 struct snd_pcm_file *pcm_file;
2065 struct snd_pcm_substream *substream; 2064 struct snd_pcm_substream *substream;
2066 int err; 2065 int err;
2067 2066
2068 if (rpcm_file)
2069 *rpcm_file = NULL;
2070
2071 err = snd_pcm_open_substream(pcm, stream, file, &substream); 2067 err = snd_pcm_open_substream(pcm, stream, file, &substream);
2072 if (err < 0) 2068 if (err < 0)
2073 return err; 2069 return err;
@@ -2083,8 +2079,7 @@ static int snd_pcm_open_file(struct file *file,
2083 substream->pcm_release = pcm_release_private; 2079 substream->pcm_release = pcm_release_private;
2084 } 2080 }
2085 file->private_data = pcm_file; 2081 file->private_data = pcm_file;
2086 if (rpcm_file) 2082
2087 *rpcm_file = pcm_file;
2088 return 0; 2083 return 0;
2089} 2084}
2090 2085
@@ -2113,7 +2108,6 @@ static int snd_pcm_capture_open(struct inode *inode, struct file *file)
2113static int snd_pcm_open(struct file *file, struct snd_pcm *pcm, int stream) 2108static int snd_pcm_open(struct file *file, struct snd_pcm *pcm, int stream)
2114{ 2109{
2115 int err; 2110 int err;
2116 struct snd_pcm_file *pcm_file;
2117 wait_queue_t wait; 2111 wait_queue_t wait;
2118 2112
2119 if (pcm == NULL) { 2113 if (pcm == NULL) {
@@ -2131,7 +2125,7 @@ static int snd_pcm_open(struct file *file, struct snd_pcm *pcm, int stream)
2131 add_wait_queue(&pcm->open_wait, &wait); 2125 add_wait_queue(&pcm->open_wait, &wait);
2132 mutex_lock(&pcm->open_mutex); 2126 mutex_lock(&pcm->open_mutex);
2133 while (1) { 2127 while (1) {
2134 err = snd_pcm_open_file(file, pcm, stream, &pcm_file); 2128 err = snd_pcm_open_file(file, pcm, stream);
2135 if (err >= 0) 2129 if (err >= 0)
2136 break; 2130 break;
2137 if (err == -EAGAIN) { 2131 if (err == -EAGAIN) {