aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-17 06:48:43 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-24 01:41:41 -0400
commit7b3d1c82417b340c73e416db10770379291010ba (patch)
tree283529d93400c32f508acc32b1eb0850be940960
parent47f698a9f2fc49711f3a43ca6713e83f0e76ea5e (diff)
fbdev/fb-puv3: use vm_iomap_memory()
Use vm_iomap_memory() instead of [io_]remap_pfn_range(). vm_iomap_memory() gives us much simpler API to map memory to userspace, and reduces possibilities for bugs. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
-rw-r--r--drivers/video/fb-puv3.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/video/fb-puv3.c b/drivers/video/fb-puv3.c
index 7d106f1f4906..27fc956166fa 100644
--- a/drivers/video/fb-puv3.c
+++ b/drivers/video/fb-puv3.c
@@ -640,21 +640,9 @@ static int unifb_pan_display(struct fb_var_screeninfo *var,
640int unifb_mmap(struct fb_info *info, 640int unifb_mmap(struct fb_info *info,
641 struct vm_area_struct *vma) 641 struct vm_area_struct *vma)
642{ 642{
643 unsigned long size = vma->vm_end - vma->vm_start;
644 unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
645 unsigned long pos = info->fix.smem_start + offset;
646
647 if (offset + size > info->fix.smem_len)
648 return -EINVAL;
649
650 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); 643 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
651 644
652 if (io_remap_pfn_range(vma, vma->vm_start, pos >> PAGE_SHIFT, size, 645 return vm_iomap_memory(vma, info->fix.smem_start, info->fix.smem_len);
653 vma->vm_page_prot))
654 return -EAGAIN;
655
656 /* VM_IO | VM_DONTEXPAND | VM_DONTDUMP are set by remap_pfn_range() */
657 return 0;
658} 646}
659 647
660static struct fb_ops unifb_ops = { 648static struct fb_ops unifb_ops = {