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>

authored by Daniel Walker and committed by Linus Torvalds 2aa9c5db e98fa281

+4 -3
+4 -3
arch/um/drivers/port_kern.c
··· 6 #include "linux/completion.h" 7 #include "linux/interrupt.h" 8 #include "linux/list.h" 9 #include "asm/atomic.h" 10 #include "init.h" 11 #include "irq_kern.h" ··· 121 return 0; 122 } 123 124 - static DECLARE_MUTEX(ports_sem); 125 static LIST_HEAD(ports); 126 127 static void port_work_proc(struct work_struct *unused) ··· 162 struct port_dev *dev = NULL; 163 int fd; 164 165 - down(&ports_sem); 166 list_for_each(ele, &ports) { 167 port = list_entry(ele, struct port_list, list); 168 if (port->port == port_num) ··· 217 out_free: 218 kfree(port); 219 out: 220 - up(&ports_sem); 221 return dev; 222 } 223
··· 6 #include "linux/completion.h" 7 #include "linux/interrupt.h" 8 #include "linux/list.h" 9 + #include "linux/mutex.h" 10 #include "asm/atomic.h" 11 #include "init.h" 12 #include "irq_kern.h" ··· 120 return 0; 121 } 122 123 + static DEFINE_MUTEX(ports_mutex); 124 static LIST_HEAD(ports); 125 126 static void port_work_proc(struct work_struct *unused) ··· 161 struct port_dev *dev = NULL; 162 int fd; 163 164 + mutex_lock(&ports_mutex); 165 list_for_each(ele, &ports) { 166 port = list_entry(ele, struct port_list, list); 167 if (port->port == port_num) ··· 216 out_free: 217 kfree(port); 218 out: 219 + mutex_unlock(&ports_mutex); 220 return dev; 221 } 222