diff options
author | Jonathan Corbet <corbet@lwn.net> | 2008-05-15 11:11:26 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2008-05-18 17:43:40 -0400 |
commit | 1fa984b583a809423ddb1d88fa46484071f85f80 (patch) | |
tree | 39233fd7d25f2e3659b16d0eebd3f6cbbd0bafe2 /arch | |
parent | 7558da942e51933b5e6aa5e851d4da1df0cd6752 (diff) |
sh: cdev lock_kernel() pushdown
Push the cdev lock_kernel() call down into the sh gio driver.
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sh/boards/landisk/gio.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/sh/boards/landisk/gio.c b/arch/sh/boards/landisk/gio.c index 17025080db35..0c15b0a50b99 100644 --- a/arch/sh/boards/landisk/gio.c +++ b/arch/sh/boards/landisk/gio.c | |||
@@ -14,6 +14,7 @@ | |||
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> | ||
17 | #include <linux/kdev_t.h> | 18 | #include <linux/kdev_t.h> |
18 | #include <linux/cdev.h> | 19 | #include <linux/cdev.h> |
19 | #include <linux/fs.h> | 20 | #include <linux/fs.h> |
@@ -32,17 +33,20 @@ static int openCnt; | |||
32 | static int gio_open(struct inode *inode, struct file *filp) | 33 | static int gio_open(struct inode *inode, struct file *filp) |
33 | { | 34 | { |
34 | int minor; | 35 | int minor; |
36 | int ret = -ENOENT; | ||
35 | 37 | ||
38 | lock_kernel(); | ||
36 | minor = MINOR(inode->i_rdev); | 39 | minor = MINOR(inode->i_rdev); |
37 | if (minor < DEVCOUNT) { | 40 | if (minor < DEVCOUNT) { |
38 | if (openCnt > 0) { | 41 | if (openCnt > 0) { |
39 | return -EALREADY; | 42 | ret = -EALREADY; |
40 | } else { | 43 | } else { |
41 | openCnt++; | 44 | openCnt++; |
42 | return 0; | 45 | ret = 0; |
43 | } | 46 | } |
44 | } | 47 | } |
45 | return -ENOENT; | 48 | unlock_kernel(); |
49 | return ret; | ||
46 | } | 50 | } |
47 | 51 | ||
48 | static int gio_close(struct inode *inode, struct file *filp) | 52 | static int gio_close(struct inode *inode, struct file *filp) |