diff options
| author | Nathan Scott <nathans@bruce> | 2006-03-22 15:31:14 +1100 |
|---|---|---|
| committer | Nathan Scott <nathans@bruce> | 2006-03-22 15:31:14 +1100 |
| commit | 4d74f423c722b8cadfabe087369200013b217b67 (patch) | |
| tree | d62facddfdb0dfd89f3e61f4fc699cf2feb4b082 /drivers/usb/core/devices.c | |
| parent | bb19fba1937cb6ab2bb98ac893365f6ebf88ef1b (diff) | |
| parent | e952f31bce6e9f64db01f607abc46529ba57ac9e (diff) | |
Merge HEAD from ../linux-2.6
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 2684e15b813b..c0f37343a276 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; } |
