aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2007-12-15 08:04:42 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2008-01-30 16:22:20 -0500
commitc7ea990f87f9fbe6a7183c03f7993b3360454834 (patch)
treeed8af5fe802271b174aed630d79ea949c0684574 /drivers/ieee1394
parent61db81214bcef33a41325bdc436fb515b697fcdb (diff)
ieee1394: small cleanup after "nopage"
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/ieee1394')
-rw-r--r--drivers/ieee1394/dma.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/ieee1394/dma.c b/drivers/ieee1394/dma.c
index ec024b5d5e5e..73685e7dc7e4 100644
--- a/drivers/ieee1394/dma.c
+++ b/drivers/ieee1394/dma.c
@@ -231,28 +231,20 @@ void dma_region_sync_for_device(struct dma_region *dma, unsigned long offset,
231 231
232#ifdef CONFIG_MMU 232#ifdef CONFIG_MMU
233 233
234/* fault() handler for mmap access */
235
236static int dma_region_pagefault(struct vm_area_struct *vma, 234static int dma_region_pagefault(struct vm_area_struct *vma,
237 struct vm_fault *vmf) 235 struct vm_fault *vmf)
238{ 236{
239 unsigned long kernel_virt_addr;
240
241 struct dma_region *dma = (struct dma_region *)vma->vm_private_data; 237 struct dma_region *dma = (struct dma_region *)vma->vm_private_data;
242 238
243 if (!dma->kvirt) 239 if (!dma->kvirt)
244 goto error; 240 return VM_FAULT_SIGBUS;
245 241
246 if (vmf->pgoff >= dma->n_pages) 242 if (vmf->pgoff >= dma->n_pages)
247 goto error; 243 return VM_FAULT_SIGBUS;
248 244
249 kernel_virt_addr = (unsigned long)dma->kvirt + (vmf->pgoff << PAGE_SHIFT); 245 vmf->page = vmalloc_to_page(dma->kvirt + (vmf->pgoff << PAGE_SHIFT));
250 vmf->page = vmalloc_to_page((void *)kernel_virt_addr);
251 get_page(vmf->page); 246 get_page(vmf->page);
252 return 0; 247 return 0;
253
254 error:
255 return VM_FAULT_SIGBUS;
256} 248}
257 249
258static struct vm_operations_struct dma_region_vm_ops = { 250static struct vm_operations_struct dma_region_vm_ops = {