diff options
author | Daniel Walker <dwalker@mvista.com> | 2008-02-05 01:31:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-05 12:44:32 -0500 |
commit | 2aa9c5db8e1eadf12a6c938dbd3e39ba6b923b8c (patch) | |
tree | 9a65466f426843e016455ff57528eb40f3ba7b32 /arch | |
parent | e98fa28160eabdcda4c4c5bf7af7a3256c10c922 (diff) |
uml: port mutex conversion
The port_sem is already used as a mutex since it's using DECLARE_MUTEX(), but
the underlying construct is still a semaphore .. This patch switches it over
to a struct mutex.
Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/um/drivers/port_kern.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/um/drivers/port_kern.c b/arch/um/drivers/port_kern.c index 330543b3129b..19930081d3d8 100644 --- a/arch/um/drivers/port_kern.c +++ b/arch/um/drivers/port_kern.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include "linux/completion.h" | 6 | #include "linux/completion.h" |
7 | #include "linux/interrupt.h" | 7 | #include "linux/interrupt.h" |
8 | #include "linux/list.h" | 8 | #include "linux/list.h" |
9 | #include "linux/mutex.h" | ||
9 | #include "asm/atomic.h" | 10 | #include "asm/atomic.h" |
10 | #include "init.h" | 11 | #include "init.h" |
11 | #include "irq_kern.h" | 12 | #include "irq_kern.h" |
@@ -120,7 +121,7 @@ static int port_accept(struct port_list *port) | |||
120 | return 0; | 121 | return 0; |
121 | } | 122 | } |
122 | 123 | ||
123 | static DECLARE_MUTEX(ports_sem); | 124 | static DEFINE_MUTEX(ports_mutex); |
124 | static LIST_HEAD(ports); | 125 | static LIST_HEAD(ports); |
125 | 126 | ||
126 | static void port_work_proc(struct work_struct *unused) | 127 | static void port_work_proc(struct work_struct *unused) |
@@ -161,7 +162,7 @@ void *port_data(int port_num) | |||
161 | struct port_dev *dev = NULL; | 162 | struct port_dev *dev = NULL; |
162 | int fd; | 163 | int fd; |
163 | 164 | ||
164 | down(&ports_sem); | 165 | mutex_lock(&ports_mutex); |
165 | list_for_each(ele, &ports) { | 166 | list_for_each(ele, &ports) { |
166 | port = list_entry(ele, struct port_list, list); | 167 | port = list_entry(ele, struct port_list, list); |
167 | if (port->port == port_num) | 168 | if (port->port == port_num) |
@@ -216,7 +217,7 @@ void *port_data(int port_num) | |||
216 | out_free: | 217 | out_free: |
217 | kfree(port); | 218 | kfree(port); |
218 | out: | 219 | out: |
219 | up(&ports_sem); | 220 | mutex_unlock(&ports_mutex); |
220 | return dev; | 221 | return dev; |
221 | } | 222 | } |
222 | 223 | ||