From 9c926661738080ee298bc3a51240dd102973fa61 Mon Sep 17 00:00:00 2001 From: Komal Shah Date: Tue, 28 Mar 2006 06:59:25 -0800 Subject: [PATCH] [PATCH] ARM: OMAP: tahvo_user: sem2mutex conversion sem2mutex conversion Signed-off-by: Komal Shah Signed-off-by: Tony Lindgren --- drivers/cbus/tahvo-user.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/cbus/tahvo-user.c b/drivers/cbus/tahvo-user.c index 7e6f7707025..972c7efc20d 100644 --- a/drivers/cbus/tahvo-user.c +++ b/drivers/cbus/tahvo-user.c @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -64,7 +65,7 @@ static LIST_HEAD(tahvo_irqs_reserve); DECLARE_WAIT_QUEUE_HEAD(tahvo_user_waitqueue); /* Semaphore to protect irq subscription sequence */ -static struct semaphore tahvo_sem; +static struct mutex tahvo_mutex; /* This array specifies TAHVO register types (read/write/toggle) */ static const u8 tahvo_access_bits[] = { @@ -120,14 +121,14 @@ static int tahvo_user_subscribe_to_irq(int id, struct file *filp) { int ret; - down(&tahvo_sem); + mutex_lock(&tahvo_mutex); if ((tahvo_irq_subscr != NULL) && (tahvo_irq_subscr != filp)) { - up(&tahvo_sem); + mutex_unlock(&tahvo_mutex); return -EBUSY; } /* Store the file pointer of the first user process registering IRQs */ tahvo_irq_subscr = filp; - up(&tahvo_sem); + mutex_unlock(&tahvo_mutex); if (tahvo_irq_bits & (1 << id)) return 0; @@ -365,7 +366,7 @@ int tahvo_user_init(void) tahvo_irq_block = irq; spin_lock_init(&tahvo_irqs_lock); - sema_init(&tahvo_sem, 1); + mutex_init(&tahvo_mutex); /* Request a misc device */ res = misc_register(&tahvo_device); -- 2.41.0