X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=arch%2Fum%2Fdrivers%2Fport_kern.c;h=19930081d3d8e93c42c7c0cf3d8be783ede5c304;hb=2aa9c5db8e1eadf12a6c938dbd3e39ba6b923b8c;hp=330543b3129b5a7ac613e3566456eaf3ef50040c;hpb=fc8a327db6c46de783b1a4276d846841b9abc24c;p=mv-sheeva.git diff --git a/arch/um/drivers/port_kern.c b/arch/um/drivers/port_kern.c index 330543b3129..19930081d3d 100644 --- a/arch/um/drivers/port_kern.c +++ b/arch/um/drivers/port_kern.c @@ -6,6 +6,7 @@ #include "linux/completion.h" #include "linux/interrupt.h" #include "linux/list.h" +#include "linux/mutex.h" #include "asm/atomic.h" #include "init.h" #include "irq_kern.h" @@ -120,7 +121,7 @@ static int port_accept(struct port_list *port) return 0; } -static DECLARE_MUTEX(ports_sem); +static DEFINE_MUTEX(ports_mutex); static LIST_HEAD(ports); static void port_work_proc(struct work_struct *unused) @@ -161,7 +162,7 @@ void *port_data(int port_num) struct port_dev *dev = NULL; int fd; - down(&ports_sem); + mutex_lock(&ports_mutex); list_for_each(ele, &ports) { port = list_entry(ele, struct port_list, list); if (port->port == port_num) @@ -216,7 +217,7 @@ void *port_data(int port_num) out_free: kfree(port); out: - up(&ports_sem); + mutex_unlock(&ports_mutex); return dev; }