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/iforce | |
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/iforce')
-rw-r--r-- | drivers/input/joystick/iforce/iforce-ff.c | 24 | ||||
-rw-r--r-- | drivers/input/joystick/iforce/iforce-main.c | 2 | ||||
-rw-r--r-- | drivers/input/joystick/iforce/iforce.h | 5 |
3 files changed, 16 insertions, 15 deletions
diff --git a/drivers/input/joystick/iforce/iforce-ff.c b/drivers/input/joystick/iforce/iforce-ff.c index 4678b6dab43b..2b8e8456c9fa 100644 --- a/drivers/input/joystick/iforce/iforce-ff.c +++ b/drivers/input/joystick/iforce/iforce-ff.c | |||
@@ -42,14 +42,14 @@ static int make_magnitude_modifier(struct iforce* iforce, | |||
42 | unsigned char data[3]; | 42 | unsigned char data[3]; |
43 | 43 | ||
44 | if (!no_alloc) { | 44 | if (!no_alloc) { |
45 | down(&iforce->mem_mutex); | 45 | mutex_lock(&iforce->mem_mutex); |
46 | if (allocate_resource(&(iforce->device_memory), mod_chunk, 2, | 46 | if (allocate_resource(&(iforce->device_memory), mod_chunk, 2, |
47 | iforce->device_memory.start, iforce->device_memory.end, 2L, | 47 | iforce->device_memory.start, iforce->device_memory.end, 2L, |
48 | NULL, NULL)) { | 48 | NULL, NULL)) { |
49 | up(&iforce->mem_mutex); | 49 | mutex_unlock(&iforce->mem_mutex); |
50 | return -ENOMEM; | 50 | return -ENOMEM; |
51 | } | 51 | } |
52 | up(&iforce->mem_mutex); | 52 | mutex_unlock(&iforce->mem_mutex); |
53 | } | 53 | } |
54 | 54 | ||
55 | data[0] = LO(mod_chunk->start); | 55 | data[0] = LO(mod_chunk->start); |
@@ -75,14 +75,14 @@ static int make_period_modifier(struct iforce* iforce, | |||
75 | period = TIME_SCALE(period); | 75 | period = TIME_SCALE(period); |
76 | 76 | ||
77 | if (!no_alloc) { | 77 | if (!no_alloc) { |
78 | down(&iforce->mem_mutex); | 78 | mutex_lock(&iforce->mem_mutex); |
79 | if (allocate_resource(&(iforce->device_memory), mod_chunk, 0x0c, | 79 | if (allocate_resource(&(iforce->device_memory), mod_chunk, 0x0c, |
80 | iforce->device_memory.start, iforce->device_memory.end, 2L, | 80 | iforce->device_memory.start, iforce->device_memory.end, 2L, |
81 | NULL, NULL)) { | 81 | NULL, NULL)) { |
82 | up(&iforce->mem_mutex); | 82 | mutex_unlock(&iforce->mem_mutex); |
83 | return -ENOMEM; | 83 | return -ENOMEM; |
84 | } | 84 | } |
85 | up(&iforce->mem_mutex); | 85 | mutex_unlock(&iforce->mem_mutex); |
86 | } | 86 | } |
87 | 87 | ||
88 | data[0] = LO(mod_chunk->start); | 88 | data[0] = LO(mod_chunk->start); |
@@ -115,14 +115,14 @@ static int make_envelope_modifier(struct iforce* iforce, | |||
115 | fade_duration = TIME_SCALE(fade_duration); | 115 | fade_duration = TIME_SCALE(fade_duration); |
116 | 116 | ||
117 | if (!no_alloc) { | 117 | if (!no_alloc) { |
118 | down(&iforce->mem_mutex); | 118 | mutex_lock(&iforce->mem_mutex); |
119 | if (allocate_resource(&(iforce->device_memory), mod_chunk, 0x0e, | 119 | if (allocate_resource(&(iforce->device_memory), mod_chunk, 0x0e, |
120 | iforce->device_memory.start, iforce->device_memory.end, 2L, | 120 | iforce->device_memory.start, iforce->device_memory.end, 2L, |
121 | NULL, NULL)) { | 121 | NULL, NULL)) { |
122 | up(&iforce->mem_mutex); | 122 | mutex_unlock(&iforce->mem_mutex); |
123 | return -ENOMEM; | 123 | return -ENOMEM; |
124 | } | 124 | } |
125 | up(&iforce->mem_mutex); | 125 | mutex_unlock(&iforce->mem_mutex); |
126 | } | 126 | } |
127 | 127 | ||
128 | data[0] = LO(mod_chunk->start); | 128 | data[0] = LO(mod_chunk->start); |
@@ -152,14 +152,14 @@ static int make_condition_modifier(struct iforce* iforce, | |||
152 | unsigned char data[10]; | 152 | unsigned char data[10]; |
153 | 153 | ||
154 | if (!no_alloc) { | 154 | if (!no_alloc) { |
155 | down(&iforce->mem_mutex); | 155 | mutex_lock(&iforce->mem_mutex); |
156 | if (allocate_resource(&(iforce->device_memory), mod_chunk, 8, | 156 | if (allocate_resource(&(iforce->device_memory), mod_chunk, 8, |
157 | iforce->device_memory.start, iforce->device_memory.end, 2L, | 157 | iforce->device_memory.start, iforce->device_memory.end, 2L, |
158 | NULL, NULL)) { | 158 | NULL, NULL)) { |
159 | up(&iforce->mem_mutex); | 159 | mutex_unlock(&iforce->mem_mutex); |
160 | return -ENOMEM; | 160 | return -ENOMEM; |
161 | } | 161 | } |
162 | up(&iforce->mem_mutex); | 162 | mutex_unlock(&iforce->mem_mutex); |
163 | } | 163 | } |
164 | 164 | ||
165 | data[0] = LO(mod_chunk->start); | 165 | data[0] = LO(mod_chunk->start); |
diff --git a/drivers/input/joystick/iforce/iforce-main.c b/drivers/input/joystick/iforce/iforce-main.c index b6bc04998047..ab0a26b924ca 100644 --- a/drivers/input/joystick/iforce/iforce-main.c +++ b/drivers/input/joystick/iforce/iforce-main.c | |||
@@ -350,7 +350,7 @@ int iforce_init_device(struct iforce *iforce) | |||
350 | 350 | ||
351 | init_waitqueue_head(&iforce->wait); | 351 | init_waitqueue_head(&iforce->wait); |
352 | spin_lock_init(&iforce->xmit_lock); | 352 | spin_lock_init(&iforce->xmit_lock); |
353 | init_MUTEX(&iforce->mem_mutex); | 353 | mutex_init(&iforce->mem_mutex); |
354 | iforce->xmit.buf = iforce->xmit_data; | 354 | iforce->xmit.buf = iforce->xmit_data; |
355 | iforce->dev = input_dev; | 355 | iforce->dev = input_dev; |
356 | 356 | ||
diff --git a/drivers/input/joystick/iforce/iforce.h b/drivers/input/joystick/iforce/iforce.h index 146f406b8f8a..668f24535ba0 100644 --- a/drivers/input/joystick/iforce/iforce.h +++ b/drivers/input/joystick/iforce/iforce.h | |||
@@ -37,7 +37,7 @@ | |||
37 | #include <linux/serio.h> | 37 | #include <linux/serio.h> |
38 | #include <linux/config.h> | 38 | #include <linux/config.h> |
39 | #include <linux/circ_buf.h> | 39 | #include <linux/circ_buf.h> |
40 | #include <asm/semaphore.h> | 40 | #include <linux/mutex.h> |
41 | 41 | ||
42 | /* This module provides arbitrary resource management routines. | 42 | /* This module provides arbitrary resource management routines. |
43 | * I use it to manage the device's memory. | 43 | * I use it to manage the device's memory. |
@@ -45,6 +45,7 @@ | |||
45 | */ | 45 | */ |
46 | #include <linux/ioport.h> | 46 | #include <linux/ioport.h> |
47 | 47 | ||
48 | |||
48 | #define IFORCE_MAX_LENGTH 16 | 49 | #define IFORCE_MAX_LENGTH 16 |
49 | 50 | ||
50 | /* iforce::bus */ | 51 | /* iforce::bus */ |
@@ -146,7 +147,7 @@ struct iforce { | |||
146 | wait_queue_head_t wait; | 147 | wait_queue_head_t wait; |
147 | struct resource device_memory; | 148 | struct resource device_memory; |
148 | struct iforce_core_effect core_effects[FF_EFFECTS_MAX]; | 149 | struct iforce_core_effect core_effects[FF_EFFECTS_MAX]; |
149 | struct semaphore mem_mutex; | 150 | struct mutex mem_mutex; |
150 | }; | 151 | }; |
151 | 152 | ||
152 | /* Get hi and low bytes of a 16-bits int */ | 153 | /* Get hi and low bytes of a 16-bits int */ |