summaryrefslogtreecommitdiff
path: root/drivers/input/joystick/amijoy.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-02-19 00:22:30 -0500
committerDmitry Torokhov <dtor_core@ameritech.net>2006-02-19 00:22:30 -0500
commit72ba9f0ce09c5508ec4b0cf30e88899872a83f75 (patch)
tree1fe5ab5c6484dedafebda629aeba5e8fc9d66f8d /drivers/input/joystick/amijoy.c
parent33d3f07ae17c0060dc01f26180c94cf0a39efdf1 (diff)
Input: joysticks - semaphore to mutex conversion
The conversion was generated via scripts, and the result was validated automatically via a script as well. Amijoy conversion was done by Arjan van de Ven. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/joystick/amijoy.c')
-rw-r--r--drivers/input/joystick/amijoy.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/input/joystick/amijoy.c b/drivers/input/joystick/amijoy.c
index ec55a29fc861..7249d324297b 100644
--- a/drivers/input/joystick/amijoy.c
+++ b/drivers/input/joystick/amijoy.c
@@ -36,6 +36,7 @@
#include <linux/init.h>
#include <linux/input.h>
#include <linux/interrupt.h>
+#include <linux/mutex.h>
#include <asm/system.h>
#include <asm/amigahw.h>
@@ -52,7 +53,7 @@ MODULE_PARM_DESC(map, "Map of attached joysticks in form of <a>,<b> (default is
__obsolete_setup("amijoy=");
static int amijoy_used;
-static DECLARE_MUTEX(amijoy_sem);
+static DEFINE_MUTEX(amijoy_mutex);
static struct input_dev *amijoy_dev[2];
static char *amijoy_phys[2] = { "amijoy/input0", "amijoy/input1" };
@@ -85,7 +86,7 @@ static int amijoy_open(struct input_dev *dev)
{
int err;
- err = down_interruptible(&amijoy_sem);
+ err = mutex_lock_interruptible(&amijoy_mutex);
if (err)
return err;
@@ -97,16 +98,16 @@ static int amijoy_open(struct input_dev *dev)
amijoy_used++;
out:
- up(&amijoy_sem);
+ mutex_unlock(&amijoy_mutex);
return err;
}
static void amijoy_close(struct input_dev *dev)
{
- down(&amijoy_sem);
+ mutex_lock(&amijoy_mutex);
if (!--amijoy_used)
free_irq(IRQ_AMIGA_VERTB, amijoy_interrupt);
- up(&amijoy_sem);
+ mutex_unlock(&amijoy_mutex);
}
static int __init amijoy_init(void)