summaryrefslogtreecommitdiffstats
path: root/drivers/usb/atm/cxacru.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@infradead.org>2006-01-13 15:52:55 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2006-02-01 02:23:40 +0100
commitab3c81ff639fbee4ab32af84c809d283b773084a (patch)
tree6981ca653daa753d2a6d0bbebd4a62b1755d91ef /drivers/usb/atm/cxacru.c
parent[PATCH] USBATM: -EILSEQ workaround (diff)
downloadlinux-ab3c81ff639fbee4ab32af84c809d283b773084a.tar.xz
linux-ab3c81ff639fbee4ab32af84c809d283b773084a.zip
[PATCH] USBATM: semaphore to mutex conversion
This is the usbatm part of the Arjan, Jes and Ingo mass semaphore to mutex conversion, reworked to apply on top of the patches I just sent to you. This time, with correct attribution and signed-off lines. Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Duncan Sands <baldrick@free.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/atm/cxacru.c')
-rw-r--r--drivers/usb/atm/cxacru.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c
index 70a96e98152c..04631dcbabbc 100644
--- a/drivers/usb/atm/cxacru.c
+++ b/drivers/usb/atm/cxacru.c
@@ -36,6 +36,7 @@
#include <linux/init.h>
#include <linux/device.h> /* FIXME: linux/firmware.h should include it itself */
#include <linux/firmware.h>
+#include <linux/mutex.h>
#include "usbatm.h"
@@ -160,7 +161,7 @@ struct cxacru_data {
struct work_struct poll_work;
/* contol handles */
- struct semaphore cm_serialize;
+ struct mutex cm_serialize;
u8 *rcv_buf;
u8 *snd_buf;
struct urb *rcv_urb;
@@ -219,7 +220,7 @@ static int cxacru_cm(struct cxacru_data *instance, enum cxacru_cm_request cm,
goto fail;
}
- down(&instance->cm_serialize);
+ mutex_lock(&instance->cm_serialize);
/* submit reading urb before the writing one */
init_completion(&instance->rcv_done);
@@ -288,7 +289,7 @@ static int cxacru_cm(struct cxacru_data *instance, enum cxacru_cm_request cm,
ret = offd;
dbg("cm %#x", cm);
fail:
- up(&instance->cm_serialize);
+ mutex_unlock(&instance->cm_serialize);
return ret;
}
@@ -717,7 +718,7 @@ static int cxacru_bind(struct usbatm_data *usbatm_instance,
instance->snd_buf, PAGE_SIZE,
cxacru_blocking_completion, &instance->snd_done, 4);
- init_MUTEX(&instance->cm_serialize);
+ mutex_init(&instance->cm_serialize);
INIT_WORK(&instance->poll_work, (void *)cxacru_poll_status, instance);