diff options
author | Jonathan Corbet <corbet@lwn.net> | 2008-05-15 11:10:50 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2008-05-18 17:43:40 -0400 |
commit | 7558da942e51933b5e6aa5e851d4da1df0cd6752 (patch) | |
tree | 4a9083e1a94b59cfec25cf5a53689f0f7893d1b8 /arch/mips/kernel/vpe.c | |
parent | 0c401df37ef9f45f35390a5574e24cbf3f916acf (diff) |
mips: cdev lock_kernel() pushdown
Push the cdev lock_kernel() call into MIPS-specific drivers.
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'arch/mips/kernel/vpe.c')
-rw-r--r-- | arch/mips/kernel/vpe.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index 2794501ff302..972b2d2b8401 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/vmalloc.h> | 38 | #include <linux/vmalloc.h> |
39 | #include <linux/elf.h> | 39 | #include <linux/elf.h> |
40 | #include <linux/seq_file.h> | 40 | #include <linux/seq_file.h> |
41 | #include <linux/smp_lock.h> | ||
41 | #include <linux/syscalls.h> | 42 | #include <linux/syscalls.h> |
42 | #include <linux/moduleloader.h> | 43 | #include <linux/moduleloader.h> |
43 | #include <linux/interrupt.h> | 44 | #include <linux/interrupt.h> |
@@ -1050,17 +1051,20 @@ static int vpe_open(struct inode *inode, struct file *filp) | |||
1050 | enum vpe_state state; | 1051 | enum vpe_state state; |
1051 | struct vpe_notifications *not; | 1052 | struct vpe_notifications *not; |
1052 | struct vpe *v; | 1053 | struct vpe *v; |
1053 | int ret; | 1054 | int ret, err = 0; |
1054 | 1055 | ||
1056 | lock_kernel(); | ||
1055 | if (minor != iminor(inode)) { | 1057 | if (minor != iminor(inode)) { |
1056 | /* assume only 1 device at the moment. */ | 1058 | /* assume only 1 device at the moment. */ |
1057 | printk(KERN_WARNING "VPE loader: only vpe1 is supported\n"); | 1059 | printk(KERN_WARNING "VPE loader: only vpe1 is supported\n"); |
1058 | return -ENODEV; | 1060 | err = -ENODEV; |
1061 | goto out; | ||
1059 | } | 1062 | } |
1060 | 1063 | ||
1061 | if ((v = get_vpe(tclimit)) == NULL) { | 1064 | if ((v = get_vpe(tclimit)) == NULL) { |
1062 | printk(KERN_WARNING "VPE loader: unable to get vpe\n"); | 1065 | printk(KERN_WARNING "VPE loader: unable to get vpe\n"); |
1063 | return -ENODEV; | 1066 | err = -ENODEV; |
1067 | goto out; | ||
1064 | } | 1068 | } |
1065 | 1069 | ||
1066 | state = xchg(&v->state, VPE_STATE_INUSE); | 1070 | state = xchg(&v->state, VPE_STATE_INUSE); |
@@ -1100,6 +1104,8 @@ static int vpe_open(struct inode *inode, struct file *filp) | |||
1100 | v->shared_ptr = NULL; | 1104 | v->shared_ptr = NULL; |
1101 | v->__start = 0; | 1105 | v->__start = 0; |
1102 | 1106 | ||
1107 | out: | ||
1108 | unlock_kernel(); | ||
1103 | return 0; | 1109 | return 0; |
1104 | } | 1110 | } |
1105 | 1111 | ||