Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755944Ab3DWGjo (ORCPT ); Tue, 23 Apr 2013 02:39:44 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:50068 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755591Ab3DWGhM (ORCPT ); Tue, 23 Apr 2013 02:37:12 -0400 From: Tomi Valkeinen To: , CC: Tomi Valkeinen Subject: [PATCH 03/11] fbdev/au1100fb: use vm_iomap_memory() Date: Tue, 23 Apr 2013 09:36:50 +0300 Message-ID: <1366699018-5439-3-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1366699018-5439-1-git-send-email-tomi.valkeinen@ti.com> References: <1366699018-5439-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1773 Lines: 62 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 --- drivers/video/au1100fb.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c index ddabaa8..0473b11 100644 --- a/drivers/video/au1100fb.c +++ b/drivers/video/au1100fb.c @@ -375,39 +375,13 @@ void au1100fb_fb_rotate(struct fb_info *fbi, int angle) int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma) { struct au1100fb_device *fbdev; - unsigned int len; - unsigned long start=0, off; fbdev = to_au1100fb_device(fbi); - if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) { - return -EINVAL; - } - - start = fbdev->fb_phys & PAGE_MASK; - len = PAGE_ALIGN((start & ~PAGE_MASK) + fbdev->fb_len); - - off = vma->vm_pgoff << PAGE_SHIFT; - - if ((vma->vm_end - vma->vm_start + off) > len) { - return -EINVAL; - } - - off += start; - vma->vm_pgoff = off >> PAGE_SHIFT; - vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); pgprot_val(vma->vm_page_prot) |= (6 << 9); //CCA=6 - vma->vm_flags |= VM_IO; - - if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT, - vma->vm_end - vma->vm_start, - vma->vm_page_prot)) { - return -EAGAIN; - } - - return 0; + return vm_iomap_memory(vma, fbdev->fb_phys, fbdev->fb_len); } static struct fb_ops au1100fb_ops = -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/