| .. | .. |
|---|
| 71 | 71 | /* Some boards misreport power switching/overcurrent*/ |
|---|
| 72 | 72 | static bool distrust_firmware = true; |
|---|
| 73 | 73 | module_param(distrust_firmware, bool, 0); |
|---|
| 74 | | -MODULE_PARM_DESC(distrust_firmware, "true to distrust firmware power/overcurren" |
|---|
| 74 | +MODULE_PARM_DESC(distrust_firmware, "true to distrust firmware power/overcurrent" |
|---|
| 75 | 75 | "t setup"); |
|---|
| 76 | 76 | static DECLARE_WAIT_QUEUE_HEAD(u132_hcd_wait); |
|---|
| 77 | 77 | /* |
|---|
| .. | .. |
|---|
| 81 | 81 | static struct mutex u132_module_lock; |
|---|
| 82 | 82 | static int u132_exiting; |
|---|
| 83 | 83 | static int u132_instances; |
|---|
| 84 | | -static struct list_head u132_static_list; |
|---|
| 85 | 84 | /* |
|---|
| 86 | 85 | * end of the global variables protected by u132_module_lock |
|---|
| 87 | 86 | */ |
|---|
| .. | .. |
|---|
| 177 | 176 | }; |
|---|
| 178 | 177 | struct u132 { |
|---|
| 179 | 178 | struct kref kref; |
|---|
| 180 | | - struct list_head u132_list; |
|---|
| 181 | 179 | struct mutex sw_lock; |
|---|
| 182 | 180 | struct mutex scheduler_lock; |
|---|
| 183 | 181 | struct u132_platform_data *board; |
|---|
| .. | .. |
|---|
| 254 | 252 | struct usb_hcd *hcd = u132_to_hcd(u132); |
|---|
| 255 | 253 | u132->going += 1; |
|---|
| 256 | 254 | mutex_lock(&u132_module_lock); |
|---|
| 257 | | - list_del_init(&u132->u132_list); |
|---|
| 258 | 255 | u132_instances -= 1; |
|---|
| 259 | 256 | mutex_unlock(&u132_module_lock); |
|---|
| 260 | 257 | dev_warn(&u132->platform_dev->dev, "FREEING the hcd=%p and thus the u13" |
|---|
| .. | .. |
|---|
| 2477 | 2474 | spin_unlock_irqrestore(&endp->queue_lock.slock, |
|---|
| 2478 | 2475 | irqs); |
|---|
| 2479 | 2476 | kfree(urbq); |
|---|
| 2480 | | - } urb->error_count = 0; |
|---|
| 2477 | + } |
|---|
| 2478 | + urb->error_count = 0; |
|---|
| 2481 | 2479 | usb_hcd_giveback_urb(hcd, urb, status); |
|---|
| 2482 | 2480 | return 0; |
|---|
| 2483 | 2481 | } else if (list_empty(&endp->urb_more)) { |
|---|
| .. | .. |
|---|
| 2553 | 2551 | dev_err(&u132->platform_dev->dev, "device is being removed\n"); |
|---|
| 2554 | 2552 | return -ESHUTDOWN; |
|---|
| 2555 | 2553 | } else { |
|---|
| 2556 | | - int frame = 0; |
|---|
| 2557 | 2554 | dev_err(&u132->platform_dev->dev, "TODO: u132_get_frame\n"); |
|---|
| 2558 | 2555 | mdelay(100); |
|---|
| 2559 | | - return frame; |
|---|
| 2556 | + return 0; |
|---|
| 2560 | 2557 | } |
|---|
| 2561 | 2558 | } |
|---|
| 2562 | 2559 | |
|---|
| .. | .. |
|---|
| 2982 | 2979 | while (rings-- > 0) { |
|---|
| 2983 | 2980 | struct u132_ring *ring = &u132->ring[rings]; |
|---|
| 2984 | 2981 | u132_ring_cancel_work(u132, ring); |
|---|
| 2985 | | - } while (endps-- > 0) { |
|---|
| 2982 | + } |
|---|
| 2983 | + while (endps-- > 0) { |
|---|
| 2986 | 2984 | struct u132_endp *endp = u132->endp[endps]; |
|---|
| 2987 | 2985 | if (endp) |
|---|
| 2988 | 2986 | u132_endp_cancel_work(u132, endp); |
|---|
| .. | .. |
|---|
| 3076 | 3074 | retval = ftdi_read_pcimem(pdev, roothub.a, &rh_a); |
|---|
| 3077 | 3075 | if (retval) |
|---|
| 3078 | 3076 | return retval; |
|---|
| 3079 | | - if (pdev->dev.dma_mask) |
|---|
| 3080 | | - return -EINVAL; |
|---|
| 3081 | 3077 | |
|---|
| 3082 | 3078 | hcd = usb_create_hcd(&u132_hc_driver, &pdev->dev, dev_name(&pdev->dev)); |
|---|
| 3083 | 3079 | if (!hcd) { |
|---|
| .. | .. |
|---|
| 3090 | 3086 | retval = 0; |
|---|
| 3091 | 3087 | hcd->rsrc_start = 0; |
|---|
| 3092 | 3088 | mutex_lock(&u132_module_lock); |
|---|
| 3093 | | - list_add_tail(&u132->u132_list, &u132_static_list); |
|---|
| 3094 | 3089 | u132->sequence_num = ++u132_instances; |
|---|
| 3095 | 3090 | mutex_unlock(&u132_module_lock); |
|---|
| 3096 | 3091 | u132_u132_init_kref(u132); |
|---|
| .. | .. |
|---|
| 3193 | 3188 | static int __init u132_hcd_init(void) |
|---|
| 3194 | 3189 | { |
|---|
| 3195 | 3190 | int retval; |
|---|
| 3196 | | - INIT_LIST_HEAD(&u132_static_list); |
|---|
| 3197 | 3191 | u132_instances = 0; |
|---|
| 3198 | 3192 | u132_exiting = 0; |
|---|
| 3199 | 3193 | mutex_init(&u132_module_lock); |
|---|
| .. | .. |
|---|
| 3201 | 3195 | return -ENODEV; |
|---|
| 3202 | 3196 | printk(KERN_INFO "driver %s\n", hcd_name); |
|---|
| 3203 | 3197 | workqueue = create_singlethread_workqueue("u132"); |
|---|
| 3198 | + if (!workqueue) |
|---|
| 3199 | + return -ENOMEM; |
|---|
| 3204 | 3200 | retval = platform_driver_register(&u132_platform_driver); |
|---|
| 3205 | 3201 | if (retval) |
|---|
| 3206 | 3202 | destroy_workqueue(workqueue); |
|---|
| .. | .. |
|---|
| 3212 | 3208 | module_init(u132_hcd_init); |
|---|
| 3213 | 3209 | static void __exit u132_hcd_exit(void) |
|---|
| 3214 | 3210 | { |
|---|
| 3215 | | - struct u132 *u132; |
|---|
| 3216 | | - struct u132 *temp; |
|---|
| 3217 | 3211 | mutex_lock(&u132_module_lock); |
|---|
| 3218 | 3212 | u132_exiting += 1; |
|---|
| 3219 | 3213 | mutex_unlock(&u132_module_lock); |
|---|
| 3220 | | - list_for_each_entry_safe(u132, temp, &u132_static_list, u132_list) { |
|---|
| 3221 | | - platform_device_unregister(u132->platform_dev); |
|---|
| 3222 | | - } |
|---|
| 3223 | 3214 | platform_driver_unregister(&u132_platform_driver); |
|---|
| 3224 | 3215 | printk(KERN_INFO "u132-hcd driver deregistered\n"); |
|---|
| 3225 | 3216 | wait_event(u132_hcd_wait, u132_instances == 0); |
|---|