aboutsummaryrefslogtreecommitdiff
path: root/drivers/char/mem.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-09 08:07:38 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-09 08:07:38 -0800
commit18821b0408efc92ec2804128ba9382a3bcebf132 (patch)
treef98fbf75e8e8f33965e489879505fb621e2f11bb /drivers/char/mem.c
parent3b8ecd22447c4266500c0bcf97f035310543e494 (diff)
parent55e858c8483af427144f33b42b818b30612b82b0 (diff)
Merge branch 'bkl-drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'bkl-drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: agp: Remove the BKL from agp_open inifiband: Remove BKL from ipath_open() mips: Remove BKL from tb0219 drivers: Remove BKL from scx200_gpio drivers: Remove BKL from pc8736x_gpio parisc: Remove BKL from eisa_eeprom rtc: Remove BKL from efirtc input: Remove BKL from hp_sdc_rtc hw_random: Remove BKL from core macintosh: Remove BKL from ans-lcd nvram: Drop the bkl from non-generic nvram_llseek() nvram: Drop the bkl from nvram_llseek() mem_class: Drop the bkl from memory_open() spi: Remove BKL from spidev_open drivers: Remove BKL from cs5535_gpio drivers: Remove BKL from misc_open
Diffstat (limited to 'drivers/char/mem.c')
-rw-r--r--drivers/char/mem.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index a074fceb67d..ad82ec92ebd 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -26,7 +26,6 @@
#include <linux/bootmem.h>
#include <linux/splice.h>
#include <linux/pfn.h>
-#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/io.h>
@@ -892,29 +891,23 @@ static int memory_open(struct inode *inode, struct file *filp)
{
int minor;
const struct memdev *dev;
- int ret = -ENXIO;
-
- lock_kernel();
minor = iminor(inode);
if (minor >= ARRAY_SIZE(devlist))
- goto out;
+ return -ENXIO;
dev = &devlist[minor];
if (!dev->fops)
- goto out;
+ return -ENXIO;
filp->f_op = dev->fops;
if (dev->dev_info)
filp->f_mapping->backing_dev_info = dev->dev_info;
if (dev->fops->open)
- ret = dev->fops->open(inode, filp);
- else
- ret = 0;
-out:
- unlock_kernel();
- return ret;
+ return dev->fops->open(inode, filp);
+
+ return 0;
}
static const struct file_operations memory_fops = {