summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-04-19 10:01:04 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-25 12:51:24 -0700
commitb88e2557725053ef3ca54ee46be4143ba38b0cd4 (patch)
tree47547281544094c5b1f5642e360d8b35aad7981a
parentd8b1c028720bb2f3ba634c64ac2e834982b7ee7a (diff)
downloadlinux-stable-b88e2557725053ef3ca54ee46be4143ba38b0cd4.tar.gz
linux-stable-b88e2557725053ef3ca54ee46be4143ba38b0cd4.tar.bz2
linux-stable-b88e2557725053ef3ca54ee46be4143ba38b0cd4.zip
vm: convert snd_pcm_lib_mmap_iomem() to vm_iomap_memory() helper
commit 0fe09a45c4848b5b5607b968d959fdc1821c161d upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 09b4286c65f9..f4aaf5a0539c 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);
int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream,
struct vm_area_struct *area)
{
- long size;
- unsigned long offset;
+ struct snd_pcm_runtime *runtime = substream->runtime;;
area->vm_page_prot = pgprot_noncached(area->vm_page_prot);
- area->vm_flags |= VM_IO;
- size = area->vm_end - area->vm_start;
- offset = area->vm_pgoff << PAGE_SHIFT;
- if (io_remap_pfn_range(area, area->vm_start,
- (substream->runtime->dma_addr + offset) >> PAGE_SHIFT,
- size, area->vm_page_prot))
- return -EAGAIN;
- return 0;
+ return vm_iomap_memory(area, runtime->dma_addr, runtime->dma_bytes);
}
EXPORT_SYMBOL(snd_pcm_lib_mmap_iomem);