]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/nvram.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[linux-2.6-omap-h63xx.git] / drivers / char / nvram.c
index a22662b6a1a50fc6aa25f7a000d619abd7ba1bc7..8054ee839b3c36acb0b57c7f477d139f2c3ac06c 100644 (file)
 #include <linux/init.h>
 #include <linux/proc_fs.h>
 #include <linux/spinlock.h>
-#include <linux/smp_lock.h>
 
 #include <asm/io.h>
 #include <asm/uaccess.h>
@@ -339,7 +338,7 @@ nvram_open(struct inode *inode, struct file *file)
 
        if ((nvram_open_cnt && (file->f_flags & O_EXCL)) ||
            (nvram_open_mode & NVRAM_EXCL) ||
-           ((file->f_mode & 2) && (nvram_open_mode & NVRAM_WRITE))) {
+           ((file->f_mode & FMODE_WRITE) && (nvram_open_mode & NVRAM_WRITE))) {
                spin_unlock(&nvram_state_lock);
                unlock_kernel();
                return -EBUSY;
@@ -347,7 +346,7 @@ nvram_open(struct inode *inode, struct file *file)
 
        if (file->f_flags & O_EXCL)
                nvram_open_mode |= NVRAM_EXCL;
-       if (file->f_mode & 2)
+       if (file->f_mode & FMODE_WRITE)
                nvram_open_mode |= NVRAM_WRITE;
        nvram_open_cnt++;
 
@@ -367,7 +366,7 @@ nvram_release(struct inode *inode, struct file *file)
        /* if only one instance is open, clear the EXCL bit */
        if (nvram_open_mode & NVRAM_EXCL)
                nvram_open_mode &= ~NVRAM_EXCL;
-       if (file->f_mode & 2)
+       if (file->f_mode & FMODE_WRITE)
                nvram_open_mode &= ~NVRAM_WRITE;
 
        spin_unlock(&nvram_state_lock);