diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/atm/cxacru.c | 12 | ||||
-rw-r--r-- | drivers/usb/atm/speedtch.c | 15 | ||||
-rw-r--r-- | drivers/usb/atm/ueagle-atm.c | 6 | ||||
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 6 | ||||
-rw-r--r-- | drivers/usb/core/hub.c | 18 | ||||
-rw-r--r-- | drivers/usb/core/hub.h | 2 | ||||
-rw-r--r-- | drivers/usb/core/message.c | 7 | ||||
-rw-r--r-- | drivers/usb/core/usb.c | 9 | ||||
-rw-r--r-- | drivers/usb/gadget/ether.c | 6 | ||||
-rw-r--r-- | drivers/usb/host/u132-hcd.c | 62 | ||||
-rw-r--r-- | drivers/usb/input/hid-core.c | 7 | ||||
-rw-r--r-- | drivers/usb/misc/ftdi-elan.c | 86 | ||||
-rw-r--r-- | drivers/usb/misc/phidgetkit.c | 21 | ||||
-rw-r--r-- | drivers/usb/misc/phidgetmotorcontrol.c | 11 | ||||
-rw-r--r-- | drivers/usb/net/kaweth.c | 9 | ||||
-rw-r--r-- | drivers/usb/net/pegasus.c | 6 | ||||
-rw-r--r-- | drivers/usb/net/pegasus.h | 2 | ||||
-rw-r--r-- | drivers/usb/net/usbnet.c | 7 | ||||
-rw-r--r-- | drivers/usb/serial/aircable.c | 13 | ||||
-rw-r--r-- | drivers/usb/serial/digi_acceleport.c | 14 | ||||
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 19 | ||||
-rw-r--r-- | drivers/usb/serial/keyspan_pda.c | 22 | ||||
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 7 | ||||
-rw-r--r-- | drivers/usb/serial/whiteheat.c | 15 |
24 files changed, 186 insertions, 196 deletions
diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c index e6565633ba0f..3dfa3e40e148 100644 --- a/drivers/usb/atm/cxacru.c +++ b/drivers/usb/atm/cxacru.c | |||
@@ -158,7 +158,7 @@ struct cxacru_data { | |||
158 | const struct cxacru_modem_type *modem_type; | 158 | const struct cxacru_modem_type *modem_type; |
159 | 159 | ||
160 | int line_status; | 160 | int line_status; |
161 | struct work_struct poll_work; | 161 | struct delayed_work poll_work; |
162 | 162 | ||
163 | /* contol handles */ | 163 | /* contol handles */ |
164 | struct mutex cm_serialize; | 164 | struct mutex cm_serialize; |
@@ -347,7 +347,7 @@ static int cxacru_card_status(struct cxacru_data *instance) | |||
347 | return 0; | 347 | return 0; |
348 | } | 348 | } |
349 | 349 | ||
350 | static void cxacru_poll_status(struct cxacru_data *instance); | 350 | static void cxacru_poll_status(struct work_struct *work); |
351 | 351 | ||
352 | static int cxacru_atm_start(struct usbatm_data *usbatm_instance, | 352 | static int cxacru_atm_start(struct usbatm_data *usbatm_instance, |
353 | struct atm_dev *atm_dev) | 353 | struct atm_dev *atm_dev) |
@@ -376,12 +376,14 @@ static int cxacru_atm_start(struct usbatm_data *usbatm_instance, | |||
376 | } | 376 | } |
377 | 377 | ||
378 | /* Start status polling */ | 378 | /* Start status polling */ |
379 | cxacru_poll_status(instance); | 379 | cxacru_poll_status(&instance->poll_work.work); |
380 | return 0; | 380 | return 0; |
381 | } | 381 | } |
382 | 382 | ||
383 | static void cxacru_poll_status(struct cxacru_data *instance) | 383 | static void cxacru_poll_status(struct work_struct *work) |
384 | { | 384 | { |
385 | struct cxacru_data *instance = | ||
386 | container_of(work, struct cxacru_data, poll_work.work); | ||
385 | u32 buf[CXINF_MAX] = {}; | 387 | u32 buf[CXINF_MAX] = {}; |
386 | struct usbatm_data *usbatm = instance->usbatm; | 388 | struct usbatm_data *usbatm = instance->usbatm; |
387 | struct atm_dev *atm_dev = usbatm->atm_dev; | 389 | struct atm_dev *atm_dev = usbatm->atm_dev; |
@@ -720,7 +722,7 @@ static int cxacru_bind(struct usbatm_data *usbatm_instance, | |||
720 | 722 | ||
721 | mutex_init(&instance->cm_serialize); | 723 | mutex_init(&instance->cm_serialize); |
722 | 724 | ||
723 | INIT_WORK(&instance->poll_work, (void *)cxacru_poll_status, instance); | 725 | INIT_DELAYED_WORK(&instance->poll_work, cxacru_poll_status); |
724 | 726 | ||
725 | usbatm_instance->driver_data = instance; | 727 | usbatm_instance->driver_data = instance; |
726 | 728 | ||
diff --git a/drivers/usb/atm/speedtch.c b/drivers/usb/atm/speedtch.c index c870c804470f..7ed34bb1c50f 100644 --- a/drivers/usb/atm/speedtch.c +++ b/drivers/usb/atm/speedtch.c | |||
@@ -142,7 +142,7 @@ struct speedtch_instance_data { | |||
142 | 142 | ||
143 | struct speedtch_params params; /* set in probe, constant afterwards */ | 143 | struct speedtch_params params; /* set in probe, constant afterwards */ |
144 | 144 | ||
145 | struct work_struct status_checker; | 145 | struct delayed_work status_checker; |
146 | 146 | ||
147 | unsigned char last_status; | 147 | unsigned char last_status; |
148 | 148 | ||
@@ -498,8 +498,11 @@ static int speedtch_start_synchro(struct speedtch_instance_data *instance) | |||
498 | return ret; | 498 | return ret; |
499 | } | 499 | } |
500 | 500 | ||
501 | static void speedtch_check_status(struct speedtch_instance_data *instance) | 501 | static void speedtch_check_status(struct work_struct *work) |
502 | { | 502 | { |
503 | struct speedtch_instance_data *instance = | ||
504 | container_of(work, struct speedtch_instance_data, | ||
505 | status_checker.work); | ||
503 | struct usbatm_data *usbatm = instance->usbatm; | 506 | struct usbatm_data *usbatm = instance->usbatm; |
504 | struct atm_dev *atm_dev = usbatm->atm_dev; | 507 | struct atm_dev *atm_dev = usbatm->atm_dev; |
505 | unsigned char *buf = instance->scratch_buffer; | 508 | unsigned char *buf = instance->scratch_buffer; |
@@ -576,7 +579,7 @@ static void speedtch_status_poll(unsigned long data) | |||
576 | { | 579 | { |
577 | struct speedtch_instance_data *instance = (void *)data; | 580 | struct speedtch_instance_data *instance = (void *)data; |
578 | 581 | ||
579 | schedule_work(&instance->status_checker); | 582 | schedule_delayed_work(&instance->status_checker, 0); |
580 | 583 | ||
581 | /* The following check is racy, but the race is harmless */ | 584 | /* The following check is racy, but the race is harmless */ |
582 | if (instance->poll_delay < MAX_POLL_DELAY) | 585 | if (instance->poll_delay < MAX_POLL_DELAY) |
@@ -596,7 +599,7 @@ static void speedtch_resubmit_int(unsigned long data) | |||
596 | if (int_urb) { | 599 | if (int_urb) { |
597 | ret = usb_submit_urb(int_urb, GFP_ATOMIC); | 600 | ret = usb_submit_urb(int_urb, GFP_ATOMIC); |
598 | if (!ret) | 601 | if (!ret) |
599 | schedule_work(&instance->status_checker); | 602 | schedule_delayed_work(&instance->status_checker, 0); |
600 | else { | 603 | else { |
601 | atm_dbg(instance->usbatm, "%s: usb_submit_urb failed with result %d\n", __func__, ret); | 604 | atm_dbg(instance->usbatm, "%s: usb_submit_urb failed with result %d\n", __func__, ret); |
602 | mod_timer(&instance->resubmit_timer, jiffies + msecs_to_jiffies(RESUBMIT_DELAY)); | 605 | mod_timer(&instance->resubmit_timer, jiffies + msecs_to_jiffies(RESUBMIT_DELAY)); |
@@ -640,7 +643,7 @@ static void speedtch_handle_int(struct urb *int_urb) | |||
640 | 643 | ||
641 | if ((int_urb = instance->int_urb)) { | 644 | if ((int_urb = instance->int_urb)) { |
642 | ret = usb_submit_urb(int_urb, GFP_ATOMIC); | 645 | ret = usb_submit_urb(int_urb, GFP_ATOMIC); |
643 | schedule_work(&instance->status_checker); | 646 | schedule_delayed_work(&instance->status_checker, 0); |
644 | if (ret < 0) { | 647 | if (ret < 0) { |
645 | atm_dbg(usbatm, "%s: usb_submit_urb failed with result %d\n", __func__, ret); | 648 | atm_dbg(usbatm, "%s: usb_submit_urb failed with result %d\n", __func__, ret); |
646 | goto fail; | 649 | goto fail; |
@@ -855,7 +858,7 @@ static int speedtch_bind(struct usbatm_data *usbatm, | |||
855 | 858 | ||
856 | usbatm->flags |= (use_isoc ? UDSL_USE_ISOC : 0); | 859 | usbatm->flags |= (use_isoc ? UDSL_USE_ISOC : 0); |
857 | 860 | ||
858 | INIT_WORK(&instance->status_checker, (void *)speedtch_check_status, instance); | 861 | INIT_DELAYED_WORK(&instance->status_checker, speedtch_check_status); |
859 | 862 | ||
860 | instance->status_checker.timer.function = speedtch_status_poll; | 863 | instance->status_checker.timer.function = speedtch_status_poll; |
861 | instance->status_checker.timer.data = (unsigned long)instance; | 864 | instance->status_checker.timer.data = (unsigned long)instance; |
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c index f6b9f7e1f716..e39bb09f5af9 100644 --- a/drivers/usb/atm/ueagle-atm.c +++ b/drivers/usb/atm/ueagle-atm.c | |||
@@ -658,9 +658,9 @@ static int request_dsp(struct uea_softc *sc) | |||
658 | /* | 658 | /* |
659 | * The uea_load_page() function must be called within a process context | 659 | * The uea_load_page() function must be called within a process context |
660 | */ | 660 | */ |
661 | static void uea_load_page(void *xsc) | 661 | static void uea_load_page(struct work_struct *work) |
662 | { | 662 | { |
663 | struct uea_softc *sc = xsc; | 663 | struct uea_softc *sc = container_of(work, struct uea_softc, task); |
664 | u16 pageno = sc->pageno; | 664 | u16 pageno = sc->pageno; |
665 | u16 ovl = sc->ovl; | 665 | u16 ovl = sc->ovl; |
666 | struct block_info bi; | 666 | struct block_info bi; |
@@ -1352,7 +1352,7 @@ static int uea_boot(struct uea_softc *sc) | |||
1352 | 1352 | ||
1353 | uea_enters(INS_TO_USBDEV(sc)); | 1353 | uea_enters(INS_TO_USBDEV(sc)); |
1354 | 1354 | ||
1355 | INIT_WORK(&sc->task, uea_load_page, sc); | 1355 | INIT_WORK(&sc->task, uea_load_page); |
1356 | init_waitqueue_head(&sc->sync_q); | 1356 | init_waitqueue_head(&sc->sync_q); |
1357 | init_waitqueue_head(&sc->cmv_ack_wait); | 1357 | init_waitqueue_head(&sc->cmv_ack_wait); |
1358 | 1358 | ||
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 9a9012fd284b..6408e10fdbf8 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -421,9 +421,9 @@ static void acm_write_bulk(struct urb *urb) | |||
421 | schedule_work(&acm->work); | 421 | schedule_work(&acm->work); |
422 | } | 422 | } |
423 | 423 | ||
424 | static void acm_softint(void *private) | 424 | static void acm_softint(struct work_struct *work) |
425 | { | 425 | { |
426 | struct acm *acm = private; | 426 | struct acm *acm = container_of(work, struct acm, work); |
427 | dbg("Entering acm_softint."); | 427 | dbg("Entering acm_softint."); |
428 | 428 | ||
429 | if (!ACM_READY(acm)) | 429 | if (!ACM_READY(acm)) |
@@ -927,7 +927,7 @@ skip_normal_probe: | |||
927 | acm->rx_buflimit = num_rx_buf; | 927 | acm->rx_buflimit = num_rx_buf; |
928 | acm->urb_task.func = acm_rx_tasklet; | 928 | acm->urb_task.func = acm_rx_tasklet; |
929 | acm->urb_task.data = (unsigned long) acm; | 929 | acm->urb_task.data = (unsigned long) acm; |
930 | INIT_WORK(&acm->work, acm_softint, acm); | 930 | INIT_WORK(&acm->work, acm_softint); |
931 | spin_lock_init(&acm->throttle_lock); | 931 | spin_lock_init(&acm->throttle_lock); |
932 | spin_lock_init(&acm->write_lock); | 932 | spin_lock_init(&acm->write_lock); |
933 | spin_lock_init(&acm->read_lock); | 933 | spin_lock_init(&acm->read_lock); |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index ba165aff9ea4..ad0ffbe8f7d7 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -167,9 +167,10 @@ static void set_port_led( | |||
167 | 167 | ||
168 | #define LED_CYCLE_PERIOD ((2*HZ)/3) | 168 | #define LED_CYCLE_PERIOD ((2*HZ)/3) |
169 | 169 | ||
170 | static void led_work (void *__hub) | 170 | static void led_work (struct work_struct *work) |
171 | { | 171 | { |
172 | struct usb_hub *hub = __hub; | 172 | struct usb_hub *hub = |
173 | container_of(work, struct usb_hub, leds.work); | ||
173 | struct usb_device *hdev = hub->hdev; | 174 | struct usb_device *hdev = hub->hdev; |
174 | unsigned i; | 175 | unsigned i; |
175 | unsigned changed = 0; | 176 | unsigned changed = 0; |
@@ -351,9 +352,10 @@ hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt) | |||
351 | * talking to TTs must queue control transfers (not just bulk and iso), so | 352 | * talking to TTs must queue control transfers (not just bulk and iso), so |
352 | * both can talk to the same hub concurrently. | 353 | * both can talk to the same hub concurrently. |
353 | */ | 354 | */ |
354 | static void hub_tt_kevent (void *arg) | 355 | static void hub_tt_kevent (struct work_struct *work) |
355 | { | 356 | { |
356 | struct usb_hub *hub = arg; | 357 | struct usb_hub *hub = |
358 | container_of(work, struct usb_hub, tt.kevent); | ||
357 | unsigned long flags; | 359 | unsigned long flags; |
358 | 360 | ||
359 | spin_lock_irqsave (&hub->tt.lock, flags); | 361 | spin_lock_irqsave (&hub->tt.lock, flags); |
@@ -641,7 +643,7 @@ static int hub_configure(struct usb_hub *hub, | |||
641 | 643 | ||
642 | spin_lock_init (&hub->tt.lock); | 644 | spin_lock_init (&hub->tt.lock); |
643 | INIT_LIST_HEAD (&hub->tt.clear_list); | 645 | INIT_LIST_HEAD (&hub->tt.clear_list); |
644 | INIT_WORK (&hub->tt.kevent, hub_tt_kevent, hub); | 646 | INIT_WORK (&hub->tt.kevent, hub_tt_kevent); |
645 | switch (hdev->descriptor.bDeviceProtocol) { | 647 | switch (hdev->descriptor.bDeviceProtocol) { |
646 | case 0: | 648 | case 0: |
647 | break; | 649 | break; |
@@ -880,7 +882,7 @@ descriptor_error: | |||
880 | INIT_LIST_HEAD(&hub->event_list); | 882 | INIT_LIST_HEAD(&hub->event_list); |
881 | hub->intfdev = &intf->dev; | 883 | hub->intfdev = &intf->dev; |
882 | hub->hdev = hdev; | 884 | hub->hdev = hdev; |
883 | INIT_WORK(&hub->leds, led_work, hub); | 885 | INIT_DELAYED_WORK(&hub->leds, led_work); |
884 | 886 | ||
885 | usb_set_intfdata (intf, hub); | 887 | usb_set_intfdata (intf, hub); |
886 | 888 | ||
@@ -2281,7 +2283,7 @@ check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1) | |||
2281 | /* hub LEDs are probably harder to miss than syslog */ | 2283 | /* hub LEDs are probably harder to miss than syslog */ |
2282 | if (hub->has_indicators) { | 2284 | if (hub->has_indicators) { |
2283 | hub->indicator[port1-1] = INDICATOR_GREEN_BLINK; | 2285 | hub->indicator[port1-1] = INDICATOR_GREEN_BLINK; |
2284 | schedule_work (&hub->leds); | 2286 | schedule_delayed_work (&hub->leds, 0); |
2285 | } | 2287 | } |
2286 | } | 2288 | } |
2287 | kfree(qual); | 2289 | kfree(qual); |
@@ -2455,7 +2457,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, | |||
2455 | if (hub->has_indicators) { | 2457 | if (hub->has_indicators) { |
2456 | hub->indicator[port1-1] = | 2458 | hub->indicator[port1-1] = |
2457 | INDICATOR_AMBER_BLINK; | 2459 | INDICATOR_AMBER_BLINK; |
2458 | schedule_work (&hub->leds); | 2460 | schedule_delayed_work (&hub->leds, 0); |
2459 | } | 2461 | } |
2460 | status = -ENOTCONN; /* Don't retry */ | 2462 | status = -ENOTCONN; /* Don't retry */ |
2461 | goto loop_disable; | 2463 | goto loop_disable; |
diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h index 0f8e82a4d480..035d3ef35888 100644 --- a/drivers/usb/core/hub.h +++ b/drivers/usb/core/hub.h | |||
@@ -230,7 +230,7 @@ struct usb_hub { | |||
230 | 230 | ||
231 | unsigned has_indicators:1; | 231 | unsigned has_indicators:1; |
232 | enum hub_led_mode indicator[USB_MAXCHILDREN]; | 232 | enum hub_led_mode indicator[USB_MAXCHILDREN]; |
233 | struct work_struct leds; | 233 | struct delayed_work leds; |
234 | }; | 234 | }; |
235 | 235 | ||
236 | #endif /* __LINUX_HUB_H */ | 236 | #endif /* __LINUX_HUB_H */ |
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 7729c0744886..89572bc021b1 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -1501,9 +1501,10 @@ struct set_config_request { | |||
1501 | }; | 1501 | }; |
1502 | 1502 | ||
1503 | /* Worker routine for usb_driver_set_configuration() */ | 1503 | /* Worker routine for usb_driver_set_configuration() */ |
1504 | static void driver_set_config_work(void *_req) | 1504 | static void driver_set_config_work(struct work_struct *work) |
1505 | { | 1505 | { |
1506 | struct set_config_request *req = _req; | 1506 | struct set_config_request *req = |
1507 | container_of(work, struct set_config_request, work); | ||
1507 | 1508 | ||
1508 | usb_lock_device(req->udev); | 1509 | usb_lock_device(req->udev); |
1509 | usb_set_configuration(req->udev, req->config); | 1510 | usb_set_configuration(req->udev, req->config); |
@@ -1541,7 +1542,7 @@ int usb_driver_set_configuration(struct usb_device *udev, int config) | |||
1541 | return -ENOMEM; | 1542 | return -ENOMEM; |
1542 | req->udev = udev; | 1543 | req->udev = udev; |
1543 | req->config = config; | 1544 | req->config = config; |
1544 | INIT_WORK(&req->work, driver_set_config_work, req); | 1545 | INIT_WORK(&req->work, driver_set_config_work); |
1545 | 1546 | ||
1546 | usb_get_dev(udev); | 1547 | usb_get_dev(udev); |
1547 | if (!schedule_work(&req->work)) { | 1548 | if (!schedule_work(&req->work)) { |
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 467cb02832f3..ab2f68fc7d2d 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
@@ -210,9 +210,10 @@ static void ksuspend_usb_cleanup(void) | |||
210 | #ifdef CONFIG_USB_SUSPEND | 210 | #ifdef CONFIG_USB_SUSPEND |
211 | 211 | ||
212 | /* usb_autosuspend_work - callback routine to autosuspend a USB device */ | 212 | /* usb_autosuspend_work - callback routine to autosuspend a USB device */ |
213 | static void usb_autosuspend_work(void *_udev) | 213 | static void usb_autosuspend_work(struct work_struct *work) |
214 | { | 214 | { |
215 | struct usb_device *udev = _udev; | 215 | struct usb_device *udev = |
216 | container_of(work, struct usb_device, autosuspend.work); | ||
216 | 217 | ||
217 | usb_pm_lock(udev); | 218 | usb_pm_lock(udev); |
218 | udev->auto_pm = 1; | 219 | udev->auto_pm = 1; |
@@ -222,7 +223,7 @@ static void usb_autosuspend_work(void *_udev) | |||
222 | 223 | ||
223 | #else | 224 | #else |
224 | 225 | ||
225 | static void usb_autosuspend_work(void *_udev) | 226 | static void usb_autosuspend_work(struct work_struct *work) |
226 | {} | 227 | {} |
227 | 228 | ||
228 | #endif | 229 | #endif |
@@ -304,7 +305,7 @@ usb_alloc_dev(struct usb_device *parent, struct usb_bus *bus, unsigned port1) | |||
304 | 305 | ||
305 | #ifdef CONFIG_PM | 306 | #ifdef CONFIG_PM |
306 | mutex_init(&dev->pm_mutex); | 307 | mutex_init(&dev->pm_mutex); |
307 | INIT_WORK(&dev->autosuspend, usb_autosuspend_work, dev); | 308 | INIT_DELAYED_WORK(&dev->autosuspend, usb_autosuspend_work); |
308 | #endif | 309 | #endif |
309 | return dev; | 310 | return dev; |
310 | } | 311 | } |
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index 1c17d26d03b8..107119c54301 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c | |||
@@ -1833,9 +1833,9 @@ static void rx_fill (struct eth_dev *dev, gfp_t gfp_flags) | |||
1833 | spin_unlock_irqrestore(&dev->req_lock, flags); | 1833 | spin_unlock_irqrestore(&dev->req_lock, flags); |
1834 | } | 1834 | } |
1835 | 1835 | ||
1836 | static void eth_work (void *_dev) | 1836 | static void eth_work (struct work_struct *work) |
1837 | { | 1837 | { |
1838 | struct eth_dev *dev = _dev; | 1838 | struct eth_dev *dev = container_of(work, struct eth_dev, work); |
1839 | 1839 | ||
1840 | if (test_and_clear_bit (WORK_RX_MEMORY, &dev->todo)) { | 1840 | if (test_and_clear_bit (WORK_RX_MEMORY, &dev->todo)) { |
1841 | if (netif_running (dev->net)) | 1841 | if (netif_running (dev->net)) |
@@ -2398,7 +2398,7 @@ autoconf_fail: | |||
2398 | dev = netdev_priv(net); | 2398 | dev = netdev_priv(net); |
2399 | spin_lock_init (&dev->lock); | 2399 | spin_lock_init (&dev->lock); |
2400 | spin_lock_init (&dev->req_lock); | 2400 | spin_lock_init (&dev->req_lock); |
2401 | INIT_WORK (&dev->work, eth_work, dev); | 2401 | INIT_WORK (&dev->work, eth_work); |
2402 | INIT_LIST_HEAD (&dev->tx_reqs); | 2402 | INIT_LIST_HEAD (&dev->tx_reqs); |
2403 | INIT_LIST_HEAD (&dev->rx_reqs); | 2403 | INIT_LIST_HEAD (&dev->rx_reqs); |
2404 | 2404 | ||
diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c index 32c635ecbf31..4f95a249c913 100644 --- a/drivers/usb/host/u132-hcd.c +++ b/drivers/usb/host/u132-hcd.c | |||
@@ -163,7 +163,7 @@ struct u132_endp { | |||
163 | u16 queue_next; | 163 | u16 queue_next; |
164 | struct urb *urb_list[ENDP_QUEUE_SIZE]; | 164 | struct urb *urb_list[ENDP_QUEUE_SIZE]; |
165 | struct list_head urb_more; | 165 | struct list_head urb_more; |
166 | struct work_struct scheduler; | 166 | struct delayed_work scheduler; |
167 | }; | 167 | }; |
168 | struct u132_ring { | 168 | struct u132_ring { |
169 | unsigned in_use:1; | 169 | unsigned in_use:1; |
@@ -171,7 +171,7 @@ struct u132_ring { | |||
171 | u8 number; | 171 | u8 number; |
172 | struct u132 *u132; | 172 | struct u132 *u132; |
173 | struct u132_endp *curr_endp; | 173 | struct u132_endp *curr_endp; |
174 | struct work_struct scheduler; | 174 | struct delayed_work scheduler; |
175 | }; | 175 | }; |
176 | #define OHCI_QUIRK_AMD756 0x01 | 176 | #define OHCI_QUIRK_AMD756 0x01 |
177 | #define OHCI_QUIRK_SUPERIO 0x02 | 177 | #define OHCI_QUIRK_SUPERIO 0x02 |
@@ -198,7 +198,7 @@ struct u132 { | |||
198 | u32 hc_roothub_portstatus[MAX_ROOT_PORTS]; | 198 | u32 hc_roothub_portstatus[MAX_ROOT_PORTS]; |
199 | int flags; | 199 | int flags; |
200 | unsigned long next_statechange; | 200 | unsigned long next_statechange; |
201 | struct work_struct monitor; | 201 | struct delayed_work monitor; |
202 | int num_endpoints; | 202 | int num_endpoints; |
203 | struct u132_addr addr[MAX_U132_ADDRS]; | 203 | struct u132_addr addr[MAX_U132_ADDRS]; |
204 | struct u132_udev udev[MAX_U132_UDEVS]; | 204 | struct u132_udev udev[MAX_U132_UDEVS]; |
@@ -314,7 +314,7 @@ static void u132_ring_requeue_work(struct u132 *u132, struct u132_ring *ring, | |||
314 | if (delta > 0) { | 314 | if (delta > 0) { |
315 | if (queue_delayed_work(workqueue, &ring->scheduler, delta)) | 315 | if (queue_delayed_work(workqueue, &ring->scheduler, delta)) |
316 | return; | 316 | return; |
317 | } else if (queue_work(workqueue, &ring->scheduler)) | 317 | } else if (queue_delayed_work(workqueue, &ring->scheduler, 0)) |
318 | return; | 318 | return; |
319 | kref_put(&u132->kref, u132_hcd_delete); | 319 | kref_put(&u132->kref, u132_hcd_delete); |
320 | return; | 320 | return; |
@@ -393,12 +393,8 @@ static inline void u132_endp_init_kref(struct u132 *u132, | |||
393 | static void u132_endp_queue_work(struct u132 *u132, struct u132_endp *endp, | 393 | static void u132_endp_queue_work(struct u132 *u132, struct u132_endp *endp, |
394 | unsigned int delta) | 394 | unsigned int delta) |
395 | { | 395 | { |
396 | if (delta > 0) { | 396 | if (queue_delayed_work(workqueue, &endp->scheduler, delta)) |
397 | if (queue_delayed_work(workqueue, &endp->scheduler, delta)) | 397 | kref_get(&endp->kref); |
398 | kref_get(&endp->kref); | ||
399 | } else if (queue_work(workqueue, &endp->scheduler)) | ||
400 | kref_get(&endp->kref); | ||
401 | return; | ||
402 | } | 398 | } |
403 | 399 | ||
404 | static void u132_endp_cancel_work(struct u132 *u132, struct u132_endp *endp) | 400 | static void u132_endp_cancel_work(struct u132 *u132, struct u132_endp *endp) |
@@ -414,24 +410,14 @@ static inline void u132_monitor_put_kref(struct u132 *u132) | |||
414 | 410 | ||
415 | static void u132_monitor_queue_work(struct u132 *u132, unsigned int delta) | 411 | static void u132_monitor_queue_work(struct u132 *u132, unsigned int delta) |
416 | { | 412 | { |
417 | if (delta > 0) { | 413 | if (queue_delayed_work(workqueue, &u132->monitor, delta)) |
418 | if (queue_delayed_work(workqueue, &u132->monitor, delta)) { | 414 | kref_get(&u132->kref); |
419 | kref_get(&u132->kref); | ||
420 | } | ||
421 | } else if (queue_work(workqueue, &u132->monitor)) | ||
422 | kref_get(&u132->kref); | ||
423 | return; | ||
424 | } | 415 | } |
425 | 416 | ||
426 | static void u132_monitor_requeue_work(struct u132 *u132, unsigned int delta) | 417 | static void u132_monitor_requeue_work(struct u132 *u132, unsigned int delta) |
427 | { | 418 | { |
428 | if (delta > 0) { | 419 | if (!queue_delayed_work(workqueue, &u132->monitor, delta)) |
429 | if (queue_delayed_work(workqueue, &u132->monitor, delta)) | 420 | kref_put(&u132->kref, u132_hcd_delete); |
430 | return; | ||
431 | } else if (queue_work(workqueue, &u132->monitor)) | ||
432 | return; | ||
433 | kref_put(&u132->kref, u132_hcd_delete); | ||
434 | return; | ||
435 | } | 421 | } |
436 | 422 | ||
437 | static void u132_monitor_cancel_work(struct u132 *u132) | 423 | static void u132_monitor_cancel_work(struct u132 *u132) |
@@ -493,9 +479,9 @@ static int read_roothub_info(struct u132 *u132) | |||
493 | return 0; | 479 | return 0; |
494 | } | 480 | } |
495 | 481 | ||
496 | static void u132_hcd_monitor_work(void *data) | 482 | static void u132_hcd_monitor_work(struct work_struct *work) |
497 | { | 483 | { |
498 | struct u132 *u132 = data; | 484 | struct u132 *u132 = container_of(work, struct u132, monitor.work); |
499 | if (u132->going > 1) { | 485 | if (u132->going > 1) { |
500 | dev_err(&u132->platform_dev->dev, "device has been removed %d\n" | 486 | dev_err(&u132->platform_dev->dev, "device has been removed %d\n" |
501 | , u132->going); | 487 | , u132->going); |
@@ -1319,15 +1305,14 @@ static void u132_hcd_initial_setup_sent(void *data, struct urb *urb, u8 *buf, | |||
1319 | } | 1305 | } |
1320 | } | 1306 | } |
1321 | 1307 | ||
1322 | static void u132_hcd_ring_work_scheduler(void *data); | ||
1323 | static void u132_hcd_endp_work_scheduler(void *data); | ||
1324 | /* | 1308 | /* |
1325 | * this work function is only executed from the work queue | 1309 | * this work function is only executed from the work queue |
1326 | * | 1310 | * |
1327 | */ | 1311 | */ |
1328 | static void u132_hcd_ring_work_scheduler(void *data) | 1312 | static void u132_hcd_ring_work_scheduler(struct work_struct *work) |
1329 | { | 1313 | { |
1330 | struct u132_ring *ring = data; | 1314 | struct u132_ring *ring = |
1315 | container_of(work, struct u132_ring, scheduler.work); | ||
1331 | struct u132 *u132 = ring->u132; | 1316 | struct u132 *u132 = ring->u132; |
1332 | down(&u132->scheduler_lock); | 1317 | down(&u132->scheduler_lock); |
1333 | if (ring->in_use) { | 1318 | if (ring->in_use) { |
@@ -1386,10 +1371,11 @@ static void u132_hcd_ring_work_scheduler(void *data) | |||
1386 | } | 1371 | } |
1387 | } | 1372 | } |
1388 | 1373 | ||
1389 | static void u132_hcd_endp_work_scheduler(void *data) | 1374 | static void u132_hcd_endp_work_scheduler(struct work_struct *work) |
1390 | { | 1375 | { |
1391 | struct u132_ring *ring; | 1376 | struct u132_ring *ring; |
1392 | struct u132_endp *endp = data; | 1377 | struct u132_endp *endp = |
1378 | container_of(work, struct u132_endp, scheduler.work); | ||
1393 | struct u132 *u132 = endp->u132; | 1379 | struct u132 *u132 = endp->u132; |
1394 | down(&u132->scheduler_lock); | 1380 | down(&u132->scheduler_lock); |
1395 | ring = endp->ring; | 1381 | ring = endp->ring; |
@@ -1947,7 +1933,7 @@ static int create_endpoint_and_queue_int(struct u132 *u132, | |||
1947 | if (!endp) { | 1933 | if (!endp) { |
1948 | return -ENOMEM; | 1934 | return -ENOMEM; |
1949 | } | 1935 | } |
1950 | INIT_WORK(&endp->scheduler, u132_hcd_endp_work_scheduler, (void *)endp); | 1936 | INIT_DELAYED_WORK(&endp->scheduler, u132_hcd_endp_work_scheduler); |
1951 | spin_lock_init(&endp->queue_lock.slock); | 1937 | spin_lock_init(&endp->queue_lock.slock); |
1952 | INIT_LIST_HEAD(&endp->urb_more); | 1938 | INIT_LIST_HEAD(&endp->urb_more); |
1953 | ring = endp->ring = &u132->ring[0]; | 1939 | ring = endp->ring = &u132->ring[0]; |
@@ -2036,7 +2022,7 @@ static int create_endpoint_and_queue_bulk(struct u132 *u132, | |||
2036 | if (!endp) { | 2022 | if (!endp) { |
2037 | return -ENOMEM; | 2023 | return -ENOMEM; |
2038 | } | 2024 | } |
2039 | INIT_WORK(&endp->scheduler, u132_hcd_endp_work_scheduler, (void *)endp); | 2025 | INIT_DELAYED_WORK(&endp->scheduler, u132_hcd_endp_work_scheduler); |
2040 | spin_lock_init(&endp->queue_lock.slock); | 2026 | spin_lock_init(&endp->queue_lock.slock); |
2041 | INIT_LIST_HEAD(&endp->urb_more); | 2027 | INIT_LIST_HEAD(&endp->urb_more); |
2042 | endp->dequeueing = 0; | 2028 | endp->dequeueing = 0; |
@@ -2121,7 +2107,7 @@ static int create_endpoint_and_queue_control(struct u132 *u132, | |||
2121 | if (!endp) { | 2107 | if (!endp) { |
2122 | return -ENOMEM; | 2108 | return -ENOMEM; |
2123 | } | 2109 | } |
2124 | INIT_WORK(&endp->scheduler, u132_hcd_endp_work_scheduler, (void *)endp); | 2110 | INIT_DELAYED_WORK(&endp->scheduler, u132_hcd_endp_work_scheduler); |
2125 | spin_lock_init(&endp->queue_lock.slock); | 2111 | spin_lock_init(&endp->queue_lock.slock); |
2126 | INIT_LIST_HEAD(&endp->urb_more); | 2112 | INIT_LIST_HEAD(&endp->urb_more); |
2127 | ring = endp->ring = &u132->ring[0]; | 2113 | ring = endp->ring = &u132->ring[0]; |
@@ -3100,10 +3086,10 @@ static void u132_initialise(struct u132 *u132, struct platform_device *pdev) | |||
3100 | ring->number = rings + 1; | 3086 | ring->number = rings + 1; |
3101 | ring->length = 0; | 3087 | ring->length = 0; |
3102 | ring->curr_endp = NULL; | 3088 | ring->curr_endp = NULL; |
3103 | INIT_WORK(&ring->scheduler, u132_hcd_ring_work_scheduler, | 3089 | INIT_DELAYED_WORK(&ring->scheduler, |
3104 | (void *)ring); | 3090 | u132_hcd_ring_work_scheduler); |
3105 | } down(&u132->sw_lock); | 3091 | } down(&u132->sw_lock); |
3106 | INIT_WORK(&u132->monitor, u132_hcd_monitor_work, (void *)u132); | 3092 | INIT_DELAYED_WORK(&u132->monitor, u132_hcd_monitor_work); |
3107 | while (ports-- > 0) { | 3093 | while (ports-- > 0) { |
3108 | struct u132_port *port = &u132->port[ports]; | 3094 | struct u132_port *port = &u132->port[ports]; |
3109 | port->u132 = u132; | 3095 | port->u132 = u132; |
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index 6d08a3bcc952..ebc9e823a46e 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c | |||
@@ -969,9 +969,10 @@ static void hid_retry_timeout(unsigned long _hid) | |||
969 | } | 969 | } |
970 | 970 | ||
971 | /* Workqueue routine to reset the device */ | 971 | /* Workqueue routine to reset the device */ |
972 | static void hid_reset(void *_hid) | 972 | static void hid_reset(struct work_struct *work) |
973 | { | 973 | { |
974 | struct hid_device *hid = (struct hid_device *) _hid; | 974 | struct hid_device *hid = |
975 | container_of(work, struct hid_device, reset_work); | ||
975 | int rc_lock, rc; | 976 | int rc_lock, rc; |
976 | 977 | ||
977 | dev_dbg(&hid->intf->dev, "resetting device\n"); | 978 | dev_dbg(&hid->intf->dev, "resetting device\n"); |
@@ -2015,7 +2016,7 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
2015 | 2016 | ||
2016 | init_waitqueue_head(&hid->wait); | 2017 | init_waitqueue_head(&hid->wait); |
2017 | 2018 | ||
2018 | INIT_WORK(&hid->reset_work, hid_reset, hid); | 2019 | INIT_WORK(&hid->reset_work, hid_reset); |
2019 | setup_timer(&hid->io_retry, hid_retry_timeout, (unsigned long) hid); | 2020 | setup_timer(&hid->io_retry, hid_retry_timeout, (unsigned long) hid); |
2020 | 2021 | ||
2021 | spin_lock_init(&hid->inlock); | 2022 | spin_lock_init(&hid->inlock); |
diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c index 9b591b8b9369..e4e2cf2ba915 100644 --- a/drivers/usb/misc/ftdi-elan.c +++ b/drivers/usb/misc/ftdi-elan.c | |||
@@ -156,9 +156,9 @@ struct usb_ftdi { | |||
156 | struct usb_device *udev; | 156 | struct usb_device *udev; |
157 | struct usb_interface *interface; | 157 | struct usb_interface *interface; |
158 | struct usb_class_driver *class; | 158 | struct usb_class_driver *class; |
159 | struct work_struct status_work; | 159 | struct delayed_work status_work; |
160 | struct work_struct command_work; | 160 | struct delayed_work command_work; |
161 | struct work_struct respond_work; | 161 | struct delayed_work respond_work; |
162 | struct u132_platform_data platform_data; | 162 | struct u132_platform_data platform_data; |
163 | struct resource resources[0]; | 163 | struct resource resources[0]; |
164 | struct platform_device platform_dev; | 164 | struct platform_device platform_dev; |
@@ -210,23 +210,14 @@ static void ftdi_elan_init_kref(struct usb_ftdi *ftdi) | |||
210 | 210 | ||
211 | static void ftdi_status_requeue_work(struct usb_ftdi *ftdi, unsigned int delta) | 211 | static void ftdi_status_requeue_work(struct usb_ftdi *ftdi, unsigned int delta) |
212 | { | 212 | { |
213 | if (delta > 0) { | 213 | if (!queue_delayed_work(status_queue, &ftdi->status_work, delta)) |
214 | if (queue_delayed_work(status_queue, &ftdi->status_work, delta)) | 214 | kref_put(&ftdi->kref, ftdi_elan_delete); |
215 | return; | ||
216 | } else if (queue_work(status_queue, &ftdi->status_work)) | ||
217 | return; | ||
218 | kref_put(&ftdi->kref, ftdi_elan_delete); | ||
219 | return; | ||
220 | } | 215 | } |
221 | 216 | ||
222 | static void ftdi_status_queue_work(struct usb_ftdi *ftdi, unsigned int delta) | 217 | static void ftdi_status_queue_work(struct usb_ftdi *ftdi, unsigned int delta) |
223 | { | 218 | { |
224 | if (delta > 0) { | 219 | if (queue_delayed_work(status_queue, &ftdi->status_work, delta)) |
225 | if (queue_delayed_work(status_queue, &ftdi->status_work, delta)) | 220 | kref_get(&ftdi->kref); |
226 | kref_get(&ftdi->kref); | ||
227 | } else if (queue_work(status_queue, &ftdi->status_work)) | ||
228 | kref_get(&ftdi->kref); | ||
229 | return; | ||
230 | } | 221 | } |
231 | 222 | ||
232 | static void ftdi_status_cancel_work(struct usb_ftdi *ftdi) | 223 | static void ftdi_status_cancel_work(struct usb_ftdi *ftdi) |
@@ -237,25 +228,14 @@ static void ftdi_status_cancel_work(struct usb_ftdi *ftdi) | |||
237 | 228 | ||
238 | static void ftdi_command_requeue_work(struct usb_ftdi *ftdi, unsigned int delta) | 229 | static void ftdi_command_requeue_work(struct usb_ftdi *ftdi, unsigned int delta) |
239 | { | 230 | { |
240 | if (delta > 0) { | 231 | if (!queue_delayed_work(command_queue, &ftdi->command_work, delta)) |
241 | if (queue_delayed_work(command_queue, &ftdi->command_work, | 232 | kref_put(&ftdi->kref, ftdi_elan_delete); |
242 | delta)) | ||
243 | return; | ||
244 | } else if (queue_work(command_queue, &ftdi->command_work)) | ||
245 | return; | ||
246 | kref_put(&ftdi->kref, ftdi_elan_delete); | ||
247 | return; | ||
248 | } | 233 | } |
249 | 234 | ||
250 | static void ftdi_command_queue_work(struct usb_ftdi *ftdi, unsigned int delta) | 235 | static void ftdi_command_queue_work(struct usb_ftdi *ftdi, unsigned int delta) |
251 | { | 236 | { |
252 | if (delta > 0) { | 237 | if (queue_delayed_work(command_queue, &ftdi->command_work, delta)) |
253 | if (queue_delayed_work(command_queue, &ftdi->command_work, | 238 | kref_get(&ftdi->kref); |
254 | delta)) | ||
255 | kref_get(&ftdi->kref); | ||
256 | } else if (queue_work(command_queue, &ftdi->command_work)) | ||
257 | kref_get(&ftdi->kref); | ||
258 | return; | ||
259 | } | 239 | } |
260 | 240 | ||
261 | static void ftdi_command_cancel_work(struct usb_ftdi *ftdi) | 241 | static void ftdi_command_cancel_work(struct usb_ftdi *ftdi) |
@@ -267,25 +247,14 @@ static void ftdi_command_cancel_work(struct usb_ftdi *ftdi) | |||
267 | static void ftdi_response_requeue_work(struct usb_ftdi *ftdi, | 247 | static void ftdi_response_requeue_work(struct usb_ftdi *ftdi, |
268 | unsigned int delta) | 248 | unsigned int delta) |
269 | { | 249 | { |
270 | if (delta > 0) { | 250 | if (!queue_delayed_work(respond_queue, &ftdi->respond_work, delta)) |
271 | if (queue_delayed_work(respond_queue, &ftdi->respond_work, | 251 | kref_put(&ftdi->kref, ftdi_elan_delete); |
272 | delta)) | ||
273 | return; | ||
274 | } else if (queue_work(respond_queue, &ftdi->respond_work)) | ||
275 | return; | ||
276 | kref_put(&ftdi->kref, ftdi_elan_delete); | ||
277 | return; | ||
278 | } | 252 | } |
279 | 253 | ||
280 | static void ftdi_respond_queue_work(struct usb_ftdi *ftdi, unsigned int delta) | 254 | static void ftdi_respond_queue_work(struct usb_ftdi *ftdi, unsigned int delta) |
281 | { | 255 | { |
282 | if (delta > 0) { | 256 | if (queue_delayed_work(respond_queue, &ftdi->respond_work, delta)) |
283 | if (queue_delayed_work(respond_queue, &ftdi->respond_work, | 257 | kref_get(&ftdi->kref); |
284 | delta)) | ||
285 | kref_get(&ftdi->kref); | ||
286 | } else if (queue_work(respond_queue, &ftdi->respond_work)) | ||
287 | kref_get(&ftdi->kref); | ||
288 | return; | ||
289 | } | 258 | } |
290 | 259 | ||
291 | static void ftdi_response_cancel_work(struct usb_ftdi *ftdi) | 260 | static void ftdi_response_cancel_work(struct usb_ftdi *ftdi) |
@@ -475,9 +444,11 @@ static void ftdi_elan_kick_command_queue(struct usb_ftdi *ftdi) | |||
475 | return; | 444 | return; |
476 | } | 445 | } |
477 | 446 | ||
478 | static void ftdi_elan_command_work(void *data) | 447 | static void ftdi_elan_command_work(struct work_struct *work) |
479 | { | 448 | { |
480 | struct usb_ftdi *ftdi = data; | 449 | struct usb_ftdi *ftdi = |
450 | container_of(work, struct usb_ftdi, command_work.work); | ||
451 | |||
481 | if (ftdi->disconnected > 0) { | 452 | if (ftdi->disconnected > 0) { |
482 | ftdi_elan_put_kref(ftdi); | 453 | ftdi_elan_put_kref(ftdi); |
483 | return; | 454 | return; |
@@ -500,9 +471,10 @@ static void ftdi_elan_kick_respond_queue(struct usb_ftdi *ftdi) | |||
500 | return; | 471 | return; |
501 | } | 472 | } |
502 | 473 | ||
503 | static void ftdi_elan_respond_work(void *data) | 474 | static void ftdi_elan_respond_work(struct work_struct *work) |
504 | { | 475 | { |
505 | struct usb_ftdi *ftdi = data; | 476 | struct usb_ftdi *ftdi = |
477 | container_of(work, struct usb_ftdi, respond_work.work); | ||
506 | if (ftdi->disconnected > 0) { | 478 | if (ftdi->disconnected > 0) { |
507 | ftdi_elan_put_kref(ftdi); | 479 | ftdi_elan_put_kref(ftdi); |
508 | return; | 480 | return; |
@@ -534,9 +506,10 @@ static void ftdi_elan_respond_work(void *data) | |||
534 | * after the FTDI has been synchronized | 506 | * after the FTDI has been synchronized |
535 | * | 507 | * |
536 | */ | 508 | */ |
537 | static void ftdi_elan_status_work(void *data) | 509 | static void ftdi_elan_status_work(struct work_struct *work) |
538 | { | 510 | { |
539 | struct usb_ftdi *ftdi = data; | 511 | struct usb_ftdi *ftdi = |
512 | container_of(work, struct usb_ftdi, status_work.work); | ||
540 | int work_delay_in_msec = 0; | 513 | int work_delay_in_msec = 0; |
541 | if (ftdi->disconnected > 0) { | 514 | if (ftdi->disconnected > 0) { |
542 | ftdi_elan_put_kref(ftdi); | 515 | ftdi_elan_put_kref(ftdi); |
@@ -2691,12 +2664,9 @@ static int ftdi_elan_probe(struct usb_interface *interface, | |||
2691 | ftdi->class = NULL; | 2664 | ftdi->class = NULL; |
2692 | dev_info(&ftdi->udev->dev, "USB FDTI=%p ELAN interface %d now a" | 2665 | dev_info(&ftdi->udev->dev, "USB FDTI=%p ELAN interface %d now a" |
2693 | "ctivated\n", ftdi, iface_desc->desc.bInterfaceNumber); | 2666 | "ctivated\n", ftdi, iface_desc->desc.bInterfaceNumber); |
2694 | INIT_WORK(&ftdi->status_work, ftdi_elan_status_work, | 2667 | INIT_DELAYED_WORK(&ftdi->status_work, ftdi_elan_status_work); |
2695 | (void *)ftdi); | 2668 | INIT_DELAYED_WORK(&ftdi->command_work, ftdi_elan_command_work); |
2696 | INIT_WORK(&ftdi->command_work, ftdi_elan_command_work, | 2669 | INIT_DELAYED_WORK(&ftdi->respond_work, ftdi_elan_respond_work); |
2697 | (void *)ftdi); | ||
2698 | INIT_WORK(&ftdi->respond_work, ftdi_elan_respond_work, | ||
2699 | (void *)ftdi); | ||
2700 | ftdi_status_queue_work(ftdi, msecs_to_jiffies(3 *1000)); | 2670 | ftdi_status_queue_work(ftdi, msecs_to_jiffies(3 *1000)); |
2701 | return 0; | 2671 | return 0; |
2702 | } else { | 2672 | } else { |
diff --git a/drivers/usb/misc/phidgetkit.c b/drivers/usb/misc/phidgetkit.c index abb4dcd811ac..33e716c6a79b 100644 --- a/drivers/usb/misc/phidgetkit.c +++ b/drivers/usb/misc/phidgetkit.c | |||
@@ -81,8 +81,8 @@ struct interfacekit { | |||
81 | unsigned char *data; | 81 | unsigned char *data; |
82 | dma_addr_t data_dma; | 82 | dma_addr_t data_dma; |
83 | 83 | ||
84 | struct work_struct do_notify; | 84 | struct delayed_work do_notify; |
85 | struct work_struct do_resubmit; | 85 | struct delayed_work do_resubmit; |
86 | unsigned long input_events; | 86 | unsigned long input_events; |
87 | unsigned long sensor_events; | 87 | unsigned long sensor_events; |
88 | }; | 88 | }; |
@@ -374,7 +374,7 @@ static void interfacekit_irq(struct urb *urb) | |||
374 | } | 374 | } |
375 | 375 | ||
376 | if (kit->input_events || kit->sensor_events) | 376 | if (kit->input_events || kit->sensor_events) |
377 | schedule_work(&kit->do_notify); | 377 | schedule_delayed_work(&kit->do_notify, 0); |
378 | 378 | ||
379 | resubmit: | 379 | resubmit: |
380 | status = usb_submit_urb(urb, SLAB_ATOMIC); | 380 | status = usb_submit_urb(urb, SLAB_ATOMIC); |
@@ -384,9 +384,10 @@ resubmit: | |||
384 | kit->udev->devpath, status); | 384 | kit->udev->devpath, status); |
385 | } | 385 | } |
386 | 386 | ||
387 | static void do_notify(void *data) | 387 | static void do_notify(struct work_struct *work) |
388 | { | 388 | { |
389 | struct interfacekit *kit = data; | 389 | struct interfacekit *kit = |
390 | container_of(work, struct interfacekit, do_notify.work); | ||
390 | int i; | 391 | int i; |
391 | char sysfs_file[8]; | 392 | char sysfs_file[8]; |
392 | 393 | ||
@@ -405,9 +406,11 @@ static void do_notify(void *data) | |||
405 | } | 406 | } |
406 | } | 407 | } |
407 | 408 | ||
408 | static void do_resubmit(void *data) | 409 | static void do_resubmit(struct work_struct *work) |
409 | { | 410 | { |
410 | set_outputs(data); | 411 | struct interfacekit *kit = |
412 | container_of(work, struct interfacekit, do_resubmit.work); | ||
413 | set_outputs(kit); | ||
411 | } | 414 | } |
412 | 415 | ||
413 | #define show_set_output(value) \ | 416 | #define show_set_output(value) \ |
@@ -575,8 +578,8 @@ static int interfacekit_probe(struct usb_interface *intf, const struct usb_devic | |||
575 | 578 | ||
576 | kit->udev = usb_get_dev(dev); | 579 | kit->udev = usb_get_dev(dev); |
577 | kit->intf = intf; | 580 | kit->intf = intf; |
578 | INIT_WORK(&kit->do_notify, do_notify, kit); | 581 | INIT_DELAYED_WORK(&kit->do_notify, do_notify); |
579 | INIT_WORK(&kit->do_resubmit, do_resubmit, kit); | 582 | INIT_DELAYED_WORK(&kit->do_resubmit, do_resubmit); |
580 | usb_fill_int_urb(kit->irq, kit->udev, pipe, kit->data, | 583 | usb_fill_int_urb(kit->irq, kit->udev, pipe, kit->data, |
581 | maxp > URB_INT_SIZE ? URB_INT_SIZE : maxp, | 584 | maxp > URB_INT_SIZE ? URB_INT_SIZE : maxp, |
582 | interfacekit_irq, kit, endpoint->bInterval); | 585 | interfacekit_irq, kit, endpoint->bInterval); |
diff --git a/drivers/usb/misc/phidgetmotorcontrol.c b/drivers/usb/misc/phidgetmotorcontrol.c index 5c780cab92e0..0385ffcc7419 100644 --- a/drivers/usb/misc/phidgetmotorcontrol.c +++ b/drivers/usb/misc/phidgetmotorcontrol.c | |||
@@ -41,7 +41,7 @@ struct motorcontrol { | |||
41 | unsigned char *data; | 41 | unsigned char *data; |
42 | dma_addr_t data_dma; | 42 | dma_addr_t data_dma; |
43 | 43 | ||
44 | struct work_struct do_notify; | 44 | struct delayed_work do_notify; |
45 | unsigned long input_events; | 45 | unsigned long input_events; |
46 | unsigned long speed_events; | 46 | unsigned long speed_events; |
47 | unsigned long exceed_events; | 47 | unsigned long exceed_events; |
@@ -148,7 +148,7 @@ static void motorcontrol_irq(struct urb *urb) | |||
148 | set_bit(1, &mc->exceed_events); | 148 | set_bit(1, &mc->exceed_events); |
149 | 149 | ||
150 | if (mc->input_events || mc->exceed_events || mc->speed_events) | 150 | if (mc->input_events || mc->exceed_events || mc->speed_events) |
151 | schedule_work(&mc->do_notify); | 151 | schedule_delayed_work(&mc->do_notify, 0); |
152 | 152 | ||
153 | resubmit: | 153 | resubmit: |
154 | status = usb_submit_urb(urb, SLAB_ATOMIC); | 154 | status = usb_submit_urb(urb, SLAB_ATOMIC); |
@@ -159,9 +159,10 @@ resubmit: | |||
159 | mc->udev->devpath, status); | 159 | mc->udev->devpath, status); |
160 | } | 160 | } |
161 | 161 | ||
162 | static void do_notify(void *data) | 162 | static void do_notify(struct work_struct *work) |
163 | { | 163 | { |
164 | struct motorcontrol *mc = data; | 164 | struct motorcontrol *mc = |
165 | container_of(work, struct motorcontrol, do_notify.work); | ||
165 | int i; | 166 | int i; |
166 | char sysfs_file[8]; | 167 | char sysfs_file[8]; |
167 | 168 | ||
@@ -348,7 +349,7 @@ static int motorcontrol_probe(struct usb_interface *intf, const struct usb_devic | |||
348 | mc->udev = usb_get_dev(dev); | 349 | mc->udev = usb_get_dev(dev); |
349 | mc->intf = intf; | 350 | mc->intf = intf; |
350 | mc->acceleration[0] = mc->acceleration[1] = 10; | 351 | mc->acceleration[0] = mc->acceleration[1] = 10; |
351 | INIT_WORK(&mc->do_notify, do_notify, mc); | 352 | INIT_DELAYED_WORK(&mc->do_notify, do_notify); |
352 | usb_fill_int_urb(mc->irq, mc->udev, pipe, mc->data, | 353 | usb_fill_int_urb(mc->irq, mc->udev, pipe, mc->data, |
353 | maxp > URB_INT_SIZE ? URB_INT_SIZE : maxp, | 354 | maxp > URB_INT_SIZE ? URB_INT_SIZE : maxp, |
354 | motorcontrol_irq, mc, endpoint->bInterval); | 355 | motorcontrol_irq, mc, endpoint->bInterval); |
diff --git a/drivers/usb/net/kaweth.c b/drivers/usb/net/kaweth.c index 7c906a43e497..fa78326d0bf0 100644 --- a/drivers/usb/net/kaweth.c +++ b/drivers/usb/net/kaweth.c | |||
@@ -222,7 +222,7 @@ struct kaweth_device | |||
222 | int suspend_lowmem_ctrl; | 222 | int suspend_lowmem_ctrl; |
223 | int linkstate; | 223 | int linkstate; |
224 | int opened; | 224 | int opened; |
225 | struct work_struct lowmem_work; | 225 | struct delayed_work lowmem_work; |
226 | 226 | ||
227 | struct usb_device *dev; | 227 | struct usb_device *dev; |
228 | struct net_device *net; | 228 | struct net_device *net; |
@@ -530,9 +530,10 @@ resubmit: | |||
530 | kaweth_resubmit_int_urb(kaweth, GFP_ATOMIC); | 530 | kaweth_resubmit_int_urb(kaweth, GFP_ATOMIC); |
531 | } | 531 | } |
532 | 532 | ||
533 | static void kaweth_resubmit_tl(void *d) | 533 | static void kaweth_resubmit_tl(struct work_struct *work) |
534 | { | 534 | { |
535 | struct kaweth_device *kaweth = (struct kaweth_device *)d; | 535 | struct kaweth_device *kaweth = |
536 | container_of(work, struct kaweth_device, lowmem_work.work); | ||
536 | 537 | ||
537 | if (IS_BLOCKED(kaweth->status)) | 538 | if (IS_BLOCKED(kaweth->status)) |
538 | return; | 539 | return; |
@@ -1126,7 +1127,7 @@ err_fw: | |||
1126 | 1127 | ||
1127 | /* kaweth is zeroed as part of alloc_netdev */ | 1128 | /* kaweth is zeroed as part of alloc_netdev */ |
1128 | 1129 | ||
1129 | INIT_WORK(&kaweth->lowmem_work, kaweth_resubmit_tl, (void *)kaweth); | 1130 | INIT_DELAYED_WORK(&kaweth->lowmem_work, kaweth_resubmit_tl); |
1130 | 1131 | ||
1131 | SET_MODULE_OWNER(netdev); | 1132 | SET_MODULE_OWNER(netdev); |
1132 | 1133 | ||
diff --git a/drivers/usb/net/pegasus.c b/drivers/usb/net/pegasus.c index 33abbd2176b6..78cf6f091285 100644 --- a/drivers/usb/net/pegasus.c +++ b/drivers/usb/net/pegasus.c | |||
@@ -1280,9 +1280,9 @@ static inline void setup_pegasus_II(pegasus_t * pegasus) | |||
1280 | static struct workqueue_struct *pegasus_workqueue = NULL; | 1280 | static struct workqueue_struct *pegasus_workqueue = NULL; |
1281 | #define CARRIER_CHECK_DELAY (2 * HZ) | 1281 | #define CARRIER_CHECK_DELAY (2 * HZ) |
1282 | 1282 | ||
1283 | static void check_carrier(void *data) | 1283 | static void check_carrier(struct work_struct *work) |
1284 | { | 1284 | { |
1285 | pegasus_t *pegasus = data; | 1285 | pegasus_t *pegasus = container_of(work, pegasus_t, carrier_check.work); |
1286 | set_carrier(pegasus->net); | 1286 | set_carrier(pegasus->net); |
1287 | if (!(pegasus->flags & PEGASUS_UNPLUG)) { | 1287 | if (!(pegasus->flags & PEGASUS_UNPLUG)) { |
1288 | queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check, | 1288 | queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check, |
@@ -1318,7 +1318,7 @@ static int pegasus_probe(struct usb_interface *intf, | |||
1318 | 1318 | ||
1319 | tasklet_init(&pegasus->rx_tl, rx_fixup, (unsigned long) pegasus); | 1319 | tasklet_init(&pegasus->rx_tl, rx_fixup, (unsigned long) pegasus); |
1320 | 1320 | ||
1321 | INIT_WORK(&pegasus->carrier_check, check_carrier, pegasus); | 1321 | INIT_DELAYED_WORK(&pegasus->carrier_check, check_carrier); |
1322 | 1322 | ||
1323 | pegasus->intf = intf; | 1323 | pegasus->intf = intf; |
1324 | pegasus->usb = dev; | 1324 | pegasus->usb = dev; |
diff --git a/drivers/usb/net/pegasus.h b/drivers/usb/net/pegasus.h index 006438069b66..98f6898cae1f 100644 --- a/drivers/usb/net/pegasus.h +++ b/drivers/usb/net/pegasus.h | |||
@@ -95,7 +95,7 @@ typedef struct pegasus { | |||
95 | int dev_index; | 95 | int dev_index; |
96 | int intr_interval; | 96 | int intr_interval; |
97 | struct tasklet_struct rx_tl; | 97 | struct tasklet_struct rx_tl; |
98 | struct work_struct carrier_check; | 98 | struct delayed_work carrier_check; |
99 | struct urb *ctrl_urb, *rx_urb, *tx_urb, *intr_urb; | 99 | struct urb *ctrl_urb, *rx_urb, *tx_urb, *intr_urb; |
100 | struct sk_buff *rx_pool[RX_SKBS]; | 100 | struct sk_buff *rx_pool[RX_SKBS]; |
101 | struct sk_buff *rx_skb; | 101 | struct sk_buff *rx_skb; |
diff --git a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c index 760b5327b81b..79b5474fe234 100644 --- a/drivers/usb/net/usbnet.c +++ b/drivers/usb/net/usbnet.c | |||
@@ -782,9 +782,10 @@ static struct ethtool_ops usbnet_ethtool_ops = { | |||
782 | * especially now that control transfers can be queued. | 782 | * especially now that control transfers can be queued. |
783 | */ | 783 | */ |
784 | static void | 784 | static void |
785 | kevent (void *data) | 785 | kevent (struct work_struct *work) |
786 | { | 786 | { |
787 | struct usbnet *dev = data; | 787 | struct usbnet *dev = |
788 | container_of(work, struct usbnet, kevent); | ||
788 | int status; | 789 | int status; |
789 | 790 | ||
790 | /* usb_clear_halt() needs a thread context */ | 791 | /* usb_clear_halt() needs a thread context */ |
@@ -1146,7 +1147,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) | |||
1146 | skb_queue_head_init (&dev->done); | 1147 | skb_queue_head_init (&dev->done); |
1147 | dev->bh.func = usbnet_bh; | 1148 | dev->bh.func = usbnet_bh; |
1148 | dev->bh.data = (unsigned long) dev; | 1149 | dev->bh.data = (unsigned long) dev; |
1149 | INIT_WORK (&dev->kevent, kevent, dev); | 1150 | INIT_WORK (&dev->kevent, kevent); |
1150 | dev->delay.function = usbnet_bh; | 1151 | dev->delay.function = usbnet_bh; |
1151 | dev->delay.data = (unsigned long) dev; | 1152 | dev->delay.data = (unsigned long) dev; |
1152 | init_timer (&dev->delay); | 1153 | init_timer (&dev->delay); |
diff --git a/drivers/usb/serial/aircable.c b/drivers/usb/serial/aircable.c index 812275509137..2a4ac9bd6a3a 100644 --- a/drivers/usb/serial/aircable.c +++ b/drivers/usb/serial/aircable.c | |||
@@ -92,6 +92,7 @@ struct aircable_private { | |||
92 | struct circ_buf *rx_buf; /* read buffer */ | 92 | struct circ_buf *rx_buf; /* read buffer */ |
93 | int rx_flags; /* for throttilng */ | 93 | int rx_flags; /* for throttilng */ |
94 | struct work_struct rx_work; /* work cue for the receiving line */ | 94 | struct work_struct rx_work; /* work cue for the receiving line */ |
95 | struct usb_serial_port *port; /* USB port with which associated */ | ||
95 | }; | 96 | }; |
96 | 97 | ||
97 | /* Private methods */ | 98 | /* Private methods */ |
@@ -251,10 +252,11 @@ static void aircable_send(struct usb_serial_port *port) | |||
251 | schedule_work(&port->work); | 252 | schedule_work(&port->work); |
252 | } | 253 | } |
253 | 254 | ||
254 | static void aircable_read(void *params) | 255 | static void aircable_read(struct work_struct *work) |
255 | { | 256 | { |
256 | struct usb_serial_port *port = params; | 257 | struct aircable_private *priv = |
257 | struct aircable_private *priv = usb_get_serial_port_data(port); | 258 | container_of(work, struct aircable_private, rx_work); |
259 | struct usb_serial_port *port = priv->port; | ||
258 | struct tty_struct *tty; | 260 | struct tty_struct *tty; |
259 | unsigned char *data; | 261 | unsigned char *data; |
260 | int count; | 262 | int count; |
@@ -348,7 +350,8 @@ static int aircable_attach (struct usb_serial *serial) | |||
348 | } | 350 | } |
349 | 351 | ||
350 | priv->rx_flags &= ~(THROTTLED | ACTUALLY_THROTTLED); | 352 | priv->rx_flags &= ~(THROTTLED | ACTUALLY_THROTTLED); |
351 | INIT_WORK(&priv->rx_work, aircable_read, port); | 353 | priv->port = port; |
354 | INIT_WORK(&priv->rx_work, aircable_read); | ||
352 | 355 | ||
353 | usb_set_serial_port_data(serial->port[0], priv); | 356 | usb_set_serial_port_data(serial->port[0], priv); |
354 | 357 | ||
@@ -515,7 +518,7 @@ static void aircable_read_bulk_callback(struct urb *urb) | |||
515 | package_length - shift); | 518 | package_length - shift); |
516 | } | 519 | } |
517 | } | 520 | } |
518 | aircable_read(port); | 521 | aircable_read(&priv->rx_work); |
519 | } | 522 | } |
520 | 523 | ||
521 | /* Schedule the next read _if_ we are still open */ | 524 | /* Schedule the next read _if_ we are still open */ |
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c index bdb58100fc1d..fd159b040bfb 100644 --- a/drivers/usb/serial/digi_acceleport.c +++ b/drivers/usb/serial/digi_acceleport.c | |||
@@ -430,13 +430,14 @@ struct digi_port { | |||
430 | int dp_in_close; /* close in progress */ | 430 | int dp_in_close; /* close in progress */ |
431 | wait_queue_head_t dp_close_wait; /* wait queue for close */ | 431 | wait_queue_head_t dp_close_wait; /* wait queue for close */ |
432 | struct work_struct dp_wakeup_work; | 432 | struct work_struct dp_wakeup_work; |
433 | struct usb_serial_port *dp_port; | ||
433 | }; | 434 | }; |
434 | 435 | ||
435 | 436 | ||
436 | /* Local Function Declarations */ | 437 | /* Local Function Declarations */ |
437 | 438 | ||
438 | static void digi_wakeup_write( struct usb_serial_port *port ); | 439 | static void digi_wakeup_write( struct usb_serial_port *port ); |
439 | static void digi_wakeup_write_lock(void *); | 440 | static void digi_wakeup_write_lock(struct work_struct *work); |
440 | static int digi_write_oob_command( struct usb_serial_port *port, | 441 | static int digi_write_oob_command( struct usb_serial_port *port, |
441 | unsigned char *buf, int count, int interruptible ); | 442 | unsigned char *buf, int count, int interruptible ); |
442 | static int digi_write_inb_command( struct usb_serial_port *port, | 443 | static int digi_write_inb_command( struct usb_serial_port *port, |
@@ -598,11 +599,12 @@ static inline long cond_wait_interruptible_timeout_irqrestore( | |||
598 | * on writes. | 599 | * on writes. |
599 | */ | 600 | */ |
600 | 601 | ||
601 | static void digi_wakeup_write_lock(void *arg) | 602 | static void digi_wakeup_write_lock(struct work_struct *work) |
602 | { | 603 | { |
603 | struct usb_serial_port *port = arg; | 604 | struct digi_port *priv = |
605 | container_of(work, struct digi_port, dp_wakeup_work); | ||
606 | struct usb_serial_port *port = priv->dp_port; | ||
604 | unsigned long flags; | 607 | unsigned long flags; |
605 | struct digi_port *priv = usb_get_serial_port_data(port); | ||
606 | 608 | ||
607 | 609 | ||
608 | spin_lock_irqsave( &priv->dp_port_lock, flags ); | 610 | spin_lock_irqsave( &priv->dp_port_lock, flags ); |
@@ -1702,8 +1704,8 @@ dbg( "digi_startup: TOP" ); | |||
1702 | init_waitqueue_head( &priv->dp_flush_wait ); | 1704 | init_waitqueue_head( &priv->dp_flush_wait ); |
1703 | priv->dp_in_close = 0; | 1705 | priv->dp_in_close = 0; |
1704 | init_waitqueue_head( &priv->dp_close_wait ); | 1706 | init_waitqueue_head( &priv->dp_close_wait ); |
1705 | INIT_WORK(&priv->dp_wakeup_work, | 1707 | INIT_WORK(&priv->dp_wakeup_work, digi_wakeup_write_lock); |
1706 | digi_wakeup_write_lock, serial->port[i]); | 1708 | priv->dp_port = serial->port[i]; |
1707 | 1709 | ||
1708 | /* initialize write wait queue for this port */ | 1710 | /* initialize write wait queue for this port */ |
1709 | init_waitqueue_head( &serial->port[i]->write_wait ); | 1711 | init_waitqueue_head( &serial->port[i]->write_wait ); |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index c186b4e73c72..88ed5c1d236c 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -559,7 +559,8 @@ struct ftdi_private { | |||
559 | char prev_status, diff_status; /* Used for TIOCMIWAIT */ | 559 | char prev_status, diff_status; /* Used for TIOCMIWAIT */ |
560 | __u8 rx_flags; /* receive state flags (throttling) */ | 560 | __u8 rx_flags; /* receive state flags (throttling) */ |
561 | spinlock_t rx_lock; /* spinlock for receive state */ | 561 | spinlock_t rx_lock; /* spinlock for receive state */ |
562 | struct work_struct rx_work; | 562 | struct delayed_work rx_work; |
563 | struct usb_serial_port *port; | ||
563 | int rx_processed; | 564 | int rx_processed; |
564 | unsigned long rx_bytes; | 565 | unsigned long rx_bytes; |
565 | 566 | ||
@@ -593,7 +594,7 @@ static int ftdi_write_room (struct usb_serial_port *port); | |||
593 | static int ftdi_chars_in_buffer (struct usb_serial_port *port); | 594 | static int ftdi_chars_in_buffer (struct usb_serial_port *port); |
594 | static void ftdi_write_bulk_callback (struct urb *urb); | 595 | static void ftdi_write_bulk_callback (struct urb *urb); |
595 | static void ftdi_read_bulk_callback (struct urb *urb); | 596 | static void ftdi_read_bulk_callback (struct urb *urb); |
596 | static void ftdi_process_read (void *param); | 597 | static void ftdi_process_read (struct work_struct *work); |
597 | static void ftdi_set_termios (struct usb_serial_port *port, struct termios * old); | 598 | static void ftdi_set_termios (struct usb_serial_port *port, struct termios * old); |
598 | static int ftdi_tiocmget (struct usb_serial_port *port, struct file *file); | 599 | static int ftdi_tiocmget (struct usb_serial_port *port, struct file *file); |
599 | static int ftdi_tiocmset (struct usb_serial_port *port, struct file * file, unsigned int set, unsigned int clear); | 600 | static int ftdi_tiocmset (struct usb_serial_port *port, struct file * file, unsigned int set, unsigned int clear); |
@@ -1201,7 +1202,8 @@ static int ftdi_sio_attach (struct usb_serial *serial) | |||
1201 | port->read_urb->transfer_buffer_length = BUFSZ; | 1202 | port->read_urb->transfer_buffer_length = BUFSZ; |
1202 | } | 1203 | } |
1203 | 1204 | ||
1204 | INIT_WORK(&priv->rx_work, ftdi_process_read, port); | 1205 | INIT_DELAYED_WORK(&priv->rx_work, ftdi_process_read); |
1206 | priv->port = port; | ||
1205 | 1207 | ||
1206 | /* Free port's existing write urb and transfer buffer. */ | 1208 | /* Free port's existing write urb and transfer buffer. */ |
1207 | if (port->write_urb) { | 1209 | if (port->write_urb) { |
@@ -1641,17 +1643,18 @@ static void ftdi_read_bulk_callback (struct urb *urb) | |||
1641 | priv->rx_bytes += countread; | 1643 | priv->rx_bytes += countread; |
1642 | spin_unlock_irqrestore(&priv->rx_lock, flags); | 1644 | spin_unlock_irqrestore(&priv->rx_lock, flags); |
1643 | 1645 | ||
1644 | ftdi_process_read(port); | 1646 | ftdi_process_read(&priv->rx_work.work); |
1645 | 1647 | ||
1646 | } /* ftdi_read_bulk_callback */ | 1648 | } /* ftdi_read_bulk_callback */ |
1647 | 1649 | ||
1648 | 1650 | ||
1649 | static void ftdi_process_read (void *param) | 1651 | static void ftdi_process_read (struct work_struct *work) |
1650 | { /* ftdi_process_read */ | 1652 | { /* ftdi_process_read */ |
1651 | struct usb_serial_port *port = (struct usb_serial_port*)param; | 1653 | struct ftdi_private *priv = |
1654 | container_of(work, struct ftdi_private, rx_work.work); | ||
1655 | struct usb_serial_port *port = priv->port; | ||
1652 | struct urb *urb; | 1656 | struct urb *urb; |
1653 | struct tty_struct *tty; | 1657 | struct tty_struct *tty; |
1654 | struct ftdi_private *priv; | ||
1655 | char error_flag; | 1658 | char error_flag; |
1656 | unsigned char *data; | 1659 | unsigned char *data; |
1657 | 1660 | ||
@@ -2180,7 +2183,7 @@ static void ftdi_unthrottle (struct usb_serial_port *port) | |||
2180 | spin_unlock_irqrestore(&priv->rx_lock, flags); | 2183 | spin_unlock_irqrestore(&priv->rx_lock, flags); |
2181 | 2184 | ||
2182 | if (actually_throttled) | 2185 | if (actually_throttled) |
2183 | schedule_work(&priv->rx_work); | 2186 | schedule_delayed_work(&priv->rx_work, 0); |
2184 | } | 2187 | } |
2185 | 2188 | ||
2186 | static int __init ftdi_init (void) | 2189 | static int __init ftdi_init (void) |
diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c index 909005107ea2..e09a0bfe6231 100644 --- a/drivers/usb/serial/keyspan_pda.c +++ b/drivers/usb/serial/keyspan_pda.c | |||
@@ -120,6 +120,8 @@ struct keyspan_pda_private { | |||
120 | int tx_throttled; | 120 | int tx_throttled; |
121 | struct work_struct wakeup_work; | 121 | struct work_struct wakeup_work; |
122 | struct work_struct unthrottle_work; | 122 | struct work_struct unthrottle_work; |
123 | struct usb_serial *serial; | ||
124 | struct usb_serial_port *port; | ||
123 | }; | 125 | }; |
124 | 126 | ||
125 | 127 | ||
@@ -175,9 +177,11 @@ static struct usb_device_id id_table_fake_xircom [] = { | |||
175 | }; | 177 | }; |
176 | #endif | 178 | #endif |
177 | 179 | ||
178 | static void keyspan_pda_wakeup_write( struct usb_serial_port *port ) | 180 | static void keyspan_pda_wakeup_write(struct work_struct *work) |
179 | { | 181 | { |
180 | 182 | struct keyspan_pda_private *priv = | |
183 | container_of(work, struct keyspan_pda_private, wakeup_work); | ||
184 | struct usb_serial_port *port = priv->port; | ||
181 | struct tty_struct *tty = port->tty; | 185 | struct tty_struct *tty = port->tty; |
182 | 186 | ||
183 | /* wake up port processes */ | 187 | /* wake up port processes */ |
@@ -187,8 +191,11 @@ static void keyspan_pda_wakeup_write( struct usb_serial_port *port ) | |||
187 | tty_wakeup(tty); | 191 | tty_wakeup(tty); |
188 | } | 192 | } |
189 | 193 | ||
190 | static void keyspan_pda_request_unthrottle( struct usb_serial *serial ) | 194 | static void keyspan_pda_request_unthrottle(struct work_struct *work) |
191 | { | 195 | { |
196 | struct keyspan_pda_private *priv = | ||
197 | container_of(work, struct keyspan_pda_private, unthrottle_work); | ||
198 | struct usb_serial *serial = priv->serial; | ||
192 | int result; | 199 | int result; |
193 | 200 | ||
194 | dbg(" request_unthrottle"); | 201 | dbg(" request_unthrottle"); |
@@ -765,11 +772,10 @@ static int keyspan_pda_startup (struct usb_serial *serial) | |||
765 | return (1); /* error */ | 772 | return (1); /* error */ |
766 | usb_set_serial_port_data(serial->port[0], priv); | 773 | usb_set_serial_port_data(serial->port[0], priv); |
767 | init_waitqueue_head(&serial->port[0]->write_wait); | 774 | init_waitqueue_head(&serial->port[0]->write_wait); |
768 | INIT_WORK(&priv->wakeup_work, (void *)keyspan_pda_wakeup_write, | 775 | INIT_WORK(&priv->wakeup_work, keyspan_pda_wakeup_write); |
769 | (void *)(serial->port[0])); | 776 | INIT_WORK(&priv->unthrottle_work, keyspan_pda_request_unthrottle); |
770 | INIT_WORK(&priv->unthrottle_work, | 777 | priv->serial = serial; |
771 | (void *)keyspan_pda_request_unthrottle, | 778 | priv->port = serial->port[0]; |
772 | (void *)(serial)); | ||
773 | return (0); | 779 | return (0); |
774 | } | 780 | } |
775 | 781 | ||
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 8006e51c34bb..2cfba8488a93 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -533,9 +533,10 @@ void usb_serial_port_softint(struct usb_serial_port *port) | |||
533 | schedule_work(&port->work); | 533 | schedule_work(&port->work); |
534 | } | 534 | } |
535 | 535 | ||
536 | static void usb_serial_port_work(void *private) | 536 | static void usb_serial_port_work(struct work_struct *work) |
537 | { | 537 | { |
538 | struct usb_serial_port *port = private; | 538 | struct usb_serial_port *port = |
539 | container_of(work, struct usb_serial_port, work); | ||
539 | struct tty_struct *tty; | 540 | struct tty_struct *tty; |
540 | 541 | ||
541 | dbg("%s - port %d", __FUNCTION__, port->number); | 542 | dbg("%s - port %d", __FUNCTION__, port->number); |
@@ -799,7 +800,7 @@ int usb_serial_probe(struct usb_interface *interface, | |||
799 | port->serial = serial; | 800 | port->serial = serial; |
800 | spin_lock_init(&port->lock); | 801 | spin_lock_init(&port->lock); |
801 | mutex_init(&port->mutex); | 802 | mutex_init(&port->mutex); |
802 | INIT_WORK(&port->work, usb_serial_port_work, port); | 803 | INIT_WORK(&port->work, usb_serial_port_work); |
803 | serial->port[i] = port; | 804 | serial->port[i] = port; |
804 | } | 805 | } |
805 | 806 | ||
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c index 4d1cd7aeccd3..154c7d290597 100644 --- a/drivers/usb/serial/whiteheat.c +++ b/drivers/usb/serial/whiteheat.c | |||
@@ -227,6 +227,7 @@ struct whiteheat_private { | |||
227 | struct list_head rx_urbs_submitted; | 227 | struct list_head rx_urbs_submitted; |
228 | struct list_head rx_urb_q; | 228 | struct list_head rx_urb_q; |
229 | struct work_struct rx_work; | 229 | struct work_struct rx_work; |
230 | struct usb_serial_port *port; | ||
230 | struct list_head tx_urbs_free; | 231 | struct list_head tx_urbs_free; |
231 | struct list_head tx_urbs_submitted; | 232 | struct list_head tx_urbs_submitted; |
232 | }; | 233 | }; |
@@ -241,7 +242,7 @@ static void command_port_read_callback(struct urb *urb); | |||
241 | static int start_port_read(struct usb_serial_port *port); | 242 | static int start_port_read(struct usb_serial_port *port); |
242 | static struct whiteheat_urb_wrap *urb_to_wrap(struct urb *urb, struct list_head *head); | 243 | static struct whiteheat_urb_wrap *urb_to_wrap(struct urb *urb, struct list_head *head); |
243 | static struct list_head *list_first(struct list_head *head); | 244 | static struct list_head *list_first(struct list_head *head); |
244 | static void rx_data_softint(void *private); | 245 | static void rx_data_softint(struct work_struct *work); |
245 | 246 | ||
246 | static int firm_send_command(struct usb_serial_port *port, __u8 command, __u8 *data, __u8 datasize); | 247 | static int firm_send_command(struct usb_serial_port *port, __u8 command, __u8 *data, __u8 datasize); |
247 | static int firm_open(struct usb_serial_port *port); | 248 | static int firm_open(struct usb_serial_port *port); |
@@ -424,7 +425,8 @@ static int whiteheat_attach (struct usb_serial *serial) | |||
424 | spin_lock_init(&info->lock); | 425 | spin_lock_init(&info->lock); |
425 | info->flags = 0; | 426 | info->flags = 0; |
426 | info->mcr = 0; | 427 | info->mcr = 0; |
427 | INIT_WORK(&info->rx_work, rx_data_softint, port); | 428 | INIT_WORK(&info->rx_work, rx_data_softint); |
429 | info->port = port; | ||
428 | 430 | ||
429 | INIT_LIST_HEAD(&info->rx_urbs_free); | 431 | INIT_LIST_HEAD(&info->rx_urbs_free); |
430 | INIT_LIST_HEAD(&info->rx_urbs_submitted); | 432 | INIT_LIST_HEAD(&info->rx_urbs_submitted); |
@@ -949,7 +951,7 @@ static void whiteheat_unthrottle (struct usb_serial_port *port) | |||
949 | spin_unlock_irqrestore(&info->lock, flags); | 951 | spin_unlock_irqrestore(&info->lock, flags); |
950 | 952 | ||
951 | if (actually_throttled) | 953 | if (actually_throttled) |
952 | rx_data_softint(port); | 954 | rx_data_softint(&info->rx_work); |
953 | 955 | ||
954 | return; | 956 | return; |
955 | } | 957 | } |
@@ -1400,10 +1402,11 @@ static struct list_head *list_first(struct list_head *head) | |||
1400 | } | 1402 | } |
1401 | 1403 | ||
1402 | 1404 | ||
1403 | static void rx_data_softint(void *private) | 1405 | static void rx_data_softint(struct work_struct *work) |
1404 | { | 1406 | { |
1405 | struct usb_serial_port *port = (struct usb_serial_port *)private; | 1407 | struct whiteheat_private *info = |
1406 | struct whiteheat_private *info = usb_get_serial_port_data(port); | 1408 | container_of(work, struct whiteheat_private, rx_work); |
1409 | struct usb_serial_port *port = info->port; | ||
1407 | struct tty_struct *tty = port->tty; | 1410 | struct tty_struct *tty = port->tty; |
1408 | struct whiteheat_urb_wrap *wrap; | 1411 | struct whiteheat_urb_wrap *wrap; |
1409 | struct urb *urb; | 1412 | struct urb *urb; |