diff options
Diffstat (limited to 'drivers/usb/host/u132-hcd.c')
-rw-r--r-- | drivers/usb/host/u132-hcd.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c index e98df2ee9901..7f765ec038cd 100644 --- a/drivers/usb/host/u132-hcd.c +++ b/drivers/usb/host/u132-hcd.c | |||
@@ -52,6 +52,7 @@ | |||
52 | #include <linux/workqueue.h> | 52 | #include <linux/workqueue.h> |
53 | #include <linux/platform_device.h> | 53 | #include <linux/platform_device.h> |
54 | #include <linux/pci_ids.h> | 54 | #include <linux/pci_ids.h> |
55 | #include <linux/mutex.h> | ||
55 | #include <asm/io.h> | 56 | #include <asm/io.h> |
56 | #include <asm/irq.h> | 57 | #include <asm/irq.h> |
57 | #include <asm/system.h> | 58 | #include <asm/system.h> |
@@ -83,7 +84,7 @@ static DECLARE_WAIT_QUEUE_HEAD(u132_hcd_wait); | |||
83 | * u132_module_lock exists to protect access to global variables | 84 | * u132_module_lock exists to protect access to global variables |
84 | * | 85 | * |
85 | */ | 86 | */ |
86 | static struct semaphore u132_module_lock; | 87 | static struct mutex u132_module_lock; |
87 | static int u132_exiting = 0; | 88 | static int u132_exiting = 0; |
88 | static int u132_instances = 0; | 89 | static int u132_instances = 0; |
89 | static struct list_head u132_static_list; | 90 | static struct list_head u132_static_list; |
@@ -258,10 +259,10 @@ static void u132_hcd_delete(struct kref *kref) | |||
258 | struct platform_device *pdev = u132->platform_dev; | 259 | struct platform_device *pdev = u132->platform_dev; |
259 | struct usb_hcd *hcd = u132_to_hcd(u132); | 260 | struct usb_hcd *hcd = u132_to_hcd(u132); |
260 | u132->going += 1; | 261 | u132->going += 1; |
261 | down(&u132_module_lock); | 262 | mutex_lock(&u132_module_lock); |
262 | list_del_init(&u132->u132_list); | 263 | list_del_init(&u132->u132_list); |
263 | u132_instances -= 1; | 264 | u132_instances -= 1; |
264 | up(&u132_module_lock); | 265 | mutex_unlock(&u132_module_lock); |
265 | dev_warn(&u132->platform_dev->dev, "FREEING the hcd=%p and thus the u13" | 266 | dev_warn(&u132->platform_dev->dev, "FREEING the hcd=%p and thus the u13" |
266 | "2=%p going=%d pdev=%p\n", hcd, u132, u132->going, pdev); | 267 | "2=%p going=%d pdev=%p\n", hcd, u132, u132->going, pdev); |
267 | usb_put_hcd(hcd); | 268 | usb_put_hcd(hcd); |
@@ -3111,10 +3112,10 @@ static int __devinit u132_probe(struct platform_device *pdev) | |||
3111 | int retval = 0; | 3112 | int retval = 0; |
3112 | struct u132 *u132 = hcd_to_u132(hcd); | 3113 | struct u132 *u132 = hcd_to_u132(hcd); |
3113 | hcd->rsrc_start = 0; | 3114 | hcd->rsrc_start = 0; |
3114 | down(&u132_module_lock); | 3115 | mutex_lock(&u132_module_lock); |
3115 | list_add_tail(&u132->u132_list, &u132_static_list); | 3116 | list_add_tail(&u132->u132_list, &u132_static_list); |
3116 | u132->sequence_num = ++u132_instances; | 3117 | u132->sequence_num = ++u132_instances; |
3117 | up(&u132_module_lock); | 3118 | mutex_unlock(&u132_module_lock); |
3118 | u132_u132_init_kref(u132); | 3119 | u132_u132_init_kref(u132); |
3119 | u132_initialise(u132, pdev); | 3120 | u132_initialise(u132, pdev); |
3120 | hcd->product_desc = "ELAN U132 Host Controller"; | 3121 | hcd->product_desc = "ELAN U132 Host Controller"; |
@@ -3216,7 +3217,7 @@ static int __init u132_hcd_init(void) | |||
3216 | INIT_LIST_HEAD(&u132_static_list); | 3217 | INIT_LIST_HEAD(&u132_static_list); |
3217 | u132_instances = 0; | 3218 | u132_instances = 0; |
3218 | u132_exiting = 0; | 3219 | u132_exiting = 0; |
3219 | init_MUTEX(&u132_module_lock); | 3220 | mutex_init(&u132_module_lock); |
3220 | if (usb_disabled()) | 3221 | if (usb_disabled()) |
3221 | return -ENODEV; | 3222 | return -ENODEV; |
3222 | printk(KERN_INFO "driver %s built at %s on %s\n", hcd_name, __TIME__, | 3223 | printk(KERN_INFO "driver %s built at %s on %s\n", hcd_name, __TIME__, |
@@ -3232,9 +3233,9 @@ static void __exit u132_hcd_exit(void) | |||
3232 | { | 3233 | { |
3233 | struct u132 *u132; | 3234 | struct u132 *u132; |
3234 | struct u132 *temp; | 3235 | struct u132 *temp; |
3235 | down(&u132_module_lock); | 3236 | mutex_lock(&u132_module_lock); |
3236 | u132_exiting += 1; | 3237 | u132_exiting += 1; |
3237 | up(&u132_module_lock); | 3238 | mutex_unlock(&u132_module_lock); |
3238 | list_for_each_entry_safe(u132, temp, &u132_static_list, u132_list) { | 3239 | list_for_each_entry_safe(u132, temp, &u132_static_list, u132_list) { |
3239 | platform_device_unregister(u132->platform_dev); | 3240 | platform_device_unregister(u132->platform_dev); |
3240 | } platform_driver_unregister(&u132_platform_driver); | 3241 | } platform_driver_unregister(&u132_platform_driver); |