diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2009-10-16 01:42:33 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-10-16 01:42:33 -0400 |
commit | 52a94909f00e0ffceeac202e517a126d57c1c523 (patch) | |
tree | b483cbf3af528e66829a4e18bbceb9ab52a0f81b /arch | |
parent | 5fb80ae8bd7549034845ebfba694d483070b768b (diff) |
sh: Remove BKL from landisk gio.
The open function got the BKL via the big push down. Replace it by
preempt_enable/disable as this is sufficient for an UP machine.
The ioctl can be unlocked because there is no functionality which
requires serialization. The usage by multiple callers is broken with
and without the BKL due to the local static variable addr.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sh/boards/mach-landisk/gio.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/sh/boards/mach-landisk/gio.c b/arch/sh/boards/mach-landisk/gio.c index 25cdf7358000..528013188196 100644 --- a/arch/sh/boards/mach-landisk/gio.c +++ b/arch/sh/boards/mach-landisk/gio.c | |||
@@ -14,7 +14,6 @@ | |||
14 | */ | 14 | */ |
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/smp_lock.h> | ||
18 | #include <linux/kdev_t.h> | 17 | #include <linux/kdev_t.h> |
19 | #include <linux/cdev.h> | 18 | #include <linux/cdev.h> |
20 | #include <linux/fs.h> | 19 | #include <linux/fs.h> |
@@ -35,7 +34,7 @@ static int gio_open(struct inode *inode, struct file *filp) | |||
35 | int minor; | 34 | int minor; |
36 | int ret = -ENOENT; | 35 | int ret = -ENOENT; |
37 | 36 | ||
38 | lock_kernel(); | 37 | preempt_disable(); |
39 | minor = MINOR(inode->i_rdev); | 38 | minor = MINOR(inode->i_rdev); |
40 | if (minor < DEVCOUNT) { | 39 | if (minor < DEVCOUNT) { |
41 | if (openCnt > 0) { | 40 | if (openCnt > 0) { |
@@ -45,7 +44,7 @@ static int gio_open(struct inode *inode, struct file *filp) | |||
45 | ret = 0; | 44 | ret = 0; |
46 | } | 45 | } |
47 | } | 46 | } |
48 | unlock_kernel(); | 47 | preempt_enable(); |
49 | return ret; | 48 | return ret; |
50 | } | 49 | } |
51 | 50 | ||
@@ -60,8 +59,7 @@ static int gio_close(struct inode *inode, struct file *filp) | |||
60 | return 0; | 59 | return 0; |
61 | } | 60 | } |
62 | 61 | ||
63 | static int gio_ioctl(struct inode *inode, struct file *filp, | 62 | static long gio_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
64 | unsigned int cmd, unsigned long arg) | ||
65 | { | 63 | { |
66 | unsigned int data; | 64 | unsigned int data; |
67 | static unsigned int addr = 0; | 65 | static unsigned int addr = 0; |
@@ -129,7 +127,7 @@ static const struct file_operations gio_fops = { | |||
129 | .owner = THIS_MODULE, | 127 | .owner = THIS_MODULE, |
130 | .open = gio_open, /* open */ | 128 | .open = gio_open, /* open */ |
131 | .release = gio_close, /* release */ | 129 | .release = gio_close, /* release */ |
132 | .ioctl = gio_ioctl, /* ioctl */ | 130 | .unlocked_ioctl = gio_ioctl, |
133 | }; | 131 | }; |
134 | 132 | ||
135 | static int __init gio_init(void) | 133 | static int __init gio_init(void) |