aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/core/pcm_native.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index b9517f38073c..4c3edc1532c9 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -3440,14 +3440,28 @@ out:
3440#endif /* CONFIG_SND_SUPPORT_OLD_API */ 3440#endif /* CONFIG_SND_SUPPORT_OLD_API */
3441 3441
3442#ifndef CONFIG_MMU 3442#ifndef CONFIG_MMU
3443unsigned long dummy_get_unmapped_area(struct file *file, unsigned long addr, 3443static unsigned long snd_pcm_get_unmapped_area(struct file *file,
3444 unsigned long len, unsigned long pgoff, 3444 unsigned long addr,
3445 unsigned long flags) 3445 unsigned long len,
3446{ 3446 unsigned long pgoff,
3447 return 0; 3447 unsigned long flags)
3448{
3449 struct snd_pcm_file *pcm_file = file->private_data;
3450 struct snd_pcm_substream *substream = pcm_file->substream;
3451 struct snd_pcm_runtime *runtime = substream->runtime;
3452 unsigned long offset = pgoff << PAGE_SHIFT;
3453
3454 switch (offset) {
3455 case SNDRV_PCM_MMAP_OFFSET_STATUS:
3456 return (unsigned long)runtime->status;
3457 case SNDRV_PCM_MMAP_OFFSET_CONTROL:
3458 return (unsigned long)runtime->control;
3459 default:
3460 return (unsigned long)runtime->dma_area + offset;
3461 }
3448} 3462}
3449#else 3463#else
3450# define dummy_get_unmapped_area NULL 3464# define snd_pcm_get_unmapped_area NULL
3451#endif 3465#endif
3452 3466
3453/* 3467/*
@@ -3467,7 +3481,7 @@ const struct file_operations snd_pcm_f_ops[2] = {
3467 .compat_ioctl = snd_pcm_ioctl_compat, 3481 .compat_ioctl = snd_pcm_ioctl_compat,
3468 .mmap = snd_pcm_mmap, 3482 .mmap = snd_pcm_mmap,
3469 .fasync = snd_pcm_fasync, 3483 .fasync = snd_pcm_fasync,
3470 .get_unmapped_area = dummy_get_unmapped_area, 3484 .get_unmapped_area = snd_pcm_get_unmapped_area,
3471 }, 3485 },
3472 { 3486 {
3473 .owner = THIS_MODULE, 3487 .owner = THIS_MODULE,
@@ -3481,6 +3495,6 @@ const struct file_operations snd_pcm_f_ops[2] = {
3481 .compat_ioctl = snd_pcm_ioctl_compat, 3495 .compat_ioctl = snd_pcm_ioctl_compat,
3482 .mmap = snd_pcm_mmap, 3496 .mmap = snd_pcm_mmap,
3483 .fasync = snd_pcm_fasync, 3497 .fasync = snd_pcm_fasync,
3484 .get_unmapped_area = dummy_get_unmapped_area, 3498 .get_unmapped_area = snd_pcm_get_unmapped_area,
3485 } 3499 }
3486}; 3500};