diff options
author | Arjan van de Ven <arjan@infradead.org> | 2006-01-11 14:55:29 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-20 22:49:55 (GMT) |
commit | 4186ecf8ad16dd05759a09594de6a87e48759ba6 (patch) | |
tree | 3ee5292d9f4a36e3eb359b586289ec972bcbaf39 /drivers/usb/core/devices.c | |
parent | 35cce732d9d4d9af6b4ad4d26d8f8c0eddb573a2 (diff) | |
download | linux-4186ecf8ad16dd05759a09594de6a87e48759ba6.tar.xz |
[PATCH] USB: convert a bunch of USB semaphores to mutexes
the patch below converts a bunch of semaphores-used-as-mutex in the USB
code to mutexes
Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/devices.c')
-rw-r--r-- | drivers/usb/core/devices.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c index 2684e15..c0f3734 100644 --- a/drivers/usb/core/devices.c +++ b/drivers/usb/core/devices.c @@ -57,6 +57,7 @@ #include <linux/usb.h> #include <linux/smp_lock.h> #include <linux/usbdevice_fs.h> +#include <linux/mutex.h> #include <asm/uaccess.h> #include "usb.h" @@ -570,7 +571,7 @@ static ssize_t usb_device_read(struct file *file, char __user *buf, size_t nbyte if (!access_ok(VERIFY_WRITE, buf, nbytes)) return -EFAULT; - down (&usb_bus_list_lock); + mutex_lock(&usb_bus_list_lock); /* print devices for all busses */ list_for_each_entry(bus, &usb_bus_list, bus_list) { /* recurse through all children of the root hub */ @@ -580,12 +581,12 @@ static ssize_t usb_device_read(struct file *file, char __user *buf, size_t nbyte ret = usb_device_dump(&buf, &nbytes, &skip_bytes, ppos, bus->root_hub, bus, 0, 0, 0); usb_unlock_device(bus->root_hub); if (ret < 0) { - up(&usb_bus_list_lock); + mutex_unlock(&usb_bus_list_lock); return ret; } total_written += ret; } - up (&usb_bus_list_lock); + mutex_unlock(&usb_bus_list_lock); return total_written; } |