]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/char/mspec.c
Remove fs.h from mm.h
[net-next-2.6.git] / drivers / char / mspec.c
index 5c0dec39cf6c66998cdd9b65205a78882587b0a0..c08a4152ee8fc2f5df6032221d519beafb4837f0 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/miscdevice.h>
 #include <linux/spinlock.h>
 #include <linux/mm.h>
+#include <linux/fs.h>
 #include <linux/vmalloc.h>
 #include <linux/string.h>
 #include <linux/slab.h>
@@ -72,7 +73,11 @@ enum {
        MSPEC_UNCACHED
 };
 
+#ifdef CONFIG_SGI_SN
 static int is_sn2;
+#else
+#define is_sn2         0
+#endif
 
 /*
  * One of these structures is allocated when an mspec region is mmaped. The
@@ -211,7 +216,7 @@ mspec_nopfn(struct vm_area_struct *vma, unsigned long address)
        if (vdata->type == MSPEC_FETCHOP)
                paddr = TO_AMO(maddr);
        else
-               paddr = __pa(TO_CAC(maddr));
+               paddr = maddr & ~__IA64_UNCACHED_OFFSET;
 
        pfn = paddr >> PAGE_SHIFT;
 
@@ -261,7 +266,7 @@ mspec_mmap(struct file *file, struct vm_area_struct *vma, int type)
        vdata->refcnt = ATOMIC_INIT(1);
        vma->vm_private_data = vdata;
 
-       vma->vm_flags |= (VM_IO | VM_LOCKED | VM_RESERVED | VM_PFNMAP);
+       vma->vm_flags |= (VM_IO | VM_RESERVED | VM_PFNMAP);
        if (vdata->type == MSPEC_FETCHOP || vdata->type == MSPEC_UNCACHED)
                vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
        vma->vm_ops = &mspec_vm_ops;
@@ -287,7 +292,7 @@ uncached_mmap(struct file *file, struct vm_area_struct *vma)
        return mspec_mmap(file, vma, MSPEC_UNCACHED);
 }
 
-static struct file_operations fetchop_fops = {
+static const struct file_operations fetchop_fops = {
        .owner = THIS_MODULE,
        .mmap = fetchop_mmap
 };
@@ -298,7 +303,7 @@ static struct miscdevice fetchop_miscdev = {
        .fops = &fetchop_fops
 };
 
-static struct file_operations cached_fops = {
+static const struct file_operations cached_fops = {
        .owner = THIS_MODULE,
        .mmap = cached_mmap
 };
@@ -309,7 +314,7 @@ static struct miscdevice cached_miscdev = {
        .fops = &cached_fops
 };
 
-static struct file_operations uncached_fops = {
+static const struct file_operations uncached_fops = {
        .owner = THIS_MODULE,
        .mmap = uncached_mmap
 };
@@ -335,6 +340,7 @@ mspec_init(void)
         * The fetchop device only works on SN2 hardware, uncached and cached
         * memory drivers should both be valid on all ia64 hardware
         */
+#ifdef CONFIG_SGI_SN
        if (ia64_platform_is("sn2")) {
                is_sn2 = 1;
                if (is_shub2()) {
@@ -363,6 +369,7 @@ mspec_init(void)
                        goto free_scratch_pages;
                }
        }
+#endif
        ret = misc_register(&cached_miscdev);
        if (ret) {
                printk(KERN_ERR "%s: failed to register device %i\n",