提交 0fe09a45 编写于 作者: L Linus Torvalds

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: NTakashi Iwai <tiwai@suse.de>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 fc9bbca8
...@@ -3222,18 +3222,10 @@ EXPORT_SYMBOL_GPL(snd_pcm_lib_default_mmap); ...@@ -3222,18 +3222,10 @@ EXPORT_SYMBOL_GPL(snd_pcm_lib_default_mmap);
int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream, int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream,
struct vm_area_struct *area) struct vm_area_struct *area)
{ {
long size; struct snd_pcm_runtime *runtime = substream->runtime;;
unsigned long offset;
area->vm_page_prot = pgprot_noncached(area->vm_page_prot); area->vm_page_prot = pgprot_noncached(area->vm_page_prot);
area->vm_flags |= VM_IO; return vm_iomap_memory(area, runtime->dma_addr, runtime->dma_bytes);
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;
} }
EXPORT_SYMBOL(snd_pcm_lib_mmap_iomem); EXPORT_SYMBOL(snd_pcm_lib_mmap_iomem);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册