aboutsummaryrefslogtreecommitdiff
path: root/drivers/input/joystick/iforce
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/iforce
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/iforce')
-rw-r--r--drivers/input/joystick/iforce/iforce-ff.c24
-rw-r--r--drivers/input/joystick/iforce/iforce-main.c2
-rw-r--r--drivers/input/joystick/iforce/iforce.h5
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 4678b6dab43..2b8e8456c9f 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,
unsigned char data[3];
if (!no_alloc) {
- down(&iforce->mem_mutex);
+ mutex_lock(&iforce->mem_mutex);
if (allocate_resource(&(iforce->device_memory), mod_chunk, 2,
iforce->device_memory.start, iforce->device_memory.end, 2L,
NULL, NULL)) {
- up(&iforce->mem_mutex);
+ mutex_unlock(&iforce->mem_mutex);
return -ENOMEM;
}
- up(&iforce->mem_mutex);
+ mutex_unlock(&iforce->mem_mutex);
}
data[0] = LO(mod_chunk->start);
@@ -75,14 +75,14 @@ static int make_period_modifier(struct iforce* iforce,
period = TIME_SCALE(period);
if (!no_alloc) {
- down(&iforce->mem_mutex);
+ mutex_lock(&iforce->mem_mutex);
if (allocate_resource(&(iforce->device_memory), mod_chunk, 0x0c,
iforce->device_memory.start, iforce->device_memory.end, 2L,
NULL, NULL)) {
- up(&iforce->mem_mutex);
+ mutex_unlock(&iforce->mem_mutex);
return -ENOMEM;
}
- up(&iforce->mem_mutex);
+ mutex_unlock(&iforce->mem_mutex);
}
data[0] = LO(mod_chunk->start);
@@ -115,14 +115,14 @@ static int make_envelope_modifier(struct iforce* iforce,
fade_duration = TIME_SCALE(fade_duration);
if (!no_alloc) {
- down(&iforce->mem_mutex);
+ mutex_lock(&iforce->mem_mutex);
if (allocate_resource(&(iforce->device_memory), mod_chunk, 0x0e,
iforce->device_memory.start, iforce->device_memory.end, 2L,
NULL, NULL)) {
- up(&iforce->mem_mutex);
+ mutex_unlock(&iforce->mem_mutex);
return -ENOMEM;
}
- up(&iforce->mem_mutex);
+ mutex_unlock(&iforce->mem_mutex);
}
data[0] = LO(mod_chunk->start);
@@ -152,14 +152,14 @@ static int make_condition_modifier(struct iforce* iforce,
unsigned char data[10];
if (!no_alloc) {
- down(&iforce->mem_mutex);
+ mutex_lock(&iforce->mem_mutex);
if (allocate_resource(&(iforce->device_memory), mod_chunk, 8,
iforce->device_memory.start, iforce->device_memory.end, 2L,
NULL, NULL)) {
- up(&iforce->mem_mutex);
+ mutex_unlock(&iforce->mem_mutex);
return -ENOMEM;
}
- up(&iforce->mem_mutex);
+ mutex_unlock(&iforce->mem_mutex);
}
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 b6bc0499804..ab0a26b924c 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)
init_waitqueue_head(&iforce->wait);
spin_lock_init(&iforce->xmit_lock);
- init_MUTEX(&iforce->mem_mutex);
+ mutex_init(&iforce->mem_mutex);
iforce->xmit.buf = iforce->xmit_data;
iforce->dev = input_dev;
diff --git a/drivers/input/joystick/iforce/iforce.h b/drivers/input/joystick/iforce/iforce.h
index 146f406b8f8..668f24535ba 100644
--- a/drivers/input/joystick/iforce/iforce.h
+++ b/drivers/input/joystick/iforce/iforce.h
@@ -37,7 +37,7 @@
#include <linux/serio.h>
#include <linux/config.h>
#include <linux/circ_buf.h>
-#include <asm/semaphore.h>
+#include <linux/mutex.h>
/* This module provides arbitrary resource management routines.
* I use it to manage the device's memory.
@@ -45,6 +45,7 @@
*/
#include <linux/ioport.h>
+
#define IFORCE_MAX_LENGTH 16
/* iforce::bus */
@@ -146,7 +147,7 @@ struct iforce {
wait_queue_head_t wait;
struct resource device_memory;
struct iforce_core_effect core_effects[FF_EFFECTS_MAX];
- struct semaphore mem_mutex;
+ struct mutex mem_mutex;
};
/* Get hi and low bytes of a 16-bits int */