From: Komal Shah Date: Tue, 28 Mar 2006 14:55:51 +0000 (-0800) Subject: [PATCH] ARM: OMAP: retu-user: sem2mutex conversion X-Git-Tag: v2.6.16-omap1~11 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=06563a863d399ab6a3a5c104ddf086030f33b6f6;p=linux-2.6-omap-h63xx.git [PATCH] ARM: OMAP: retu-user: sem2mutex conversion sem2mutex conversion Signed-off-by: Komal Shah Signed-off-by: Tony Lindgren --- diff --git a/drivers/cbus/retu-user.c b/drivers/cbus/retu-user.c index 69d1be966de..3245945bebb 100644 --- a/drivers/cbus/retu-user.c +++ b/drivers/cbus/retu-user.c @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -64,7 +65,7 @@ static LIST_HEAD(retu_irqs_reserve); DECLARE_WAIT_QUEUE_HEAD(retu_user_waitqueue); /* Semaphore to protect irq subscription sequence */ -static struct semaphore retu_sem; +static struct mutex retu_mutex; /* This array specifies RETU register types (read/write/toggle) */ static const u8 retu_access_bits[] = { @@ -135,14 +136,14 @@ static int retu_user_subscribe_to_irq(int id, struct file *filp) { int ret; - down(&retu_sem); + mutex_lock(&retu_mutex); if ((retu_irq_subscr != NULL) && (retu_irq_subscr != filp)) { - up(&retu_sem); + mutex_unlock(&retu_mutex); return -EBUSY; } /* Store the file pointer of the first user process registering IRQs */ retu_irq_subscr = filp; - up(&retu_sem); + mutex_unlock(&retu_mutex); if (retu_irq_bits & (1 << id)) return 0; @@ -384,7 +385,7 @@ int retu_user_init(void) retu_irq_block = irq; spin_lock_init(&retu_irqs_lock); - sema_init(&retu_sem, 1); + mutex_init(&retu_mutex); /* Request a misc device */ res = misc_register(&retu_device);