Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11bd5933 authored by Tomi Valkeinen's avatar Tomi Valkeinen
Browse files

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: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
parent c84deb9d
Loading
Loading
Loading
Loading
+6 −12
Original line number Original line Diff line number Diff line
@@ -705,21 +705,15 @@ static int ps3fb_pan_display(struct fb_var_screeninfo *var,


static int ps3fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
static int ps3fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
{
{
	unsigned long size, offset;
	int r;


	size = vma->vm_end - vma->vm_start;
	r = vm_iomap_memory(vma, info->fix.smem_start, info->fix.smem_len);
	offset = vma->vm_pgoff << PAGE_SHIFT;
	if (offset + size > info->fix.smem_len)
		return -EINVAL;

	offset += info->fix.smem_start;
	if (remap_pfn_range(vma, vma->vm_start, offset >> PAGE_SHIFT,
			    size, vma->vm_page_prot))
		return -EAGAIN;


	dev_dbg(info->device, "ps3fb: mmap framebuffer P(%lx)->V(%lx)\n",
	dev_dbg(info->device, "ps3fb: mmap framebuffer P(%lx)->V(%lx)\n",
		offset, vma->vm_start);
		info->fix.smem_start + vma->vm_pgoff << PAGE_SHIFT,
	return 0;
		vma->vm_start);

	return r;
}
}


    /*
    /*