aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2007-12-07 15:57:38 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:03:18 -0500
commit105354a0f0410d4715f38e67d5790dead5dafdad (patch)
treece1b29f0dd2f6382143358ac85d6ef50c41cc723
parent14e3c152a14cb96b5f584d3885d2aedf1a1353fc (diff)
V4L/DVB (6748): Subject: v4l: nopage
Convert v4l from nopage to fault. Remove redundant vma range checks. Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/video/videobuf-dma-sg.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/media/video/videobuf-dma-sg.c b/drivers/media/video/videobuf-dma-sg.c
index 44ee408e145f..eea5b4ecfc3d 100644
--- a/drivers/media/video/videobuf-dma-sg.c
+++ b/drivers/media/video/videobuf-dma-sg.c
@@ -385,30 +385,26 @@ videobuf_vm_close(struct vm_area_struct *vma)
385 * now ...). Bounce buffers don't work very well for the data rates 385 * now ...). Bounce buffers don't work very well for the data rates
386 * video capture has. 386 * video capture has.
387 */ 387 */
388static struct page* 388static int
389videobuf_vm_nopage(struct vm_area_struct *vma, unsigned long vaddr, 389videobuf_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
390 int *type)
391{ 390{
392 struct page *page; 391 struct page *page;
393 392
394 dprintk(3,"nopage: fault @ %08lx [vma %08lx-%08lx]\n", 393 dprintk(3,"fault: fault @ %08lx [vma %08lx-%08lx]\n",
395 vaddr,vma->vm_start,vma->vm_end); 394 (unsigned long)vmf->virtual_address,vma->vm_start,vma->vm_end);
396 if (vaddr > vma->vm_end)
397 return NOPAGE_SIGBUS;
398 page = alloc_page(GFP_USER | __GFP_DMA32); 395 page = alloc_page(GFP_USER | __GFP_DMA32);
399 if (!page) 396 if (!page)
400 return NOPAGE_OOM; 397 return VM_FAULT_OOM;
401 clear_user_page(page_address(page), vaddr, page); 398 clear_user_page(page_address(page), vaddr, page);
402 if (type) 399 vmf->page = page;
403 *type = VM_FAULT_MINOR; 400 return 0;
404 return page;
405} 401}
406 402
407static struct vm_operations_struct videobuf_vm_ops = 403static struct vm_operations_struct videobuf_vm_ops =
408{ 404{
409 .open = videobuf_vm_open, 405 .open = videobuf_vm_open,
410 .close = videobuf_vm_close, 406 .close = videobuf_vm_close,
411 .nopage = videobuf_vm_nopage, 407 .fault = videobuf_vm_fault,
412}; 408};
413 409
414/* --------------------------------------------------------------------- 410/* ---------------------------------------------------------------------