diff options
author | Jonathan Corbet <corbet@lwn.net> | 2008-05-15 09:11:26 -0600 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2008-05-18 15:43:40 -0600 |
commit | 1fa984b583a809423ddb1d88fa46484071f85f80 (patch) | |
tree | 39233fd7d25f2e3659b16d0eebd3f6cbbd0bafe2 /arch/sh/boards | |
parent | 7558da942e51933b5e6aa5e851d4da1df0cd6752 (diff) | |
download | linux-1fa984b583a809423ddb1d88fa46484071f85f80.tar.bz2 |
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/sh/boards')
-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 @@ */ #include <linux/module.h> #include <linux/init.h> +#include <linux/smp_lock.h> #include <linux/kdev_t.h> #include <linux/cdev.h> #include <linux/fs.h> @@ -32,17 +33,20 @@ static int openCnt; static int gio_open(struct inode *inode, struct file *filp) { int minor; + int ret = -ENOENT; + lock_kernel(); minor = MINOR(inode->i_rdev); if (minor < DEVCOUNT) { if (openCnt > 0) { - return -EALREADY; + ret = -EALREADY; } else { openCnt++; - return 0; + ret = 0; } } - return -ENOENT; + unlock_kernel(); + return ret; } static int gio_close(struct inode *inode, struct file *filp) |