summaryrefslogtreecommitdiffstats
path: root/drivers/video/sgivwfb.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-18 07:50:44 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-24 08:41:42 +0300
commitc84deb9d615c02993ce0972a0b34585c7624822f (patch)
tree3663ec0b35a39adc0dda8426deee2bc0e43b212a /drivers/video/sgivwfb.c
parent5171774382959f9a42ecd36bf408f6979effcb6a (diff)
downloadblackbird-op-linux-c84deb9d615c02993ce0972a0b34585c7624822f.tar.gz
blackbird-op-linux-c84deb9d615c02993ce0972a0b34585c7624822f.zip
fbdev/sgivwfb: 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>
Diffstat (limited to 'drivers/video/sgivwfb.c')
-rw-r--r--drivers/video/sgivwfb.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/video/sgivwfb.c b/drivers/video/sgivwfb.c
index 2331fadc272b..b2a8912f6435 100644
--- a/drivers/video/sgivwfb.c
+++ b/drivers/video/sgivwfb.c
@@ -705,23 +705,17 @@ static int sgivwfb_setcolreg(u_int regno, u_int red, u_int green,
static int sgivwfb_mmap(struct fb_info *info,
struct vm_area_struct *vma)
{
- unsigned long size = vma->vm_end - vma->vm_start;
- unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
+ int r;
- if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
- return -EINVAL;
- if (offset + size > sgivwfb_mem_size)
- return -EINVAL;
- offset += sgivwfb_mem_phys;
pgprot_val(vma->vm_page_prot) =
- pgprot_val(vma->vm_page_prot) | _PAGE_PCD;
- vma->vm_flags |= VM_IO;
- if (remap_pfn_range(vma, vma->vm_start, offset >> PAGE_SHIFT,
- size, vma->vm_page_prot))
- return -EAGAIN;
+ pgprot_val(vma->vm_page_prot) | _PAGE_PCD;
+
+ r = vm_iomap_memory(vma, sgivwfb_mem_phys, sgivwfb_mem_size);
+
printk(KERN_DEBUG "sgivwfb: mmap framebuffer P(%lx)->V(%lx)\n",
offset, vma->vm_start);
- return 0;
+
+ return r;
}
int __init sgivwfb_setup(char *options)
OpenPOWER on IntegriCloud