]> err.no Git - linux-2.6/blobdiff - drivers/sbus/char/flash.c
Merge branch 'core/softlockup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6] / drivers / sbus / char / flash.c
index 5ae684c011f898ab295d692eff361b9278d8a7bd..7d95e151513a0a5446e07ef6da24d9605334af53 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1997  Eddie C. Dost  (ecd@skynet.be)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/errno.h>
@@ -15,6 +14,7 @@
 #include <linux/init.h>
 #include <linux/smp_lock.h>
 #include <linux/spinlock.h>
+#include <linux/mm.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
@@ -71,7 +71,6 @@ flash_mmap(struct file *file, struct vm_area_struct *vma)
        if (vma->vm_end - (vma->vm_start + (vma->vm_pgoff << PAGE_SHIFT)) > size)
                size = vma->vm_end - (vma->vm_start + (vma->vm_pgoff << PAGE_SHIFT));
 
-       vma->vm_flags |= (VM_SHM | VM_LOCKED);
        vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 
        if (io_remap_pfn_range(vma, vma->vm_start, addr, size, vma->vm_page_prot))
@@ -128,9 +127,13 @@ flash_read(struct file * file, char __user * buf,
 static int
 flash_open(struct inode *inode, struct file *file)
 {
-       if (test_and_set_bit(0, (void *)&flash.busy) != 0)
+       lock_kernel();
+       if (test_and_set_bit(0, (void *)&flash.busy) != 0) {
+               unlock_kernel();
                return -EBUSY;
+       }
 
+       unlock_kernel();
        return 0;
 }
 
@@ -144,7 +147,7 @@ flash_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static struct file_operations flash_fops = {
+static const struct file_operations flash_fops = {
        /* no write to the Flash, use mmap
         * and play flash dependent tricks.
         */
@@ -192,7 +195,7 @@ static int __init flash_init(void)
        }
        if (!sdev) {
 #ifdef CONFIG_PCI
-               struct linux_prom_registers *ebus_regs;
+               const struct linux_prom_registers *ebus_regs;
 
                for_each_ebus(ebus) {
                        for_each_ebusdev(edev, ebus) {