diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-04-18 00:52:42 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-04-26 01:28:47 -0400 |
commit | 11bd5933abe033fb7a3a0d1f1bd2cb4b6df8143f (patch) | |
tree | 710ead685dcbe4094ca6443b23f5b810cdf5bf4e /drivers/video/ps3fb.c | |
parent | c84deb9d615c02993ce0972a0b34585c7624822f (diff) |
fbdev/ps3fb: 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: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Diffstat (limited to 'drivers/video/ps3fb.c')
-rw-r--r-- | drivers/video/ps3fb.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c index 920c27bf3947..d9f08c653d62 100644 --- a/drivers/video/ps3fb.c +++ b/drivers/video/ps3fb.c | |||
@@ -705,21 +705,15 @@ static int ps3fb_pan_display(struct fb_var_screeninfo *var, | |||
705 | 705 | ||
706 | static int ps3fb_mmap(struct fb_info *info, struct vm_area_struct *vma) | 706 | static int ps3fb_mmap(struct fb_info *info, struct vm_area_struct *vma) |
707 | { | 707 | { |
708 | unsigned long size, offset; | 708 | int r; |
709 | 709 | ||
710 | size = vma->vm_end - vma->vm_start; | 710 | r = vm_iomap_memory(vma, info->fix.smem_start, info->fix.smem_len); |
711 | offset = vma->vm_pgoff << PAGE_SHIFT; | ||
712 | if (offset + size > info->fix.smem_len) | ||
713 | return -EINVAL; | ||
714 | |||
715 | offset += info->fix.smem_start; | ||
716 | if (remap_pfn_range(vma, vma->vm_start, offset >> PAGE_SHIFT, | ||
717 | size, vma->vm_page_prot)) | ||
718 | return -EAGAIN; | ||
719 | 711 | ||
720 | dev_dbg(info->device, "ps3fb: mmap framebuffer P(%lx)->V(%lx)\n", | 712 | dev_dbg(info->device, "ps3fb: mmap framebuffer P(%lx)->V(%lx)\n", |
721 | offset, vma->vm_start); | 713 | info->fix.smem_start + vma->vm_pgoff << PAGE_SHIFT, |
722 | return 0; | 714 | vma->vm_start); |
715 | |||
716 | return r; | ||
723 | } | 717 | } |
724 | 718 | ||
725 | /* | 719 | /* |