]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: OMAP: tahvo_user: sem2mutex conversion
authorKomal Shah <komal_shah802003@yahoo.com>
Tue, 28 Mar 2006 14:59:25 +0000 (06:59 -0800)
committerTony Lindgren <tony@atomide.com>
Tue, 28 Mar 2006 14:59:25 +0000 (06:59 -0800)
sem2mutex conversion

Signed-off-by: Komal Shah <komal_shah802003@yahoo.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/cbus/tahvo-user.c

index 7e6f770702500d87d9bcfddafb4575bcd1ee4933..972c7efc20d7089202dcce687e589bc0e02c388f 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/poll.h>
 #include <linux/list.h>
 #include <linux/spinlock.h>
+#include <linux/mutex.h>
 
 #include <asm/uaccess.h>
 
@@ -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);