diff options
Diffstat (limited to 'drivers/video/au1100fb.c')
-rw-r--r-- | drivers/video/au1100fb.c | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c index a54ccdc4d661..22ad85242e5b 100644 --- a/drivers/video/au1100fb.c +++ b/drivers/video/au1100fb.c | |||
@@ -361,37 +361,13 @@ void au1100fb_fb_rotate(struct fb_info *fbi, int angle) | |||
361 | int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma) | 361 | int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma) |
362 | { | 362 | { |
363 | struct au1100fb_device *fbdev; | 363 | struct au1100fb_device *fbdev; |
364 | unsigned int len; | ||
365 | unsigned long start=0, off; | ||
366 | 364 | ||
367 | fbdev = to_au1100fb_device(fbi); | 365 | fbdev = to_au1100fb_device(fbi); |
368 | 366 | ||
369 | if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) { | ||
370 | return -EINVAL; | ||
371 | } | ||
372 | |||
373 | start = fbdev->fb_phys & PAGE_MASK; | ||
374 | len = PAGE_ALIGN((start & ~PAGE_MASK) + fbdev->fb_len); | ||
375 | |||
376 | off = vma->vm_pgoff << PAGE_SHIFT; | ||
377 | |||
378 | if ((vma->vm_end - vma->vm_start + off) > len) { | ||
379 | return -EINVAL; | ||
380 | } | ||
381 | |||
382 | off += start; | ||
383 | vma->vm_pgoff = off >> PAGE_SHIFT; | ||
384 | |||
385 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | 367 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); |
386 | pgprot_val(vma->vm_page_prot) |= (6 << 9); //CCA=6 | 368 | pgprot_val(vma->vm_page_prot) |= (6 << 9); //CCA=6 |
387 | 369 | ||
388 | if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT, | 370 | return vm_iomap_memory(vma, fbdev->fb_phys, fbdev->fb_len); |
389 | vma->vm_end - vma->vm_start, | ||
390 | vma->vm_page_prot)) { | ||
391 | return -EAGAIN; | ||
392 | } | ||
393 | |||
394 | return 0; | ||
395 | } | 371 | } |
396 | 372 | ||
397 | static struct fb_ops au1100fb_ops = | 373 | static struct fb_ops au1100fb_ops = |