aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/um/drivers/port_kern.c7
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
123static DECLARE_MUTEX(ports_sem); 124static DEFINE_MUTEX(ports_mutex);
124static LIST_HEAD(ports); 125static LIST_HEAD(ports);
125 126
126static void port_work_proc(struct work_struct *unused) 127static 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