aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-04-19 13:01:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-19 13:01:04 -0400
commit0fe09a45c4848b5b5607b968d959fdc1821c161d (patch)
tree766cad2ca1cf971c72ae0e18eaca74ba57334213 /sound/core
parentfc9bbca8f650e5f738af8806317c0a041a48ae4a (diff)
vm: convert snd_pcm_lib_mmap_iomem() to vm_iomap_memory() helper
This is my example conversion of a few existing mmap users. The pcm mmap case is one of the more straightforward ones. Acked-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/pcm_native.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 71ae86ca64ac..eb560fa32321 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -3222,18 +3222,10 @@ EXPORT_SYMBOL_GPL(snd_pcm_lib_default_mmap);
3222int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream, 3222int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream,
3223 struct vm_area_struct *area) 3223 struct vm_area_struct *area)
3224{ 3224{
3225 long size; 3225 struct snd_pcm_runtime *runtime = substream->runtime;;
3226 unsigned long offset;
3227 3226
3228 area->vm_page_prot = pgprot_noncached(area->vm_page_prot); 3227 area->vm_page_prot = pgprot_noncached(area->vm_page_prot);
3229 area->vm_flags |= VM_IO; 3228 return vm_iomap_memory(area, runtime->dma_addr, runtime->dma_bytes);
3230 size = area->vm_end - area->vm_start;
3231 offset = area->vm_pgoff << PAGE_SHIFT;
3232 if (io_remap_pfn_range(area, area->vm_start,
3233 (substream->runtime->dma_addr + offset) >> PAGE_SHIFT,
3234 size, area->vm_page_prot))
3235 return -EAGAIN;
3236 return 0;
3237} 3229}
3238 3230
3239EXPORT_SYMBOL(snd_pcm_lib_mmap_iomem); 3231EXPORT_SYMBOL(snd_pcm_lib_mmap_iomem);