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/amijoy.c | |
parent | 33d3f07ae17c0060dc01f26180c94cf0a39efdf1 (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.c | 11 |
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 @@ | |||
36 | #include <linux/init.h> | 36 | #include <linux/init.h> |
37 | #include <linux/input.h> | 37 | #include <linux/input.h> |
38 | #include <linux/interrupt.h> | 38 | #include <linux/interrupt.h> |
39 | #include <linux/mutex.h> | ||
39 | 40 | ||
40 | #include <asm/system.h> | 41 | #include <asm/system.h> |
41 | #include <asm/amigahw.h> | 42 | #include <asm/amigahw.h> |
@@ -52,7 +53,7 @@ MODULE_PARM_DESC(map, "Map of attached joysticks in form of <a>,<b> (default is | |||
52 | __obsolete_setup("amijoy="); | 53 | __obsolete_setup("amijoy="); |
53 | 54 | ||
54 | static int amijoy_used; | 55 | static int amijoy_used; |
55 | static DECLARE_MUTEX(amijoy_sem); | 56 | static DEFINE_MUTEX(amijoy_mutex); |
56 | static struct input_dev *amijoy_dev[2]; | 57 | static struct input_dev *amijoy_dev[2]; |
57 | static char *amijoy_phys[2] = { "amijoy/input0", "amijoy/input1" }; | 58 | static char *amijoy_phys[2] = { "amijoy/input0", "amijoy/input1" }; |
58 | 59 | ||
@@ -85,7 +86,7 @@ static int amijoy_open(struct input_dev *dev) | |||
85 | { | 86 | { |
86 | int err; | 87 | int err; |
87 | 88 | ||
88 | err = down_interruptible(&amijoy_sem); | 89 | err = mutex_lock_interruptible(&amijoy_mutex); |
89 | if (err) | 90 | if (err) |
90 | return err; | 91 | return err; |
91 | 92 | ||
@@ -97,16 +98,16 @@ static int amijoy_open(struct input_dev *dev) | |||
97 | 98 | ||
98 | amijoy_used++; | 99 | amijoy_used++; |
99 | out: | 100 | out: |
100 | up(&amijoy_sem); | 101 | mutex_unlock(&amijoy_mutex); |
101 | return err; | 102 | return err; |
102 | } | 103 | } |
103 | 104 | ||
104 | static void amijoy_close(struct input_dev *dev) | 105 | static void amijoy_close(struct input_dev *dev) |
105 | { | 106 | { |
106 | down(&amijoy_sem); | 107 | mutex_lock(&amijoy_mutex); |
107 | if (!--amijoy_used) | 108 | if (!--amijoy_used) |
108 | free_irq(IRQ_AMIGA_VERTB, amijoy_interrupt); | 109 | free_irq(IRQ_AMIGA_VERTB, amijoy_interrupt); |
109 | up(&amijoy_sem); | 110 | mutex_unlock(&amijoy_mutex); |
110 | } | 111 | } |
111 | 112 | ||
112 | static int __init amijoy_init(void) | 113 | static int __init amijoy_init(void) |