]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/mem.c
I think that if a PCI bus is a root bus, attached to a host bridge not a
[linux-2.6-omap-h63xx.git] / drivers / char / mem.c
index f182752fe918b9b08bb601bd0bc827bb3e1f0cf2..29c3b631445af851e9e90c93f7a25dbdef08ad7a 100644 (file)
@@ -231,9 +231,7 @@ static ssize_t write_mem(struct file * file, const char __user * buf,
 static int mmap_mem(struct file * file, struct vm_area_struct * vma)
 {
 #if defined(__HAVE_PHYS_MEM_ACCESS_PROT)
-       unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
-
-       vma->vm_page_prot = phys_mem_access_prot(file, offset,
+       vma->vm_page_prot = phys_mem_access_prot(file, vma->vm_pgoff,
                                                 vma->vm_end - vma->vm_start,
                                                 vma->vm_page_prot);
 #elif defined(pgprot_noncached)
@@ -593,7 +591,7 @@ static inline size_t read_zero_pagealigned(char __user * buf, size_t size)
 
                if (vma->vm_start > addr || (vma->vm_flags & VM_WRITE) == 0)
                        goto out_up;
-               if (vma->vm_flags & (VM_SHARED | VM_HUGETLB))
+               if (vma->vm_flags & (VM_SHARED | VM_HUGETLB | VM_UNPAGED))
                        break;
                count = vma->vm_end - addr;
                if (count > size)
@@ -920,7 +918,8 @@ static int __init chr_dev_init(void)
 
        mem_class = class_create(THIS_MODULE, "mem");
        for (i = 0; i < ARRAY_SIZE(devlist); i++) {
-               class_device_create(mem_class, MKDEV(MEM_MAJOR, devlist[i].minor),
+               class_device_create(mem_class, NULL,
+                                       MKDEV(MEM_MAJOR, devlist[i].minor),
                                        NULL, devlist[i].name);
                devfs_mk_cdev(MKDEV(MEM_MAJOR, devlist[i].minor),
                                S_IFCHR | devlist[i].mode, devlist[i].name);