diff options
-rw-r--r-- | include/sound/pcm.h | 2 | ||||
-rw-r--r-- | sound/core/pcm_native.c | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 57e71fa33f7c..249d98838d90 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -1035,6 +1035,8 @@ static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area) | |||
1035 | atomic_dec(&substream->mmap_count); | 1035 | atomic_dec(&substream->mmap_count); |
1036 | } | 1036 | } |
1037 | 1037 | ||
1038 | int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream, | ||
1039 | struct vm_area_struct *area); | ||
1038 | /* mmap for io-memory area */ | 1040 | /* mmap for io-memory area */ |
1039 | #if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_ALPHA) | 1041 | #if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_ALPHA) |
1040 | #define SNDRV_PCM_INFO_MMAP_IOMEM SNDRV_PCM_INFO_MMAP | 1042 | #define SNDRV_PCM_INFO_MMAP_IOMEM SNDRV_PCM_INFO_MMAP |
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 1c6be91dfb98..b4bf4a4d94a9 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -3156,8 +3156,8 @@ static const struct vm_operations_struct snd_pcm_vm_ops_data_fault = { | |||
3156 | /* | 3156 | /* |
3157 | * mmap the DMA buffer on RAM | 3157 | * mmap the DMA buffer on RAM |
3158 | */ | 3158 | */ |
3159 | static int snd_pcm_default_mmap(struct snd_pcm_substream *substream, | 3159 | int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream, |
3160 | struct vm_area_struct *area) | 3160 | struct vm_area_struct *area) |
3161 | { | 3161 | { |
3162 | area->vm_flags |= VM_RESERVED; | 3162 | area->vm_flags |= VM_RESERVED; |
3163 | #ifdef ARCH_HAS_DMA_MMAP_COHERENT | 3163 | #ifdef ARCH_HAS_DMA_MMAP_COHERENT |
@@ -3177,6 +3177,7 @@ static int snd_pcm_default_mmap(struct snd_pcm_substream *substream, | |||
3177 | area->vm_ops = &snd_pcm_vm_ops_data_fault; | 3177 | area->vm_ops = &snd_pcm_vm_ops_data_fault; |
3178 | return 0; | 3178 | return 0; |
3179 | } | 3179 | } |
3180 | EXPORT_SYMBOL_GPL(snd_pcm_lib_default_mmap); | ||
3180 | 3181 | ||
3181 | /* | 3182 | /* |
3182 | * mmap the DMA buffer on I/O memory area | 3183 | * mmap the DMA buffer on I/O memory area |
@@ -3242,7 +3243,7 @@ int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, | |||
3242 | if (substream->ops->mmap) | 3243 | if (substream->ops->mmap) |
3243 | err = substream->ops->mmap(substream, area); | 3244 | err = substream->ops->mmap(substream, area); |
3244 | else | 3245 | else |
3245 | err = snd_pcm_default_mmap(substream, area); | 3246 | err = snd_pcm_lib_default_mmap(substream, area); |
3246 | if (!err) | 3247 | if (!err) |
3247 | atomic_inc(&substream->mmap_count); | 3248 | atomic_inc(&substream->mmap_count); |
3248 | return err; | 3249 | return err; |