diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-02-19 00:22:30 -0500 |
---|---|---|
committer | Dmitry Torokhov <dtor_core@ameritech.net> | 2006-02-19 00:22:30 -0500 |
commit | 72ba9f0ce09c5508ec4b0cf30e88899872a83f75 (patch) | |
tree | 1fe5ab5c6484dedafebda629aeba5e8fc9d66f8d /drivers/input/joystick/db9.c | |
parent | 33d3f07ae17c0060dc01f26180c94cf0a39efdf1 (diff) | |
download | op-kernel-dev-72ba9f0ce09c5508ec4b0cf30e88899872a83f75.zip op-kernel-dev-72ba9f0ce09c5508ec4b0cf30e88899872a83f75.tar.gz |
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/db9.c')
-rw-r--r-- | drivers/input/joystick/db9.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/input/joystick/db9.c b/drivers/input/joystick/db9.c index dcffc34..e618946 100644 --- a/drivers/input/joystick/db9.c +++ b/drivers/input/joystick/db9.c @@ -38,6 +38,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("Atari, Amstrad, Commodore, Amiga, Sega, etc. joystick driver"); @@ -111,7 +112,7 @@ struct db9 { struct pardevice *pd; int mode; int used; - struct semaphore sem; + struct mutex mutex; char phys[DB9_MAX_DEVICES][32]; }; @@ -525,7 +526,7 @@ static int db9_open(struct input_dev *dev) struct parport *port = db9->pd->port; int err; - err = down_interruptible(&db9->sem); + err = mutex_lock_interruptible(&db9->mutex); if (err) return err; @@ -539,7 +540,7 @@ static int db9_open(struct input_dev *dev) mod_timer(&db9->timer, jiffies + DB9_REFRESH_TIME); } - up(&db9->sem); + mutex_unlock(&db9->mutex); return 0; } @@ -548,14 +549,14 @@ static void db9_close(struct input_dev *dev) struct db9 *db9 = dev->private; struct parport *port = db9->pd->port; - down(&db9->sem); + mutex_lock(&db9->mutex); if (!--db9->used) { del_timer_sync(&db9->timer); parport_write_control(port, 0x00); parport_data_forward(port); parport_release(db9->pd); } - up(&db9->sem); + mutex_unlock(&db9->mutex); } static struct db9 __init *db9_probe(int parport, int mode) @@ -603,7 +604,7 @@ static struct db9 __init *db9_probe(int parport, int mode) goto err_unreg_pardev; } - init_MUTEX(&db9->sem); + mutex_init(&db9->mutex); db9->pd = pd; db9->mode = mode; init_timer(&db9->timer); |