]> err.no Git - linux-2.6/blobdiff - drivers/uio/uio.c
Merge branches 'release' and 'hp-cid' into release
[linux-2.6] / drivers / uio / uio.c
index 03b66fb734a6e7c7656b44a60afebdf4818352cb..2a77e9d42c687acc4773d68a4a2aa8b1176ff461 100644 (file)
@@ -39,7 +39,7 @@ struct uio_device {
 
 static int uio_major;
 static DEFINE_IDR(uio_idr);
-static struct file_operations uio_fops;
+static const struct file_operations uio_fops;
 
 /* UIO class infrastructure */
 static struct uio_class {
@@ -417,30 +417,28 @@ static void uio_vma_close(struct vm_area_struct *vma)
        idev->vma_count--;
 }
 
-static struct page *uio_vma_nopage(struct vm_area_struct *vma,
-                                  unsigned long address, int *type)
+static int uio_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
        struct uio_device *idev = vma->vm_private_data;
-       struct page* page = NOPAGE_SIGBUS;
+       struct page *page;
 
        int mi = uio_find_mem_index(vma);
        if (mi < 0)
-               return page;
+               return VM_FAULT_SIGBUS;
 
        if (idev->info->mem[mi].memtype == UIO_MEM_LOGICAL)
                page = virt_to_page(idev->info->mem[mi].addr);
        else
                page = vmalloc_to_page((void*)idev->info->mem[mi].addr);
        get_page(page);
-       if (type)
-               *type = VM_FAULT_MINOR;
-       return page;
+       vmf->page = page;
+       return 0;
 }
 
 static struct vm_operations_struct uio_vm_ops = {
        .open = uio_vma_open,
        .close = uio_vma_close,
-       .nopage = uio_vma_nopage,
+       .fault = uio_vma_fault,
 };
 
 static int uio_mmap_physical(struct vm_area_struct *vma)
@@ -508,7 +506,7 @@ static int uio_mmap(struct file *filep, struct vm_area_struct *vma)
        }
 }
 
-static struct file_operations uio_fops = {
+static const struct file_operations uio_fops = {
        .owner          = THIS_MODULE,
        .open           = uio_open,
        .release        = uio_release,