From 741863442d0102f61c4a366abac45961f0a92ba7 Mon Sep 17 00:00:00 2001 From: Komal Shah Date: Tue, 28 Mar 2006 06:49:39 -0800 Subject: [PATCH] [PATCH] ARM: OMAP: Menelaus: sem2mutex conversion sem2mutex conversion Signed-off-by: Komal Shah Signed-off-by: Tony Lindgren --- drivers/i2c/chips/menelaus.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/i2c/chips/menelaus.c b/drivers/i2c/chips/menelaus.c index c3a750e56c4..b305e7f2ac2 100644 --- a/drivers/i2c/chips/menelaus.c +++ b/drivers/i2c/chips/menelaus.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -133,7 +134,7 @@ I2C_CLIENT_INSMOD; struct menelaus_chip { unsigned long initialized; - struct semaphore lock; + struct mutex lock; struct i2c_client client; struct work_struct work; int irq; @@ -193,10 +194,10 @@ static void menelaus_ack_irq(int irq) /* Adds a handler for an interrupt. Does not run in interrupt context */ static int menelaus_add_irq_work(int irq, void * handler) { - down(&menelaus.lock); + mutex_lock(&menelaus.lock); menelaus.handlers[irq] = handler; menelaus_enable_irq(irq); - up(&menelaus.lock); + mutex_unlock(&menelaus.lock); return 0; } @@ -204,10 +205,10 @@ static int menelaus_add_irq_work(int irq, void * handler) /* Removes handler for an interrupt */ static void menelaus_remove_irq_work(int irq) { - down(&menelaus.lock); + mutex_lock(&menelaus.lock); menelaus_disable_irq(irq); menelaus.handlers[irq] = NULL; - up(&menelaus.lock); + mutex_unlock(&menelaus.lock); } /*-----------------------------------------------------------------------*/ @@ -332,7 +333,7 @@ static void menelaus_work(void * _menelaus) for (i = 0; i < IH_MENELAUS_IRQS; i++) { if (isr & (1 << i)) { - down(&menelaus->lock); + mutex_lock(&menelaus->lock); menelaus_disable_irq(i); menelaus_ack_irq(i); if (menelaus->handlers[i]) { @@ -340,7 +341,7 @@ static void menelaus_work(void * _menelaus) handler(menelaus); } menelaus_enable_irq(i); - up(&menelaus->lock); + mutex_unlock(&menelaus->lock); } } } @@ -405,7 +406,7 @@ static int menelaus_probe(struct i2c_adapter *adapter, int address, int kind) if (err) printk(KERN_ERR "Could not get Menelaus IRQ\n"); - init_MUTEX(&menelaus.lock); + mutex_init(&menelaus.lock); INIT_WORK(&menelaus.work, menelaus_work, &menelaus); if (kind < 0) -- 2.41.1