From 416732f3aab06828db0e754c96fd20dd42ada8a9 Mon Sep 17 00:00:00 2001 From: Daniel Walker Date: Mon, 4 Feb 2008 22:31:27 -0800 Subject: [PATCH] --- yaml --- r: 83231 b: refs/heads/master c: 2aa9c5db8e1eadf12a6c938dbd3e39ba6b923b8c h: refs/heads/master i: 83229: 5a9eb421e5ccd5b41c84ba5b7a625ded6244dde8 83227: 697ca41ca56f1bad21990ce579489689e5f1fd06 83223: 44899ced43c709a9fcfe8ac159bf502ec37eae68 83215: 096b1bf950e52872d9724e2f987b7d0a7cefe9ed 83199: c9fbca14f9a8d49316d64b6916c94aaf8f730ebc v: v3 --- [refs] | 2 +- trunk/arch/um/drivers/port_kern.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index dece8f61e62d..2932fa8edb2d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e98fa28160eabdcda4c4c5bf7af7a3256c10c922 +refs/heads/master: 2aa9c5db8e1eadf12a6c938dbd3e39ba6b923b8c diff --git a/trunk/arch/um/drivers/port_kern.c b/trunk/arch/um/drivers/port_kern.c index 330543b3129b..19930081d3d8 100644 --- a/trunk/arch/um/drivers/port_kern.c +++ b/trunk/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; }