diff options
Diffstat (limited to 'sound/core/pcm_native.c')
-rw-r--r-- | sound/core/pcm_native.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index f3d5de7b55ac..01f150f0990e 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -2112,7 +2112,7 @@ static int snd_pcm_open(struct file *file, struct snd_pcm *pcm, int stream) | |||
2112 | } | 2112 | } |
2113 | init_waitqueue_entry(&wait, current); | 2113 | init_waitqueue_entry(&wait, current); |
2114 | add_wait_queue(&pcm->open_wait, &wait); | 2114 | add_wait_queue(&pcm->open_wait, &wait); |
2115 | down(&pcm->open_mutex); | 2115 | mutex_lock(&pcm->open_mutex); |
2116 | while (1) { | 2116 | while (1) { |
2117 | err = snd_pcm_open_file(file, pcm, stream, &pcm_file); | 2117 | err = snd_pcm_open_file(file, pcm, stream, &pcm_file); |
2118 | if (err >= 0) | 2118 | if (err >= 0) |
@@ -2125,16 +2125,16 @@ static int snd_pcm_open(struct file *file, struct snd_pcm *pcm, int stream) | |||
2125 | } else | 2125 | } else |
2126 | break; | 2126 | break; |
2127 | set_current_state(TASK_INTERRUPTIBLE); | 2127 | set_current_state(TASK_INTERRUPTIBLE); |
2128 | up(&pcm->open_mutex); | 2128 | mutex_unlock(&pcm->open_mutex); |
2129 | schedule(); | 2129 | schedule(); |
2130 | down(&pcm->open_mutex); | 2130 | mutex_lock(&pcm->open_mutex); |
2131 | if (signal_pending(current)) { | 2131 | if (signal_pending(current)) { |
2132 | err = -ERESTARTSYS; | 2132 | err = -ERESTARTSYS; |
2133 | break; | 2133 | break; |
2134 | } | 2134 | } |
2135 | } | 2135 | } |
2136 | remove_wait_queue(&pcm->open_wait, &wait); | 2136 | remove_wait_queue(&pcm->open_wait, &wait); |
2137 | up(&pcm->open_mutex); | 2137 | mutex_unlock(&pcm->open_mutex); |
2138 | if (err < 0) | 2138 | if (err < 0) |
2139 | goto __error; | 2139 | goto __error; |
2140 | return err; | 2140 | return err; |
@@ -2160,9 +2160,9 @@ static int snd_pcm_release(struct inode *inode, struct file *file) | |||
2160 | pcm = substream->pcm; | 2160 | pcm = substream->pcm; |
2161 | snd_pcm_drop(substream); | 2161 | snd_pcm_drop(substream); |
2162 | fasync_helper(-1, file, 0, &substream->runtime->fasync); | 2162 | fasync_helper(-1, file, 0, &substream->runtime->fasync); |
2163 | down(&pcm->open_mutex); | 2163 | mutex_lock(&pcm->open_mutex); |
2164 | snd_pcm_release_file(pcm_file); | 2164 | snd_pcm_release_file(pcm_file); |
2165 | up(&pcm->open_mutex); | 2165 | mutex_unlock(&pcm->open_mutex); |
2166 | wake_up(&pcm->open_wait); | 2166 | wake_up(&pcm->open_wait); |
2167 | module_put(pcm->card->module); | 2167 | module_put(pcm->card->module); |
2168 | snd_card_file_remove(pcm->card, file); | 2168 | snd_card_file_remove(pcm->card, file); |
@@ -2539,6 +2539,14 @@ static int snd_pcm_common_ioctl1(struct snd_pcm_substream *substream, | |||
2539 | return snd_pcm_drain(substream); | 2539 | return snd_pcm_drain(substream); |
2540 | case SNDRV_PCM_IOCTL_DROP: | 2540 | case SNDRV_PCM_IOCTL_DROP: |
2541 | return snd_pcm_drop(substream); | 2541 | return snd_pcm_drop(substream); |
2542 | case SNDRV_PCM_IOCTL_PAUSE: | ||
2543 | { | ||
2544 | int res; | ||
2545 | snd_pcm_stream_lock_irq(substream); | ||
2546 | res = snd_pcm_pause(substream, (int)(unsigned long)arg); | ||
2547 | snd_pcm_stream_unlock_irq(substream); | ||
2548 | return res; | ||
2549 | } | ||
2542 | } | 2550 | } |
2543 | snd_printd("unknown ioctl = 0x%x\n", cmd); | 2551 | snd_printd("unknown ioctl = 0x%x\n", cmd); |
2544 | return -ENOTTY; | 2552 | return -ENOTTY; |
@@ -2619,14 +2627,6 @@ static int snd_pcm_playback_ioctl1(struct snd_pcm_substream *substream, | |||
2619 | __put_user(result, _frames); | 2627 | __put_user(result, _frames); |
2620 | return result < 0 ? result : 0; | 2628 | return result < 0 ? result : 0; |
2621 | } | 2629 | } |
2622 | case SNDRV_PCM_IOCTL_PAUSE: | ||
2623 | { | ||
2624 | int res; | ||
2625 | snd_pcm_stream_lock_irq(substream); | ||
2626 | res = snd_pcm_pause(substream, (int)(unsigned long)arg); | ||
2627 | snd_pcm_stream_unlock_irq(substream); | ||
2628 | return res; | ||
2629 | } | ||
2630 | } | 2630 | } |
2631 | return snd_pcm_common_ioctl1(substream, cmd, arg); | 2631 | return snd_pcm_common_ioctl1(substream, cmd, arg); |
2632 | } | 2632 | } |