diff options
Diffstat (limited to 'sound/core/pcm_native.c')
-rw-r--r-- | sound/core/pcm_native.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index e97b2d162cc7..16e252f54954 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -565,9 +565,9 @@ int snd_pcm_status(snd_pcm_substream_t *substream, | |||
565 | if (runtime->tstamp_mode & SNDRV_PCM_TSTAMP_MMAP) | 565 | if (runtime->tstamp_mode & SNDRV_PCM_TSTAMP_MMAP) |
566 | status->tstamp = runtime->status->tstamp; | 566 | status->tstamp = runtime->status->tstamp; |
567 | else | 567 | else |
568 | snd_timestamp_now(&status->tstamp, runtime->tstamp_timespec); | 568 | getnstimeofday(&status->tstamp); |
569 | } else | 569 | } else |
570 | snd_timestamp_now(&status->tstamp, runtime->tstamp_timespec); | 570 | getnstimeofday(&status->tstamp); |
571 | status->appl_ptr = runtime->control->appl_ptr; | 571 | status->appl_ptr = runtime->control->appl_ptr; |
572 | status->hw_ptr = runtime->status->hw_ptr; | 572 | status->hw_ptr = runtime->status->hw_ptr; |
573 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { | 573 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
@@ -652,7 +652,7 @@ static void snd_pcm_trigger_tstamp(snd_pcm_substream_t *substream) | |||
652 | if (runtime->trigger_master == NULL) | 652 | if (runtime->trigger_master == NULL) |
653 | return; | 653 | return; |
654 | if (runtime->trigger_master == substream) { | 654 | if (runtime->trigger_master == substream) { |
655 | snd_timestamp_now(&runtime->trigger_tstamp, runtime->tstamp_timespec); | 655 | getnstimeofday(&runtime->trigger_tstamp); |
656 | } else { | 656 | } else { |
657 | snd_pcm_trigger_tstamp(runtime->trigger_master); | 657 | snd_pcm_trigger_tstamp(runtime->trigger_master); |
658 | runtime->trigger_tstamp = runtime->trigger_master->runtime->trigger_tstamp; | 658 | runtime->trigger_tstamp = runtime->trigger_master->runtime->trigger_tstamp; |
@@ -1522,7 +1522,6 @@ static int snd_pcm_drop(snd_pcm_substream_t *substream) | |||
1522 | 1522 | ||
1523 | 1523 | ||
1524 | /* WARNING: Don't forget to fput back the file */ | 1524 | /* WARNING: Don't forget to fput back the file */ |
1525 | extern int snd_major; | ||
1526 | static struct file *snd_pcm_file_fd(int fd) | 1525 | static struct file *snd_pcm_file_fd(int fd) |
1527 | { | 1526 | { |
1528 | struct file *file; | 1527 | struct file *file; |
@@ -2053,7 +2052,8 @@ static int snd_pcm_open(struct inode *inode, struct file *file) | |||
2053 | snd_pcm_file_t *pcm_file; | 2052 | snd_pcm_file_t *pcm_file; |
2054 | wait_queue_t wait; | 2053 | wait_queue_t wait; |
2055 | 2054 | ||
2056 | snd_runtime_check(device >= SNDRV_MINOR_PCM_PLAYBACK && device < SNDRV_MINOR_DEVICES, return -ENXIO); | 2055 | if (device < SNDRV_MINOR_PCM_PLAYBACK || device >= SNDRV_MINOR_DEVICES) |
2056 | return -ENXIO; | ||
2057 | pcm = snd_pcm_devices[(cardnum * SNDRV_PCM_DEVICES) + (device % SNDRV_MINOR_PCMS)]; | 2057 | pcm = snd_pcm_devices[(cardnum * SNDRV_PCM_DEVICES) + (device % SNDRV_MINOR_PCMS)]; |
2058 | if (pcm == NULL) { | 2058 | if (pcm == NULL) { |
2059 | err = -ENODEV; | 2059 | err = -ENODEV; |
@@ -2445,14 +2445,8 @@ static int snd_pcm_common_ioctl1(snd_pcm_substream_t *substream, | |||
2445 | return put_user(SNDRV_PCM_VERSION, (int __user *)arg) ? -EFAULT : 0; | 2445 | return put_user(SNDRV_PCM_VERSION, (int __user *)arg) ? -EFAULT : 0; |
2446 | case SNDRV_PCM_IOCTL_INFO: | 2446 | case SNDRV_PCM_IOCTL_INFO: |
2447 | return snd_pcm_info_user(substream, arg); | 2447 | return snd_pcm_info_user(substream, arg); |
2448 | case SNDRV_PCM_IOCTL_TSTAMP: | 2448 | case SNDRV_PCM_IOCTL_TSTAMP: /* just for compatibility */ |
2449 | { | ||
2450 | int xarg; | ||
2451 | if (get_user(xarg, (int __user *)arg)) | ||
2452 | return -EFAULT; | ||
2453 | substream->runtime->tstamp_timespec = xarg ? 1 : 0; | ||
2454 | return 0; | 2449 | return 0; |
2455 | } | ||
2456 | case SNDRV_PCM_IOCTL_HW_REFINE: | 2450 | case SNDRV_PCM_IOCTL_HW_REFINE: |
2457 | return snd_pcm_hw_refine_user(substream, arg); | 2451 | return snd_pcm_hw_refine_user(substream, arg); |
2458 | case SNDRV_PCM_IOCTL_HW_PARAMS: | 2452 | case SNDRV_PCM_IOCTL_HW_PARAMS: |