summaryrefslogtreecommitdiff
path: root/drivers/input/joystick/gamecon.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/gamecon.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/gamecon.c')
-rw-r--r--drivers/input/joystick/gamecon.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/input/joystick/gamecon.c b/drivers/input/joystick/gamecon.c
index 900587acdb47..aa3ef89d8188 100644
--- a/drivers/input/joystick/gamecon.c
+++ b/drivers/input/joystick/gamecon.c
@@ -36,6 +36,7 @@
#include <linux/init.h>
#include <linux/parport.h>
#include <linux/input.h>
+#include <linux/mutex.h>
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("NES, SNES, N64, MultiSystem, PSX gamepad driver");
@@ -83,7 +84,7 @@ struct gc {
struct timer_list timer;
unsigned char pads[GC_MAX + 1];
int used;
- struct semaphore sem;
+ struct mutex mutex;
char phys[GC_MAX_DEVICES][32];
};
@@ -552,7 +553,7 @@ static int gc_open(struct input_dev *dev)
struct gc *gc = dev->private;
int err;
- err = down_interruptible(&gc->sem);
+ err = mutex_lock_interruptible(&gc->mutex);
if (err)
return err;
@@ -562,7 +563,7 @@ static int gc_open(struct input_dev *dev)
mod_timer(&gc->timer, jiffies + GC_REFRESH_TIME);
}
- up(&gc->sem);
+ mutex_unlock(&gc->mutex);
return 0;
}
@@ -570,13 +571,13 @@ static void gc_close(struct input_dev *dev)
{
struct gc *gc = dev->private;
- down(&gc->sem);
+ mutex_lock(&gc->mutex);
if (!--gc->used) {
del_timer_sync(&gc->timer);
parport_write_control(gc->pd->port, 0x00);
parport_release(gc->pd);
}
- up(&gc->sem);
+ mutex_unlock(&gc->mutex);
}
static int __init gc_setup_pad(struct gc *gc, int idx, int pad_type)
@@ -693,7 +694,7 @@ static struct gc __init *gc_probe(int parport, int *pads, int n_pads)
goto err_unreg_pardev;
}
- init_MUTEX(&gc->sem);
+ mutex_init(&gc->mutex);
gc->pd = pd;
init_timer(&gc->timer);
gc->timer.data = (long) gc;