diff options
author | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-06 11:01:37 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-06 11:01:37 -0500 |
commit | dd8856bda5f1308beb113281b248683992998a9e (patch) | |
tree | 5dc35290cdbca32cbdecd93a76fa5b29075ac18c /drivers | |
parent | f81cff0d4067e41fd7383d9c013cc82da7c169d2 (diff) | |
parent | 06328b4f7919e9d2169d45cadc5a37b828a78eda (diff) |
Merge git://git.infradead.org/users/dhowells/workq-2.6
* git://git.infradead.org/users/dhowells/workq-2.6:
Actually update the fixed up compile failures.
WorkQueue: Fix up arch-specific work items where possible
WorkStruct: make allyesconfig
WorkStruct: Pass the work_struct pointer instead of context data
WorkStruct: Merge the pending bit into the wq_data pointer
WorkStruct: Typedef the work function prototype
WorkStruct: Separate delayable and non-delayable events.
Diffstat (limited to 'drivers')
243 files changed, 1613 insertions, 1338 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 068fe4f100b0..02b30ae6a68e 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -50,6 +50,7 @@ ACPI_MODULE_NAME("osl") | |||
50 | struct acpi_os_dpc { | 50 | struct acpi_os_dpc { |
51 | acpi_osd_exec_callback function; | 51 | acpi_osd_exec_callback function; |
52 | void *context; | 52 | void *context; |
53 | struct work_struct work; | ||
53 | }; | 54 | }; |
54 | 55 | ||
55 | #ifdef CONFIG_ACPI_CUSTOM_DSDT | 56 | #ifdef CONFIG_ACPI_CUSTOM_DSDT |
@@ -564,12 +565,9 @@ void acpi_os_derive_pci_id(acpi_handle rhandle, /* upper bound */ | |||
564 | acpi_os_derive_pci_id_2(rhandle, chandle, id, &is_bridge, &bus_number); | 565 | acpi_os_derive_pci_id_2(rhandle, chandle, id, &is_bridge, &bus_number); |
565 | } | 566 | } |
566 | 567 | ||
567 | static void acpi_os_execute_deferred(void *context) | 568 | static void acpi_os_execute_deferred(struct work_struct *work) |
568 | { | 569 | { |
569 | struct acpi_os_dpc *dpc = NULL; | 570 | struct acpi_os_dpc *dpc = container_of(work, struct acpi_os_dpc, work); |
570 | |||
571 | |||
572 | dpc = (struct acpi_os_dpc *)context; | ||
573 | if (!dpc) { | 571 | if (!dpc) { |
574 | printk(KERN_ERR PREFIX "Invalid (NULL) context\n"); | 572 | printk(KERN_ERR PREFIX "Invalid (NULL) context\n"); |
575 | return; | 573 | return; |
@@ -602,7 +600,6 @@ acpi_status acpi_os_execute(acpi_execute_type type, | |||
602 | { | 600 | { |
603 | acpi_status status = AE_OK; | 601 | acpi_status status = AE_OK; |
604 | struct acpi_os_dpc *dpc; | 602 | struct acpi_os_dpc *dpc; |
605 | struct work_struct *task; | ||
606 | 603 | ||
607 | ACPI_FUNCTION_TRACE("os_queue_for_execution"); | 604 | ACPI_FUNCTION_TRACE("os_queue_for_execution"); |
608 | 605 | ||
@@ -615,28 +612,22 @@ acpi_status acpi_os_execute(acpi_execute_type type, | |||
615 | 612 | ||
616 | /* | 613 | /* |
617 | * Allocate/initialize DPC structure. Note that this memory will be | 614 | * Allocate/initialize DPC structure. Note that this memory will be |
618 | * freed by the callee. The kernel handles the tq_struct list in a | 615 | * freed by the callee. The kernel handles the work_struct list in a |
619 | * way that allows us to also free its memory inside the callee. | 616 | * way that allows us to also free its memory inside the callee. |
620 | * Because we may want to schedule several tasks with different | 617 | * Because we may want to schedule several tasks with different |
621 | * parameters we can't use the approach some kernel code uses of | 618 | * parameters we can't use the approach some kernel code uses of |
622 | * having a static tq_struct. | 619 | * having a static work_struct. |
623 | * We can save time and code by allocating the DPC and tq_structs | ||
624 | * from the same memory. | ||
625 | */ | 620 | */ |
626 | 621 | ||
627 | dpc = | 622 | dpc = kmalloc(sizeof(struct acpi_os_dpc), GFP_ATOMIC); |
628 | kmalloc(sizeof(struct acpi_os_dpc) + sizeof(struct work_struct), | ||
629 | GFP_ATOMIC); | ||
630 | if (!dpc) | 623 | if (!dpc) |
631 | return_ACPI_STATUS(AE_NO_MEMORY); | 624 | return_ACPI_STATUS(AE_NO_MEMORY); |
632 | 625 | ||
633 | dpc->function = function; | 626 | dpc->function = function; |
634 | dpc->context = context; | 627 | dpc->context = context; |
635 | 628 | ||
636 | task = (void *)(dpc + 1); | 629 | INIT_WORK(&dpc->work, acpi_os_execute_deferred); |
637 | INIT_WORK(task, acpi_os_execute_deferred, (void *)dpc); | 630 | if (!queue_work(kacpid_wq, &dpc->work)) { |
638 | |||
639 | if (!queue_work(kacpid_wq, task)) { | ||
640 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 631 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, |
641 | "Call to queue_work() failed.\n")); | 632 | "Call to queue_work() failed.\n")); |
642 | kfree(dpc); | 633 | kfree(dpc); |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index f8ec3896b793..8816e30fb7a4 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -1081,7 +1081,7 @@ static unsigned int ata_id_xfermask(const u16 *id) | |||
1081 | * ata_port_queue_task - Queue port_task | 1081 | * ata_port_queue_task - Queue port_task |
1082 | * @ap: The ata_port to queue port_task for | 1082 | * @ap: The ata_port to queue port_task for |
1083 | * @fn: workqueue function to be scheduled | 1083 | * @fn: workqueue function to be scheduled |
1084 | * @data: data value to pass to workqueue function | 1084 | * @data: data for @fn to use |
1085 | * @delay: delay time for workqueue function | 1085 | * @delay: delay time for workqueue function |
1086 | * | 1086 | * |
1087 | * Schedule @fn(@data) for execution after @delay jiffies using | 1087 | * Schedule @fn(@data) for execution after @delay jiffies using |
@@ -1096,7 +1096,7 @@ static unsigned int ata_id_xfermask(const u16 *id) | |||
1096 | * LOCKING: | 1096 | * LOCKING: |
1097 | * Inherited from caller. | 1097 | * Inherited from caller. |
1098 | */ | 1098 | */ |
1099 | void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *), void *data, | 1099 | void ata_port_queue_task(struct ata_port *ap, work_func_t fn, void *data, |
1100 | unsigned long delay) | 1100 | unsigned long delay) |
1101 | { | 1101 | { |
1102 | int rc; | 1102 | int rc; |
@@ -1104,12 +1104,10 @@ void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *), void *data, | |||
1104 | if (ap->pflags & ATA_PFLAG_FLUSH_PORT_TASK) | 1104 | if (ap->pflags & ATA_PFLAG_FLUSH_PORT_TASK) |
1105 | return; | 1105 | return; |
1106 | 1106 | ||
1107 | PREPARE_WORK(&ap->port_task, fn, data); | 1107 | PREPARE_DELAYED_WORK(&ap->port_task, fn); |
1108 | ap->port_task_data = data; | ||
1108 | 1109 | ||
1109 | if (!delay) | 1110 | rc = queue_delayed_work(ata_wq, &ap->port_task, delay); |
1110 | rc = queue_work(ata_wq, &ap->port_task); | ||
1111 | else | ||
1112 | rc = queue_delayed_work(ata_wq, &ap->port_task, delay); | ||
1113 | 1111 | ||
1114 | /* rc == 0 means that another user is using port task */ | 1112 | /* rc == 0 means that another user is using port task */ |
1115 | WARN_ON(rc == 0); | 1113 | WARN_ON(rc == 0); |
@@ -4588,10 +4586,11 @@ fsm_start: | |||
4588 | return poll_next; | 4586 | return poll_next; |
4589 | } | 4587 | } |
4590 | 4588 | ||
4591 | static void ata_pio_task(void *_data) | 4589 | static void ata_pio_task(struct work_struct *work) |
4592 | { | 4590 | { |
4593 | struct ata_queued_cmd *qc = _data; | 4591 | struct ata_port *ap = |
4594 | struct ata_port *ap = qc->ap; | 4592 | container_of(work, struct ata_port, port_task.work); |
4593 | struct ata_queued_cmd *qc = ap->port_task_data; | ||
4595 | u8 status; | 4594 | u8 status; |
4596 | int poll_next; | 4595 | int poll_next; |
4597 | 4596 | ||
@@ -5635,9 +5634,9 @@ void ata_port_init(struct ata_port *ap, struct ata_host *host, | |||
5635 | ap->msg_enable = ATA_MSG_DRV | ATA_MSG_ERR | ATA_MSG_WARN; | 5634 | ap->msg_enable = ATA_MSG_DRV | ATA_MSG_ERR | ATA_MSG_WARN; |
5636 | #endif | 5635 | #endif |
5637 | 5636 | ||
5638 | INIT_WORK(&ap->port_task, NULL, NULL); | 5637 | INIT_DELAYED_WORK(&ap->port_task, NULL); |
5639 | INIT_WORK(&ap->hotplug_task, ata_scsi_hotplug, ap); | 5638 | INIT_DELAYED_WORK(&ap->hotplug_task, ata_scsi_hotplug); |
5640 | INIT_WORK(&ap->scsi_rescan_task, ata_scsi_dev_rescan, ap); | 5639 | INIT_WORK(&ap->scsi_rescan_task, ata_scsi_dev_rescan); |
5641 | INIT_LIST_HEAD(&ap->eh_done_q); | 5640 | INIT_LIST_HEAD(&ap->eh_done_q); |
5642 | init_waitqueue_head(&ap->eh_wait_q); | 5641 | init_waitqueue_head(&ap->eh_wait_q); |
5643 | 5642 | ||
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 76a85dfb7307..08ad44b3e48f 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -332,7 +332,7 @@ void ata_scsi_error(struct Scsi_Host *host) | |||
332 | if (ap->pflags & ATA_PFLAG_LOADING) | 332 | if (ap->pflags & ATA_PFLAG_LOADING) |
333 | ap->pflags &= ~ATA_PFLAG_LOADING; | 333 | ap->pflags &= ~ATA_PFLAG_LOADING; |
334 | else if (ap->pflags & ATA_PFLAG_SCSI_HOTPLUG) | 334 | else if (ap->pflags & ATA_PFLAG_SCSI_HOTPLUG) |
335 | queue_work(ata_aux_wq, &ap->hotplug_task); | 335 | queue_delayed_work(ata_aux_wq, &ap->hotplug_task, 0); |
336 | 336 | ||
337 | if (ap->pflags & ATA_PFLAG_RECOVERED) | 337 | if (ap->pflags & ATA_PFLAG_RECOVERED) |
338 | ata_port_printk(ap, KERN_INFO, "EH complete\n"); | 338 | ata_port_printk(ap, KERN_INFO, "EH complete\n"); |
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 8eaace94d963..664e1377b54c 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -2963,7 +2963,7 @@ static void ata_scsi_remove_dev(struct ata_device *dev) | |||
2963 | 2963 | ||
2964 | /** | 2964 | /** |
2965 | * ata_scsi_hotplug - SCSI part of hotplug | 2965 | * ata_scsi_hotplug - SCSI part of hotplug |
2966 | * @data: Pointer to ATA port to perform SCSI hotplug on | 2966 | * @work: Pointer to ATA port to perform SCSI hotplug on |
2967 | * | 2967 | * |
2968 | * Perform SCSI part of hotplug. It's executed from a separate | 2968 | * Perform SCSI part of hotplug. It's executed from a separate |
2969 | * workqueue after EH completes. This is necessary because SCSI | 2969 | * workqueue after EH completes. This is necessary because SCSI |
@@ -2973,9 +2973,10 @@ static void ata_scsi_remove_dev(struct ata_device *dev) | |||
2973 | * LOCKING: | 2973 | * LOCKING: |
2974 | * Kernel thread context (may sleep). | 2974 | * Kernel thread context (may sleep). |
2975 | */ | 2975 | */ |
2976 | void ata_scsi_hotplug(void *data) | 2976 | void ata_scsi_hotplug(struct work_struct *work) |
2977 | { | 2977 | { |
2978 | struct ata_port *ap = data; | 2978 | struct ata_port *ap = |
2979 | container_of(work, struct ata_port, hotplug_task.work); | ||
2979 | int i; | 2980 | int i; |
2980 | 2981 | ||
2981 | if (ap->pflags & ATA_PFLAG_UNLOADING) { | 2982 | if (ap->pflags & ATA_PFLAG_UNLOADING) { |
@@ -3076,7 +3077,7 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel, | |||
3076 | 3077 | ||
3077 | /** | 3078 | /** |
3078 | * ata_scsi_dev_rescan - initiate scsi_rescan_device() | 3079 | * ata_scsi_dev_rescan - initiate scsi_rescan_device() |
3079 | * @data: Pointer to ATA port to perform scsi_rescan_device() | 3080 | * @work: Pointer to ATA port to perform scsi_rescan_device() |
3080 | * | 3081 | * |
3081 | * After ATA pass thru (SAT) commands are executed successfully, | 3082 | * After ATA pass thru (SAT) commands are executed successfully, |
3082 | * libata need to propagate the changes to SCSI layer. This | 3083 | * libata need to propagate the changes to SCSI layer. This |
@@ -3086,9 +3087,10 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel, | |||
3086 | * LOCKING: | 3087 | * LOCKING: |
3087 | * Kernel thread context (may sleep). | 3088 | * Kernel thread context (may sleep). |
3088 | */ | 3089 | */ |
3089 | void ata_scsi_dev_rescan(void *data) | 3090 | void ata_scsi_dev_rescan(struct work_struct *work) |
3090 | { | 3091 | { |
3091 | struct ata_port *ap = data; | 3092 | struct ata_port *ap = |
3093 | container_of(work, struct ata_port, scsi_rescan_task); | ||
3092 | unsigned long flags; | 3094 | unsigned long flags; |
3093 | unsigned int i; | 3095 | unsigned int i; |
3094 | 3096 | ||
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h index 107b2b565229..81ae41d5f23f 100644 --- a/drivers/ata/libata.h +++ b/drivers/ata/libata.h | |||
@@ -94,7 +94,7 @@ extern struct scsi_transport_template ata_scsi_transport_template; | |||
94 | 94 | ||
95 | extern void ata_scsi_scan_host(struct ata_port *ap); | 95 | extern void ata_scsi_scan_host(struct ata_port *ap); |
96 | extern int ata_scsi_offline_dev(struct ata_device *dev); | 96 | extern int ata_scsi_offline_dev(struct ata_device *dev); |
97 | extern void ata_scsi_hotplug(void *data); | 97 | extern void ata_scsi_hotplug(struct work_struct *work); |
98 | extern unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf, | 98 | extern unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf, |
99 | unsigned int buflen); | 99 | unsigned int buflen); |
100 | 100 | ||
@@ -124,7 +124,7 @@ extern void ata_scsi_rbuf_fill(struct ata_scsi_args *args, | |||
124 | unsigned int (*actor) (struct ata_scsi_args *args, | 124 | unsigned int (*actor) (struct ata_scsi_args *args, |
125 | u8 *rbuf, unsigned int buflen)); | 125 | u8 *rbuf, unsigned int buflen)); |
126 | extern void ata_schedule_scsi_eh(struct Scsi_Host *shost); | 126 | extern void ata_schedule_scsi_eh(struct Scsi_Host *shost); |
127 | extern void ata_scsi_dev_rescan(void *data); | 127 | extern void ata_scsi_dev_rescan(struct work_struct *work); |
128 | extern int ata_bus_probe(struct ata_port *ap); | 128 | extern int ata_bus_probe(struct ata_port *ap); |
129 | 129 | ||
130 | /* libata-eh.c */ | 130 | /* libata-eh.c */ |
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c index 87b17c33b3f9..f40786121948 100644 --- a/drivers/atm/idt77252.c +++ b/drivers/atm/idt77252.c | |||
@@ -135,7 +135,7 @@ static int idt77252_change_qos(struct atm_vcc *vcc, struct atm_qos *qos, | |||
135 | int flags); | 135 | int flags); |
136 | static int idt77252_proc_read(struct atm_dev *dev, loff_t * pos, | 136 | static int idt77252_proc_read(struct atm_dev *dev, loff_t * pos, |
137 | char *page); | 137 | char *page); |
138 | static void idt77252_softint(void *dev_id); | 138 | static void idt77252_softint(struct work_struct *work); |
139 | 139 | ||
140 | 140 | ||
141 | static struct atmdev_ops idt77252_ops = | 141 | static struct atmdev_ops idt77252_ops = |
@@ -2866,9 +2866,10 @@ out: | |||
2866 | } | 2866 | } |
2867 | 2867 | ||
2868 | static void | 2868 | static void |
2869 | idt77252_softint(void *dev_id) | 2869 | idt77252_softint(struct work_struct *work) |
2870 | { | 2870 | { |
2871 | struct idt77252_dev *card = dev_id; | 2871 | struct idt77252_dev *card = |
2872 | container_of(work, struct idt77252_dev, tqueue); | ||
2872 | u32 stat; | 2873 | u32 stat; |
2873 | int done; | 2874 | int done; |
2874 | 2875 | ||
@@ -3697,7 +3698,7 @@ idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id) | |||
3697 | card->pcidev = pcidev; | 3698 | card->pcidev = pcidev; |
3698 | sprintf(card->name, "idt77252-%d", card->index); | 3699 | sprintf(card->name, "idt77252-%d", card->index); |
3699 | 3700 | ||
3700 | INIT_WORK(&card->tqueue, idt77252_softint, (void *)card); | 3701 | INIT_WORK(&card->tqueue, idt77252_softint); |
3701 | 3702 | ||
3702 | membase = pci_resource_start(pcidev, 1); | 3703 | membase = pci_resource_start(pcidev, 1); |
3703 | srambase = pci_resource_start(pcidev, 2); | 3704 | srambase = pci_resource_start(pcidev, 2); |
diff --git a/drivers/block/aoe/aoe.h b/drivers/block/aoe/aoe.h index 6d111228cfac..2308e83e5f33 100644 --- a/drivers/block/aoe/aoe.h +++ b/drivers/block/aoe/aoe.h | |||
@@ -159,7 +159,7 @@ void aoecmd_work(struct aoedev *d); | |||
159 | void aoecmd_cfg(ushort aoemajor, unsigned char aoeminor); | 159 | void aoecmd_cfg(ushort aoemajor, unsigned char aoeminor); |
160 | void aoecmd_ata_rsp(struct sk_buff *); | 160 | void aoecmd_ata_rsp(struct sk_buff *); |
161 | void aoecmd_cfg_rsp(struct sk_buff *); | 161 | void aoecmd_cfg_rsp(struct sk_buff *); |
162 | void aoecmd_sleepwork(void *vp); | 162 | void aoecmd_sleepwork(struct work_struct *); |
163 | struct sk_buff *new_skb(ulong); | 163 | struct sk_buff *new_skb(ulong); |
164 | 164 | ||
165 | int aoedev_init(void); | 165 | int aoedev_init(void); |
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index 8a13b1af8bab..97f7f535f412 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c | |||
@@ -408,9 +408,9 @@ rexmit_timer(ulong vp) | |||
408 | /* this function performs work that has been deferred until sleeping is OK | 408 | /* this function performs work that has been deferred until sleeping is OK |
409 | */ | 409 | */ |
410 | void | 410 | void |
411 | aoecmd_sleepwork(void *vp) | 411 | aoecmd_sleepwork(struct work_struct *work) |
412 | { | 412 | { |
413 | struct aoedev *d = (struct aoedev *) vp; | 413 | struct aoedev *d = container_of(work, struct aoedev, work); |
414 | 414 | ||
415 | if (d->flags & DEVFL_GDALLOC) | 415 | if (d->flags & DEVFL_GDALLOC) |
416 | aoeblk_gdalloc(d); | 416 | aoeblk_gdalloc(d); |
diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c index 6125921bbec4..05a97197c918 100644 --- a/drivers/block/aoe/aoedev.c +++ b/drivers/block/aoe/aoedev.c | |||
@@ -88,7 +88,7 @@ aoedev_newdev(ulong nframes) | |||
88 | kfree(d); | 88 | kfree(d); |
89 | return NULL; | 89 | return NULL; |
90 | } | 90 | } |
91 | INIT_WORK(&d->work, aoecmd_sleepwork, d); | 91 | INIT_WORK(&d->work, aoecmd_sleepwork); |
92 | spin_lock_init(&d->lock); | 92 | spin_lock_init(&d->lock); |
93 | init_timer(&d->timer); | 93 | init_timer(&d->timer); |
94 | d->timer.data = (ulong) d; | 94 | d->timer.data = (ulong) d; |
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 9e6d3a87cbe3..3f1b38276e96 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -992,11 +992,11 @@ static void empty(void) | |||
992 | { | 992 | { |
993 | } | 993 | } |
994 | 994 | ||
995 | static DECLARE_WORK(floppy_work, NULL, NULL); | 995 | static DECLARE_WORK(floppy_work, NULL); |
996 | 996 | ||
997 | static void schedule_bh(void (*handler) (void)) | 997 | static void schedule_bh(void (*handler) (void)) |
998 | { | 998 | { |
999 | PREPARE_WORK(&floppy_work, (void (*)(void *))handler, NULL); | 999 | PREPARE_WORK(&floppy_work, (work_func_t)handler); |
1000 | schedule_work(&floppy_work); | 1000 | schedule_work(&floppy_work); |
1001 | } | 1001 | } |
1002 | 1002 | ||
@@ -1008,7 +1008,7 @@ static void cancel_activity(void) | |||
1008 | 1008 | ||
1009 | spin_lock_irqsave(&floppy_lock, flags); | 1009 | spin_lock_irqsave(&floppy_lock, flags); |
1010 | do_floppy = NULL; | 1010 | do_floppy = NULL; |
1011 | PREPARE_WORK(&floppy_work, (void *)empty, NULL); | 1011 | PREPARE_WORK(&floppy_work, (work_func_t)empty); |
1012 | del_timer(&fd_timer); | 1012 | del_timer(&fd_timer); |
1013 | spin_unlock_irqrestore(&floppy_lock, flags); | 1013 | spin_unlock_irqrestore(&floppy_lock, flags); |
1014 | } | 1014 | } |
@@ -1868,7 +1868,7 @@ static void show_floppy(void) | |||
1868 | printk("fdc_busy=%lu\n", fdc_busy); | 1868 | printk("fdc_busy=%lu\n", fdc_busy); |
1869 | if (do_floppy) | 1869 | if (do_floppy) |
1870 | printk("do_floppy=%p\n", do_floppy); | 1870 | printk("do_floppy=%p\n", do_floppy); |
1871 | if (floppy_work.pending) | 1871 | if (work_pending(&floppy_work)) |
1872 | printk("floppy_work.func=%p\n", floppy_work.func); | 1872 | printk("floppy_work.func=%p\n", floppy_work.func); |
1873 | if (timer_pending(&fd_timer)) | 1873 | if (timer_pending(&fd_timer)) |
1874 | printk("fd_timer.function=%p\n", fd_timer.function); | 1874 | printk("fd_timer.function=%p\n", fd_timer.function); |
@@ -4498,7 +4498,7 @@ static void floppy_release_irq_and_dma(void) | |||
4498 | printk("floppy timer still active:%s\n", timeout_message); | 4498 | printk("floppy timer still active:%s\n", timeout_message); |
4499 | if (timer_pending(&fd_timer)) | 4499 | if (timer_pending(&fd_timer)) |
4500 | printk("auxiliary floppy timer still active\n"); | 4500 | printk("auxiliary floppy timer still active\n"); |
4501 | if (floppy_work.pending) | 4501 | if (work_pending(&floppy_work)) |
4502 | printk("work still pending\n"); | 4502 | printk("work still pending\n"); |
4503 | #endif | 4503 | #endif |
4504 | old_fdc = fdc; | 4504 | old_fdc = fdc; |
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c index 40a11e567970..9d9bff23f426 100644 --- a/drivers/block/paride/pd.c +++ b/drivers/block/paride/pd.c | |||
@@ -352,19 +352,19 @@ static enum action (*phase)(void); | |||
352 | 352 | ||
353 | static void run_fsm(void); | 353 | static void run_fsm(void); |
354 | 354 | ||
355 | static void ps_tq_int( void *data); | 355 | static void ps_tq_int(struct work_struct *work); |
356 | 356 | ||
357 | static DECLARE_WORK(fsm_tq, ps_tq_int, NULL); | 357 | static DECLARE_DELAYED_WORK(fsm_tq, ps_tq_int); |
358 | 358 | ||
359 | static void schedule_fsm(void) | 359 | static void schedule_fsm(void) |
360 | { | 360 | { |
361 | if (!nice) | 361 | if (!nice) |
362 | schedule_work(&fsm_tq); | 362 | schedule_delayed_work(&fsm_tq, 0); |
363 | else | 363 | else |
364 | schedule_delayed_work(&fsm_tq, nice-1); | 364 | schedule_delayed_work(&fsm_tq, nice-1); |
365 | } | 365 | } |
366 | 366 | ||
367 | static void ps_tq_int(void *data) | 367 | static void ps_tq_int(struct work_struct *work) |
368 | { | 368 | { |
369 | run_fsm(); | 369 | run_fsm(); |
370 | } | 370 | } |
diff --git a/drivers/block/paride/pseudo.h b/drivers/block/paride/pseudo.h index 932342d7a8eb..bc3703294143 100644 --- a/drivers/block/paride/pseudo.h +++ b/drivers/block/paride/pseudo.h | |||
@@ -35,7 +35,7 @@ | |||
35 | #include <linux/sched.h> | 35 | #include <linux/sched.h> |
36 | #include <linux/workqueue.h> | 36 | #include <linux/workqueue.h> |
37 | 37 | ||
38 | static void ps_tq_int( void *data); | 38 | static void ps_tq_int(struct work_struct *work); |
39 | 39 | ||
40 | static void (* ps_continuation)(void); | 40 | static void (* ps_continuation)(void); |
41 | static int (* ps_ready)(void); | 41 | static int (* ps_ready)(void); |
@@ -45,7 +45,7 @@ static int ps_nice = 0; | |||
45 | 45 | ||
46 | static DEFINE_SPINLOCK(ps_spinlock __attribute__((unused))); | 46 | static DEFINE_SPINLOCK(ps_spinlock __attribute__((unused))); |
47 | 47 | ||
48 | static DECLARE_WORK(ps_tq, ps_tq_int, NULL); | 48 | static DECLARE_DELAYED_WORK(ps_tq, ps_tq_int); |
49 | 49 | ||
50 | static void ps_set_intr(void (*continuation)(void), | 50 | static void ps_set_intr(void (*continuation)(void), |
51 | int (*ready)(void), | 51 | int (*ready)(void), |
@@ -63,14 +63,14 @@ static void ps_set_intr(void (*continuation)(void), | |||
63 | if (!ps_tq_active) { | 63 | if (!ps_tq_active) { |
64 | ps_tq_active = 1; | 64 | ps_tq_active = 1; |
65 | if (!ps_nice) | 65 | if (!ps_nice) |
66 | schedule_work(&ps_tq); | 66 | schedule_delayed_work(&ps_tq, 0); |
67 | else | 67 | else |
68 | schedule_delayed_work(&ps_tq, ps_nice-1); | 68 | schedule_delayed_work(&ps_tq, ps_nice-1); |
69 | } | 69 | } |
70 | spin_unlock_irqrestore(&ps_spinlock,flags); | 70 | spin_unlock_irqrestore(&ps_spinlock,flags); |
71 | } | 71 | } |
72 | 72 | ||
73 | static void ps_tq_int(void *data) | 73 | static void ps_tq_int(struct work_struct *work) |
74 | { | 74 | { |
75 | void (*con)(void); | 75 | void (*con)(void); |
76 | unsigned long flags; | 76 | unsigned long flags; |
@@ -92,7 +92,7 @@ static void ps_tq_int(void *data) | |||
92 | } | 92 | } |
93 | ps_tq_active = 1; | 93 | ps_tq_active = 1; |
94 | if (!ps_nice) | 94 | if (!ps_nice) |
95 | schedule_work(&ps_tq); | 95 | schedule_delayed_work(&ps_tq, 0); |
96 | else | 96 | else |
97 | schedule_delayed_work(&ps_tq, ps_nice-1); | 97 | schedule_delayed_work(&ps_tq, ps_nice-1); |
98 | spin_unlock_irqrestore(&ps_spinlock,flags); | 98 | spin_unlock_irqrestore(&ps_spinlock,flags); |
diff --git a/drivers/block/sx8.c b/drivers/block/sx8.c index 47d6975268ff..54509eb3391b 100644 --- a/drivers/block/sx8.c +++ b/drivers/block/sx8.c | |||
@@ -1244,9 +1244,10 @@ out: | |||
1244 | return IRQ_RETVAL(handled); | 1244 | return IRQ_RETVAL(handled); |
1245 | } | 1245 | } |
1246 | 1246 | ||
1247 | static void carm_fsm_task (void *_data) | 1247 | static void carm_fsm_task (struct work_struct *work) |
1248 | { | 1248 | { |
1249 | struct carm_host *host = _data; | 1249 | struct carm_host *host = |
1250 | container_of(work, struct carm_host, fsm_task); | ||
1250 | unsigned long flags; | 1251 | unsigned long flags; |
1251 | unsigned int state; | 1252 | unsigned int state; |
1252 | int rc, i, next_dev; | 1253 | int rc, i, next_dev; |
@@ -1619,7 +1620,7 @@ static int carm_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1619 | host->pdev = pdev; | 1620 | host->pdev = pdev; |
1620 | host->flags = pci_dac ? FL_DAC : 0; | 1621 | host->flags = pci_dac ? FL_DAC : 0; |
1621 | spin_lock_init(&host->lock); | 1622 | spin_lock_init(&host->lock); |
1622 | INIT_WORK(&host->fsm_task, carm_fsm_task, host); | 1623 | INIT_WORK(&host->fsm_task, carm_fsm_task); |
1623 | init_completion(&host->probe_comp); | 1624 | init_completion(&host->probe_comp); |
1624 | 1625 | ||
1625 | for (i = 0; i < ARRAY_SIZE(host->req); i++) | 1626 | for (i = 0; i < ARRAY_SIZE(host->req); i++) |
diff --git a/drivers/block/ub.c b/drivers/block/ub.c index 0d5c73f07265..2098eff91e14 100644 --- a/drivers/block/ub.c +++ b/drivers/block/ub.c | |||
@@ -376,7 +376,7 @@ static int ub_submit_clear_stall(struct ub_dev *sc, struct ub_scsi_cmd *cmd, | |||
376 | int stalled_pipe); | 376 | int stalled_pipe); |
377 | static void ub_top_sense_done(struct ub_dev *sc, struct ub_scsi_cmd *scmd); | 377 | static void ub_top_sense_done(struct ub_dev *sc, struct ub_scsi_cmd *scmd); |
378 | static void ub_reset_enter(struct ub_dev *sc, int try); | 378 | static void ub_reset_enter(struct ub_dev *sc, int try); |
379 | static void ub_reset_task(void *arg); | 379 | static void ub_reset_task(struct work_struct *work); |
380 | static int ub_sync_tur(struct ub_dev *sc, struct ub_lun *lun); | 380 | static int ub_sync_tur(struct ub_dev *sc, struct ub_lun *lun); |
381 | static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun, | 381 | static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun, |
382 | struct ub_capacity *ret); | 382 | struct ub_capacity *ret); |
@@ -1558,9 +1558,9 @@ static void ub_reset_enter(struct ub_dev *sc, int try) | |||
1558 | schedule_work(&sc->reset_work); | 1558 | schedule_work(&sc->reset_work); |
1559 | } | 1559 | } |
1560 | 1560 | ||
1561 | static void ub_reset_task(void *arg) | 1561 | static void ub_reset_task(struct work_struct *work) |
1562 | { | 1562 | { |
1563 | struct ub_dev *sc = arg; | 1563 | struct ub_dev *sc = container_of(work, struct ub_dev, reset_work); |
1564 | unsigned long flags; | 1564 | unsigned long flags; |
1565 | struct list_head *p; | 1565 | struct list_head *p; |
1566 | struct ub_lun *lun; | 1566 | struct ub_lun *lun; |
@@ -2179,7 +2179,7 @@ static int ub_probe(struct usb_interface *intf, | |||
2179 | usb_init_urb(&sc->work_urb); | 2179 | usb_init_urb(&sc->work_urb); |
2180 | tasklet_init(&sc->tasklet, ub_scsi_action, (unsigned long)sc); | 2180 | tasklet_init(&sc->tasklet, ub_scsi_action, (unsigned long)sc); |
2181 | atomic_set(&sc->poison, 0); | 2181 | atomic_set(&sc->poison, 0); |
2182 | INIT_WORK(&sc->reset_work, ub_reset_task, sc); | 2182 | INIT_WORK(&sc->reset_work, ub_reset_task); |
2183 | init_waitqueue_head(&sc->reset_wait); | 2183 | init_waitqueue_head(&sc->reset_wait); |
2184 | 2184 | ||
2185 | init_timer(&sc->work_timer); | 2185 | init_timer(&sc->work_timer); |
diff --git a/drivers/bluetooth/bcm203x.c b/drivers/bluetooth/bcm203x.c index 516751754aa9..9256985cbe36 100644 --- a/drivers/bluetooth/bcm203x.c +++ b/drivers/bluetooth/bcm203x.c | |||
@@ -157,9 +157,10 @@ static void bcm203x_complete(struct urb *urb) | |||
157 | } | 157 | } |
158 | } | 158 | } |
159 | 159 | ||
160 | static void bcm203x_work(void *user_data) | 160 | static void bcm203x_work(struct work_struct *work) |
161 | { | 161 | { |
162 | struct bcm203x_data *data = user_data; | 162 | struct bcm203x_data *data = |
163 | container_of(work, struct bcm203x_data, work); | ||
163 | 164 | ||
164 | if (usb_submit_urb(data->urb, GFP_ATOMIC) < 0) | 165 | if (usb_submit_urb(data->urb, GFP_ATOMIC) < 0) |
165 | BT_ERR("Can't submit URB"); | 166 | BT_ERR("Can't submit URB"); |
@@ -246,7 +247,7 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id | |||
246 | 247 | ||
247 | release_firmware(firmware); | 248 | release_firmware(firmware); |
248 | 249 | ||
249 | INIT_WORK(&data->work, bcm203x_work, (void *) data); | 250 | INIT_WORK(&data->work, bcm203x_work); |
250 | 251 | ||
251 | usb_set_intfdata(intf, data); | 252 | usb_set_intfdata(intf, data); |
252 | 253 | ||
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index e608dadece2f..acb2de5e3a98 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c | |||
@@ -926,9 +926,10 @@ cy_sched_event(struct cyclades_port *info, int event) | |||
926 | * had to poll every port to see if that port needed servicing. | 926 | * had to poll every port to see if that port needed servicing. |
927 | */ | 927 | */ |
928 | static void | 928 | static void |
929 | do_softint(void *private_) | 929 | do_softint(struct work_struct *work) |
930 | { | 930 | { |
931 | struct cyclades_port *info = (struct cyclades_port *) private_; | 931 | struct cyclades_port *info = |
932 | container_of(work, struct cyclades_port, tqueue); | ||
932 | struct tty_struct *tty; | 933 | struct tty_struct *tty; |
933 | 934 | ||
934 | tty = info->tty; | 935 | tty = info->tty; |
@@ -5328,7 +5329,7 @@ cy_init(void) | |||
5328 | info->blocked_open = 0; | 5329 | info->blocked_open = 0; |
5329 | info->default_threshold = 0; | 5330 | info->default_threshold = 0; |
5330 | info->default_timeout = 0; | 5331 | info->default_timeout = 0; |
5331 | INIT_WORK(&info->tqueue, do_softint, info); | 5332 | INIT_WORK(&info->tqueue, do_softint); |
5332 | init_waitqueue_head(&info->open_wait); | 5333 | init_waitqueue_head(&info->open_wait); |
5333 | init_waitqueue_head(&info->close_wait); | 5334 | init_waitqueue_head(&info->close_wait); |
5334 | init_waitqueue_head(&info->shutdown_wait); | 5335 | init_waitqueue_head(&info->shutdown_wait); |
@@ -5403,7 +5404,7 @@ cy_init(void) | |||
5403 | info->blocked_open = 0; | 5404 | info->blocked_open = 0; |
5404 | info->default_threshold = 0; | 5405 | info->default_threshold = 0; |
5405 | info->default_timeout = 0; | 5406 | info->default_timeout = 0; |
5406 | INIT_WORK(&info->tqueue, do_softint, info); | 5407 | INIT_WORK(&info->tqueue, do_softint); |
5407 | init_waitqueue_head(&info->open_wait); | 5408 | init_waitqueue_head(&info->open_wait); |
5408 | init_waitqueue_head(&info->close_wait); | 5409 | init_waitqueue_head(&info->close_wait); |
5409 | init_waitqueue_head(&info->shutdown_wait); | 5410 | init_waitqueue_head(&info->shutdown_wait); |
diff --git a/drivers/char/drm/via_dmablit.c b/drivers/char/drm/via_dmablit.c index 60c1695db300..806f9ce5f47b 100644 --- a/drivers/char/drm/via_dmablit.c +++ b/drivers/char/drm/via_dmablit.c | |||
@@ -500,9 +500,9 @@ via_dmablit_timer(unsigned long data) | |||
500 | 500 | ||
501 | 501 | ||
502 | static void | 502 | static void |
503 | via_dmablit_workqueue(void *data) | 503 | via_dmablit_workqueue(struct work_struct *work) |
504 | { | 504 | { |
505 | drm_via_blitq_t *blitq = (drm_via_blitq_t *) data; | 505 | drm_via_blitq_t *blitq = container_of(work, drm_via_blitq_t, wq); |
506 | drm_device_t *dev = blitq->dev; | 506 | drm_device_t *dev = blitq->dev; |
507 | unsigned long irqsave; | 507 | unsigned long irqsave; |
508 | drm_via_sg_info_t *cur_sg; | 508 | drm_via_sg_info_t *cur_sg; |
@@ -571,7 +571,7 @@ via_init_dmablit(drm_device_t *dev) | |||
571 | DRM_INIT_WAITQUEUE(blitq->blit_queue + j); | 571 | DRM_INIT_WAITQUEUE(blitq->blit_queue + j); |
572 | } | 572 | } |
573 | DRM_INIT_WAITQUEUE(&blitq->busy_queue); | 573 | DRM_INIT_WAITQUEUE(&blitq->busy_queue); |
574 | INIT_WORK(&blitq->wq, via_dmablit_workqueue, blitq); | 574 | INIT_WORK(&blitq->wq, via_dmablit_workqueue); |
575 | init_timer(&blitq->poll_timer); | 575 | init_timer(&blitq->poll_timer); |
576 | blitq->poll_timer.function = &via_dmablit_timer; | 576 | blitq->poll_timer.function = &via_dmablit_timer; |
577 | blitq->poll_timer.data = (unsigned long) blitq; | 577 | blitq->poll_timer.data = (unsigned long) blitq; |
diff --git a/drivers/char/epca.c b/drivers/char/epca.c index 706733c0b36a..7c71eb779802 100644 --- a/drivers/char/epca.c +++ b/drivers/char/epca.c | |||
@@ -200,7 +200,7 @@ static int pc_ioctl(struct tty_struct *, struct file *, | |||
200 | static int info_ioctl(struct tty_struct *, struct file *, | 200 | static int info_ioctl(struct tty_struct *, struct file *, |
201 | unsigned int, unsigned long); | 201 | unsigned int, unsigned long); |
202 | static void pc_set_termios(struct tty_struct *, struct termios *); | 202 | static void pc_set_termios(struct tty_struct *, struct termios *); |
203 | static void do_softint(void *); | 203 | static void do_softint(struct work_struct *work); |
204 | static void pc_stop(struct tty_struct *); | 204 | static void pc_stop(struct tty_struct *); |
205 | static void pc_start(struct tty_struct *); | 205 | static void pc_start(struct tty_struct *); |
206 | static void pc_throttle(struct tty_struct * tty); | 206 | static void pc_throttle(struct tty_struct * tty); |
@@ -1505,7 +1505,7 @@ static void post_fep_init(unsigned int crd) | |||
1505 | 1505 | ||
1506 | ch->brdchan = bc; | 1506 | ch->brdchan = bc; |
1507 | ch->mailbox = gd; | 1507 | ch->mailbox = gd; |
1508 | INIT_WORK(&ch->tqueue, do_softint, ch); | 1508 | INIT_WORK(&ch->tqueue, do_softint); |
1509 | ch->board = &boards[crd]; | 1509 | ch->board = &boards[crd]; |
1510 | 1510 | ||
1511 | spin_lock_irqsave(&epca_lock, flags); | 1511 | spin_lock_irqsave(&epca_lock, flags); |
@@ -2566,9 +2566,9 @@ static void pc_set_termios(struct tty_struct *tty, struct termios *old_termios) | |||
2566 | 2566 | ||
2567 | /* --------------------- Begin do_softint ----------------------- */ | 2567 | /* --------------------- Begin do_softint ----------------------- */ |
2568 | 2568 | ||
2569 | static void do_softint(void *private_) | 2569 | static void do_softint(struct work_struct *work) |
2570 | { /* Begin do_softint */ | 2570 | { /* Begin do_softint */ |
2571 | struct channel *ch = (struct channel *) private_; | 2571 | struct channel *ch = container_of(work, struct channel, tqueue); |
2572 | /* Called in response to a modem change event */ | 2572 | /* Called in response to a modem change event */ |
2573 | if (ch && ch->magic == EPCA_MAGIC) { /* Begin EPCA_MAGIC */ | 2573 | if (ch && ch->magic == EPCA_MAGIC) { /* Begin EPCA_MAGIC */ |
2574 | struct tty_struct *tty = ch->tty; | 2574 | struct tty_struct *tty = ch->tty; |
diff --git a/drivers/char/esp.c b/drivers/char/esp.c index 15a4ea896328..93b551962513 100644 --- a/drivers/char/esp.c +++ b/drivers/char/esp.c | |||
@@ -723,9 +723,10 @@ static irqreturn_t rs_interrupt_single(int irq, void *dev_id) | |||
723 | * ------------------------------------------------------------------- | 723 | * ------------------------------------------------------------------- |
724 | */ | 724 | */ |
725 | 725 | ||
726 | static void do_softint(void *private_) | 726 | static void do_softint(struct work_struct *work) |
727 | { | 727 | { |
728 | struct esp_struct *info = (struct esp_struct *) private_; | 728 | struct esp_struct *info = |
729 | container_of(work, struct esp_struct, tqueue); | ||
729 | struct tty_struct *tty; | 730 | struct tty_struct *tty; |
730 | 731 | ||
731 | tty = info->tty; | 732 | tty = info->tty; |
@@ -746,9 +747,10 @@ static void do_softint(void *private_) | |||
746 | * do_serial_hangup() -> tty->hangup() -> esp_hangup() | 747 | * do_serial_hangup() -> tty->hangup() -> esp_hangup() |
747 | * | 748 | * |
748 | */ | 749 | */ |
749 | static void do_serial_hangup(void *private_) | 750 | static void do_serial_hangup(struct work_struct *work) |
750 | { | 751 | { |
751 | struct esp_struct *info = (struct esp_struct *) private_; | 752 | struct esp_struct *info = |
753 | container_of(work, struct esp_struct, tqueue_hangup); | ||
752 | struct tty_struct *tty; | 754 | struct tty_struct *tty; |
753 | 755 | ||
754 | tty = info->tty; | 756 | tty = info->tty; |
@@ -2501,8 +2503,8 @@ static int __init espserial_init(void) | |||
2501 | info->magic = ESP_MAGIC; | 2503 | info->magic = ESP_MAGIC; |
2502 | info->close_delay = 5*HZ/10; | 2504 | info->close_delay = 5*HZ/10; |
2503 | info->closing_wait = 30*HZ; | 2505 | info->closing_wait = 30*HZ; |
2504 | INIT_WORK(&info->tqueue, do_softint, info); | 2506 | INIT_WORK(&info->tqueue, do_softint); |
2505 | INIT_WORK(&info->tqueue_hangup, do_serial_hangup, info); | 2507 | INIT_WORK(&info->tqueue_hangup, do_serial_hangup); |
2506 | info->config.rx_timeout = rx_timeout; | 2508 | info->config.rx_timeout = rx_timeout; |
2507 | info->config.flow_on = flow_on; | 2509 | info->config.flow_on = flow_on; |
2508 | info->config.flow_off = flow_off; | 2510 | info->config.flow_off = flow_off; |
diff --git a/drivers/char/genrtc.c b/drivers/char/genrtc.c index 817dc409ac20..23b25ada65ea 100644 --- a/drivers/char/genrtc.c +++ b/drivers/char/genrtc.c | |||
@@ -102,7 +102,7 @@ static void gen_rtc_interrupt(unsigned long arg); | |||
102 | * Routine to poll RTC seconds field for change as often as possible, | 102 | * Routine to poll RTC seconds field for change as often as possible, |
103 | * after first RTC_UIE use timer to reduce polling | 103 | * after first RTC_UIE use timer to reduce polling |
104 | */ | 104 | */ |
105 | static void genrtc_troutine(void *data) | 105 | static void genrtc_troutine(struct work_struct *work) |
106 | { | 106 | { |
107 | unsigned int tmp = get_rtc_ss(); | 107 | unsigned int tmp = get_rtc_ss(); |
108 | 108 | ||
@@ -255,7 +255,7 @@ static inline int gen_set_rtc_irq_bit(unsigned char bit) | |||
255 | irq_active = 1; | 255 | irq_active = 1; |
256 | stop_rtc_timers = 0; | 256 | stop_rtc_timers = 0; |
257 | lostint = 0; | 257 | lostint = 0; |
258 | INIT_WORK(&genrtc_task, genrtc_troutine, NULL); | 258 | INIT_WORK(&genrtc_task, genrtc_troutine); |
259 | oldsecs = get_rtc_ss(); | 259 | oldsecs = get_rtc_ss(); |
260 | init_timer(&timer_task); | 260 | init_timer(&timer_task); |
261 | 261 | ||
diff --git a/drivers/char/hvsi.c b/drivers/char/hvsi.c index 2cf63e7305a3..82a41d5b4ed0 100644 --- a/drivers/char/hvsi.c +++ b/drivers/char/hvsi.c | |||
@@ -69,7 +69,7 @@ | |||
69 | #define __ALIGNED__ __attribute__((__aligned__(sizeof(long)))) | 69 | #define __ALIGNED__ __attribute__((__aligned__(sizeof(long)))) |
70 | 70 | ||
71 | struct hvsi_struct { | 71 | struct hvsi_struct { |
72 | struct work_struct writer; | 72 | struct delayed_work writer; |
73 | struct work_struct handshaker; | 73 | struct work_struct handshaker; |
74 | wait_queue_head_t emptyq; /* woken when outbuf is emptied */ | 74 | wait_queue_head_t emptyq; /* woken when outbuf is emptied */ |
75 | wait_queue_head_t stateq; /* woken when HVSI state changes */ | 75 | wait_queue_head_t stateq; /* woken when HVSI state changes */ |
@@ -744,9 +744,10 @@ static int hvsi_handshake(struct hvsi_struct *hp) | |||
744 | return 0; | 744 | return 0; |
745 | } | 745 | } |
746 | 746 | ||
747 | static void hvsi_handshaker(void *arg) | 747 | static void hvsi_handshaker(struct work_struct *work) |
748 | { | 748 | { |
749 | struct hvsi_struct *hp = (struct hvsi_struct *)arg; | 749 | struct hvsi_struct *hp = |
750 | container_of(work, struct hvsi_struct, handshaker); | ||
750 | 751 | ||
751 | if (hvsi_handshake(hp) >= 0) | 752 | if (hvsi_handshake(hp) >= 0) |
752 | return; | 753 | return; |
@@ -951,9 +952,10 @@ static void hvsi_push(struct hvsi_struct *hp) | |||
951 | } | 952 | } |
952 | 953 | ||
953 | /* hvsi_write_worker will keep rescheduling itself until outbuf is empty */ | 954 | /* hvsi_write_worker will keep rescheduling itself until outbuf is empty */ |
954 | static void hvsi_write_worker(void *arg) | 955 | static void hvsi_write_worker(struct work_struct *work) |
955 | { | 956 | { |
956 | struct hvsi_struct *hp = (struct hvsi_struct *)arg; | 957 | struct hvsi_struct *hp = |
958 | container_of(work, struct hvsi_struct, writer.work); | ||
957 | unsigned long flags; | 959 | unsigned long flags; |
958 | #ifdef DEBUG | 960 | #ifdef DEBUG |
959 | static long start_j = 0; | 961 | static long start_j = 0; |
@@ -1287,8 +1289,8 @@ static int __init hvsi_console_init(void) | |||
1287 | } | 1289 | } |
1288 | 1290 | ||
1289 | hp = &hvsi_ports[hvsi_count]; | 1291 | hp = &hvsi_ports[hvsi_count]; |
1290 | INIT_WORK(&hp->writer, hvsi_write_worker, hp); | 1292 | INIT_DELAYED_WORK(&hp->writer, hvsi_write_worker); |
1291 | INIT_WORK(&hp->handshaker, hvsi_handshaker, hp); | 1293 | INIT_WORK(&hp->handshaker, hvsi_handshaker); |
1292 | init_waitqueue_head(&hp->emptyq); | 1294 | init_waitqueue_head(&hp->emptyq); |
1293 | init_waitqueue_head(&hp->stateq); | 1295 | init_waitqueue_head(&hp->stateq); |
1294 | spin_lock_init(&hp->lock); | 1296 | spin_lock_init(&hp->lock); |
diff --git a/drivers/char/ip2/i2lib.c b/drivers/char/ip2/i2lib.c index 54d93f0345e8..c213fdbdb2b0 100644 --- a/drivers/char/ip2/i2lib.c +++ b/drivers/char/ip2/i2lib.c | |||
@@ -84,8 +84,8 @@ static void iiSendPendingMail(i2eBordStrPtr); | |||
84 | static void serviceOutgoingFifo(i2eBordStrPtr); | 84 | static void serviceOutgoingFifo(i2eBordStrPtr); |
85 | 85 | ||
86 | // Functions defined in ip2.c as part of interrupt handling | 86 | // Functions defined in ip2.c as part of interrupt handling |
87 | static void do_input(void *); | 87 | static void do_input(struct work_struct *); |
88 | static void do_status(void *); | 88 | static void do_status(struct work_struct *); |
89 | 89 | ||
90 | //*************** | 90 | //*************** |
91 | //* Debug Data * | 91 | //* Debug Data * |
@@ -331,8 +331,8 @@ i2InitChannels ( i2eBordStrPtr pB, int nChannels, i2ChanStrPtr pCh) | |||
331 | pCh->ClosingWaitTime = 30*HZ; | 331 | pCh->ClosingWaitTime = 30*HZ; |
332 | 332 | ||
333 | // Initialize task queue objects | 333 | // Initialize task queue objects |
334 | INIT_WORK(&pCh->tqueue_input, do_input, pCh); | 334 | INIT_WORK(&pCh->tqueue_input, do_input); |
335 | INIT_WORK(&pCh->tqueue_status, do_status, pCh); | 335 | INIT_WORK(&pCh->tqueue_status, do_status); |
336 | 336 | ||
337 | #ifdef IP2DEBUG_TRACE | 337 | #ifdef IP2DEBUG_TRACE |
338 | pCh->trace = ip2trace; | 338 | pCh->trace = ip2trace; |
@@ -1573,7 +1573,7 @@ i2StripFifo(i2eBordStrPtr pB) | |||
1573 | #ifdef USE_IQ | 1573 | #ifdef USE_IQ |
1574 | schedule_work(&pCh->tqueue_input); | 1574 | schedule_work(&pCh->tqueue_input); |
1575 | #else | 1575 | #else |
1576 | do_input(pCh); | 1576 | do_input(&pCh->tqueue_input); |
1577 | #endif | 1577 | #endif |
1578 | 1578 | ||
1579 | // Note we do not need to maintain any flow-control credits at this | 1579 | // Note we do not need to maintain any flow-control credits at this |
@@ -1810,7 +1810,7 @@ i2StripFifo(i2eBordStrPtr pB) | |||
1810 | #ifdef USE_IQ | 1810 | #ifdef USE_IQ |
1811 | schedule_work(&pCh->tqueue_status); | 1811 | schedule_work(&pCh->tqueue_status); |
1812 | #else | 1812 | #else |
1813 | do_status(pCh); | 1813 | do_status(&pCh->tqueue_status); |
1814 | #endif | 1814 | #endif |
1815 | } | 1815 | } |
1816 | } | 1816 | } |
diff --git a/drivers/char/ip2/ip2main.c b/drivers/char/ip2/ip2main.c index a3f32d46d2f8..cda2459c1d60 100644 --- a/drivers/char/ip2/ip2main.c +++ b/drivers/char/ip2/ip2main.c | |||
@@ -189,12 +189,12 @@ static int ip2_tiocmset(struct tty_struct *tty, struct file *file, | |||
189 | unsigned int set, unsigned int clear); | 189 | unsigned int set, unsigned int clear); |
190 | 190 | ||
191 | static void set_irq(int, int); | 191 | static void set_irq(int, int); |
192 | static void ip2_interrupt_bh(i2eBordStrPtr pB); | 192 | static void ip2_interrupt_bh(struct work_struct *work); |
193 | static irqreturn_t ip2_interrupt(int irq, void *dev_id); | 193 | static irqreturn_t ip2_interrupt(int irq, void *dev_id); |
194 | static void ip2_poll(unsigned long arg); | 194 | static void ip2_poll(unsigned long arg); |
195 | static inline void service_all_boards(void); | 195 | static inline void service_all_boards(void); |
196 | static void do_input(void *p); | 196 | static void do_input(struct work_struct *); |
197 | static void do_status(void *p); | 197 | static void do_status(struct work_struct *); |
198 | 198 | ||
199 | static void ip2_wait_until_sent(PTTY,int); | 199 | static void ip2_wait_until_sent(PTTY,int); |
200 | 200 | ||
@@ -918,7 +918,7 @@ ip2_init_board( int boardnum ) | |||
918 | pCh++; | 918 | pCh++; |
919 | } | 919 | } |
920 | ex_exit: | 920 | ex_exit: |
921 | INIT_WORK(&pB->tqueue_interrupt, (void(*)(void*)) ip2_interrupt_bh, pB); | 921 | INIT_WORK(&pB->tqueue_interrupt, ip2_interrupt_bh); |
922 | return; | 922 | return; |
923 | 923 | ||
924 | err_release_region: | 924 | err_release_region: |
@@ -1125,8 +1125,8 @@ service_all_boards(void) | |||
1125 | 1125 | ||
1126 | 1126 | ||
1127 | /******************************************************************************/ | 1127 | /******************************************************************************/ |
1128 | /* Function: ip2_interrupt_bh(pB) */ | 1128 | /* Function: ip2_interrupt_bh(work) */ |
1129 | /* Parameters: pB - pointer to the board structure */ | 1129 | /* Parameters: work - pointer to the board structure */ |
1130 | /* Returns: Nothing */ | 1130 | /* Returns: Nothing */ |
1131 | /* */ | 1131 | /* */ |
1132 | /* Description: */ | 1132 | /* Description: */ |
@@ -1135,8 +1135,9 @@ service_all_boards(void) | |||
1135 | /* */ | 1135 | /* */ |
1136 | /******************************************************************************/ | 1136 | /******************************************************************************/ |
1137 | static void | 1137 | static void |
1138 | ip2_interrupt_bh(i2eBordStrPtr pB) | 1138 | ip2_interrupt_bh(struct work_struct *work) |
1139 | { | 1139 | { |
1140 | i2eBordStrPtr pB = container_of(work, i2eBordStr, tqueue_interrupt); | ||
1140 | // pB better well be set or we have a problem! We can only get | 1141 | // pB better well be set or we have a problem! We can only get |
1141 | // here from the IMMEDIATE queue. Here, we process the boards. | 1142 | // here from the IMMEDIATE queue. Here, we process the boards. |
1142 | // Checking pB doesn't cost much and it saves us from the sanity checkers. | 1143 | // Checking pB doesn't cost much and it saves us from the sanity checkers. |
@@ -1245,9 +1246,9 @@ ip2_poll(unsigned long arg) | |||
1245 | ip2trace (ITRC_NO_PORT, ITRC_INTR, ITRC_RETURN, 0 ); | 1246 | ip2trace (ITRC_NO_PORT, ITRC_INTR, ITRC_RETURN, 0 ); |
1246 | } | 1247 | } |
1247 | 1248 | ||
1248 | static void do_input(void *p) | 1249 | static void do_input(struct work_struct *work) |
1249 | { | 1250 | { |
1250 | i2ChanStrPtr pCh = p; | 1251 | i2ChanStrPtr pCh = container_of(work, i2ChanStr, tqueue_input); |
1251 | unsigned long flags; | 1252 | unsigned long flags; |
1252 | 1253 | ||
1253 | ip2trace(CHANN, ITRC_INPUT, 21, 0 ); | 1254 | ip2trace(CHANN, ITRC_INPUT, 21, 0 ); |
@@ -1279,9 +1280,9 @@ static inline void isig(int sig, struct tty_struct *tty, int flush) | |||
1279 | } | 1280 | } |
1280 | } | 1281 | } |
1281 | 1282 | ||
1282 | static void do_status(void *p) | 1283 | static void do_status(struct work_struct *work) |
1283 | { | 1284 | { |
1284 | i2ChanStrPtr pCh = p; | 1285 | i2ChanStrPtr pCh = container_of(work, i2ChanStr, tqueue_status); |
1285 | int status; | 1286 | int status; |
1286 | 1287 | ||
1287 | status = i2GetStatus( pCh, (I2_BRK|I2_PAR|I2_FRA|I2_OVR) ); | 1288 | status = i2GetStatus( pCh, (I2_BRK|I2_PAR|I2_FRA|I2_OVR) ); |
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c index 58c955e390b3..1637c1d9a4ba 100644 --- a/drivers/char/isicom.c +++ b/drivers/char/isicom.c | |||
@@ -530,9 +530,9 @@ sched_again: | |||
530 | /* Interrupt handlers */ | 530 | /* Interrupt handlers */ |
531 | 531 | ||
532 | 532 | ||
533 | static void isicom_bottomhalf(void *data) | 533 | static void isicom_bottomhalf(struct work_struct *work) |
534 | { | 534 | { |
535 | struct isi_port *port = (struct isi_port *) data; | 535 | struct isi_port *port = container_of(work, struct isi_port, bh_tqueue); |
536 | struct tty_struct *tty = port->tty; | 536 | struct tty_struct *tty = port->tty; |
537 | 537 | ||
538 | if (!tty) | 538 | if (!tty) |
@@ -1474,9 +1474,9 @@ static void isicom_start(struct tty_struct *tty) | |||
1474 | } | 1474 | } |
1475 | 1475 | ||
1476 | /* hangup et all */ | 1476 | /* hangup et all */ |
1477 | static void do_isicom_hangup(void *data) | 1477 | static void do_isicom_hangup(struct work_struct *work) |
1478 | { | 1478 | { |
1479 | struct isi_port *port = data; | 1479 | struct isi_port *port = container_of(work, struct isi_port, hangup_tq); |
1480 | struct tty_struct *tty; | 1480 | struct tty_struct *tty; |
1481 | 1481 | ||
1482 | tty = port->tty; | 1482 | tty = port->tty; |
@@ -1966,8 +1966,8 @@ static int __devinit isicom_setup(void) | |||
1966 | port->channel = channel; | 1966 | port->channel = channel; |
1967 | port->close_delay = 50 * HZ/100; | 1967 | port->close_delay = 50 * HZ/100; |
1968 | port->closing_wait = 3000 * HZ/100; | 1968 | port->closing_wait = 3000 * HZ/100; |
1969 | INIT_WORK(&port->hangup_tq, do_isicom_hangup, port); | 1969 | INIT_WORK(&port->hangup_tq, do_isicom_hangup); |
1970 | INIT_WORK(&port->bh_tqueue, isicom_bottomhalf, port); | 1970 | INIT_WORK(&port->bh_tqueue, isicom_bottomhalf); |
1971 | port->status = 0; | 1971 | port->status = 0; |
1972 | init_waitqueue_head(&port->open_wait); | 1972 | init_waitqueue_head(&port->open_wait); |
1973 | init_waitqueue_head(&port->close_wait); | 1973 | init_waitqueue_head(&port->close_wait); |
diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c index 96cb1f07332b..2d025a9fd14d 100644 --- a/drivers/char/moxa.c +++ b/drivers/char/moxa.c | |||
@@ -222,7 +222,7 @@ static struct semaphore moxaBuffSem; | |||
222 | /* | 222 | /* |
223 | * static functions: | 223 | * static functions: |
224 | */ | 224 | */ |
225 | static void do_moxa_softint(void *); | 225 | static void do_moxa_softint(struct work_struct *); |
226 | static int moxa_open(struct tty_struct *, struct file *); | 226 | static int moxa_open(struct tty_struct *, struct file *); |
227 | static void moxa_close(struct tty_struct *, struct file *); | 227 | static void moxa_close(struct tty_struct *, struct file *); |
228 | static int moxa_write(struct tty_struct *, const unsigned char *, int); | 228 | static int moxa_write(struct tty_struct *, const unsigned char *, int); |
@@ -363,7 +363,7 @@ static int __init moxa_init(void) | |||
363 | for (i = 0, ch = moxaChannels; i < MAX_PORTS; i++, ch++) { | 363 | for (i = 0, ch = moxaChannels; i < MAX_PORTS; i++, ch++) { |
364 | ch->type = PORT_16550A; | 364 | ch->type = PORT_16550A; |
365 | ch->port = i; | 365 | ch->port = i; |
366 | INIT_WORK(&ch->tqueue, do_moxa_softint, ch); | 366 | INIT_WORK(&ch->tqueue, do_moxa_softint); |
367 | ch->tty = NULL; | 367 | ch->tty = NULL; |
368 | ch->close_delay = 5 * HZ / 10; | 368 | ch->close_delay = 5 * HZ / 10; |
369 | ch->closing_wait = 30 * HZ; | 369 | ch->closing_wait = 30 * HZ; |
@@ -509,9 +509,9 @@ static void __exit moxa_exit(void) | |||
509 | module_init(moxa_init); | 509 | module_init(moxa_init); |
510 | module_exit(moxa_exit); | 510 | module_exit(moxa_exit); |
511 | 511 | ||
512 | static void do_moxa_softint(void *private_) | 512 | static void do_moxa_softint(struct work_struct *work) |
513 | { | 513 | { |
514 | struct moxa_str *ch = (struct moxa_str *) private_; | 514 | struct moxa_str *ch = container_of(work, struct moxa_str, tqueue); |
515 | struct tty_struct *tty; | 515 | struct tty_struct *tty; |
516 | 516 | ||
517 | if (ch && (tty = ch->tty)) { | 517 | if (ch && (tty = ch->tty)) { |
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index 048d91142c17..5ed2486b7581 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c | |||
@@ -389,7 +389,7 @@ static int mxser_init(void); | |||
389 | /* static void mxser_poll(unsigned long); */ | 389 | /* static void mxser_poll(unsigned long); */ |
390 | static int mxser_get_ISA_conf(int, struct mxser_hwconf *); | 390 | static int mxser_get_ISA_conf(int, struct mxser_hwconf *); |
391 | static int mxser_get_PCI_conf(int, int, int, struct mxser_hwconf *); | 391 | static int mxser_get_PCI_conf(int, int, int, struct mxser_hwconf *); |
392 | static void mxser_do_softint(void *); | 392 | static void mxser_do_softint(struct work_struct *); |
393 | static int mxser_open(struct tty_struct *, struct file *); | 393 | static int mxser_open(struct tty_struct *, struct file *); |
394 | static void mxser_close(struct tty_struct *, struct file *); | 394 | static void mxser_close(struct tty_struct *, struct file *); |
395 | static int mxser_write(struct tty_struct *, const unsigned char *, int); | 395 | static int mxser_write(struct tty_struct *, const unsigned char *, int); |
@@ -590,7 +590,7 @@ static int mxser_initbrd(int board, struct mxser_hwconf *hwconf) | |||
590 | info->custom_divisor = hwconf->baud_base[i] * 16; | 590 | info->custom_divisor = hwconf->baud_base[i] * 16; |
591 | info->close_delay = 5 * HZ / 10; | 591 | info->close_delay = 5 * HZ / 10; |
592 | info->closing_wait = 30 * HZ; | 592 | info->closing_wait = 30 * HZ; |
593 | INIT_WORK(&info->tqueue, mxser_do_softint, info); | 593 | INIT_WORK(&info->tqueue, mxser_do_softint); |
594 | info->normal_termios = mxvar_sdriver->init_termios; | 594 | info->normal_termios = mxvar_sdriver->init_termios; |
595 | init_waitqueue_head(&info->open_wait); | 595 | init_waitqueue_head(&info->open_wait); |
596 | init_waitqueue_head(&info->close_wait); | 596 | init_waitqueue_head(&info->close_wait); |
@@ -917,9 +917,10 @@ static int mxser_init(void) | |||
917 | return 0; | 917 | return 0; |
918 | } | 918 | } |
919 | 919 | ||
920 | static void mxser_do_softint(void *private_) | 920 | static void mxser_do_softint(struct work_struct *work) |
921 | { | 921 | { |
922 | struct mxser_struct *info = private_; | 922 | struct mxser_struct *info = |
923 | container_of(work, struct mxser_struct, tqueue); | ||
923 | struct tty_struct *tty; | 924 | struct tty_struct *tty; |
924 | 925 | ||
925 | tty = info->tty; | 926 | tty = info->tty; |
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index f9f72500ea5d..1bd12296dca5 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c | |||
@@ -421,7 +421,7 @@ static irqreturn_t mgslpc_isr(int irq, void *dev_id); | |||
421 | /* | 421 | /* |
422 | * Bottom half interrupt handlers | 422 | * Bottom half interrupt handlers |
423 | */ | 423 | */ |
424 | static void bh_handler(void* Context); | 424 | static void bh_handler(struct work_struct *work); |
425 | static void bh_transmit(MGSLPC_INFO *info); | 425 | static void bh_transmit(MGSLPC_INFO *info); |
426 | static void bh_status(MGSLPC_INFO *info); | 426 | static void bh_status(MGSLPC_INFO *info); |
427 | 427 | ||
@@ -547,7 +547,7 @@ static int mgslpc_probe(struct pcmcia_device *link) | |||
547 | 547 | ||
548 | memset(info, 0, sizeof(MGSLPC_INFO)); | 548 | memset(info, 0, sizeof(MGSLPC_INFO)); |
549 | info->magic = MGSLPC_MAGIC; | 549 | info->magic = MGSLPC_MAGIC; |
550 | INIT_WORK(&info->task, bh_handler, info); | 550 | INIT_WORK(&info->task, bh_handler); |
551 | info->max_frame_size = 4096; | 551 | info->max_frame_size = 4096; |
552 | info->close_delay = 5*HZ/10; | 552 | info->close_delay = 5*HZ/10; |
553 | info->closing_wait = 30*HZ; | 553 | info->closing_wait = 30*HZ; |
@@ -835,9 +835,9 @@ static int bh_action(MGSLPC_INFO *info) | |||
835 | return rc; | 835 | return rc; |
836 | } | 836 | } |
837 | 837 | ||
838 | static void bh_handler(void* Context) | 838 | static void bh_handler(struct work_struct *work) |
839 | { | 839 | { |
840 | MGSLPC_INFO *info = (MGSLPC_INFO*)Context; | 840 | MGSLPC_INFO *info = container_of(work, MGSLPC_INFO, task); |
841 | int action; | 841 | int action; |
842 | 842 | ||
843 | if (!info) | 843 | if (!info) |
diff --git a/drivers/char/random.c b/drivers/char/random.c index d40df30c2b10..4c6782a1ecdb 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
@@ -1422,9 +1422,9 @@ static struct keydata { | |||
1422 | 1422 | ||
1423 | static unsigned int ip_cnt; | 1423 | static unsigned int ip_cnt; |
1424 | 1424 | ||
1425 | static void rekey_seq_generator(void *private_); | 1425 | static void rekey_seq_generator(struct work_struct *work); |
1426 | 1426 | ||
1427 | static DECLARE_WORK(rekey_work, rekey_seq_generator, NULL); | 1427 | static DECLARE_DELAYED_WORK(rekey_work, rekey_seq_generator); |
1428 | 1428 | ||
1429 | /* | 1429 | /* |
1430 | * Lock avoidance: | 1430 | * Lock avoidance: |
@@ -1438,7 +1438,7 @@ static DECLARE_WORK(rekey_work, rekey_seq_generator, NULL); | |||
1438 | * happen, and even if that happens only a not perfectly compliant | 1438 | * happen, and even if that happens only a not perfectly compliant |
1439 | * ISN is generated, nothing fatal. | 1439 | * ISN is generated, nothing fatal. |
1440 | */ | 1440 | */ |
1441 | static void rekey_seq_generator(void *private_) | 1441 | static void rekey_seq_generator(struct work_struct *work) |
1442 | { | 1442 | { |
1443 | struct keydata *keyptr = &ip_keydata[1 ^ (ip_cnt & 1)]; | 1443 | struct keydata *keyptr = &ip_keydata[1 ^ (ip_cnt & 1)]; |
1444 | 1444 | ||
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index c084149153de..fc87070f1866 100644 --- a/drivers/char/sonypi.c +++ b/drivers/char/sonypi.c | |||
@@ -765,7 +765,7 @@ static void sonypi_setbluetoothpower(u8 state) | |||
765 | sonypi_device.bluetooth_power = state; | 765 | sonypi_device.bluetooth_power = state; |
766 | } | 766 | } |
767 | 767 | ||
768 | static void input_keyrelease(void *data) | 768 | static void input_keyrelease(struct work_struct *work) |
769 | { | 769 | { |
770 | struct sonypi_keypress kp; | 770 | struct sonypi_keypress kp; |
771 | 771 | ||
@@ -1412,7 +1412,7 @@ static int __devinit sonypi_probe(struct platform_device *dev) | |||
1412 | goto err_inpdev_unregister; | 1412 | goto err_inpdev_unregister; |
1413 | } | 1413 | } |
1414 | 1414 | ||
1415 | INIT_WORK(&sonypi_device.input_work, input_keyrelease, NULL); | 1415 | INIT_WORK(&sonypi_device.input_work, input_keyrelease); |
1416 | } | 1416 | } |
1417 | 1417 | ||
1418 | sonypi_enable(0); | 1418 | sonypi_enable(0); |
diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c index 7e1bd9562c2a..99137ab66b62 100644 --- a/drivers/char/specialix.c +++ b/drivers/char/specialix.c | |||
@@ -2261,9 +2261,10 @@ static void sx_start(struct tty_struct * tty) | |||
2261 | * do_sx_hangup() -> tty->hangup() -> sx_hangup() | 2261 | * do_sx_hangup() -> tty->hangup() -> sx_hangup() |
2262 | * | 2262 | * |
2263 | */ | 2263 | */ |
2264 | static void do_sx_hangup(void *private_) | 2264 | static void do_sx_hangup(struct work_struct *work) |
2265 | { | 2265 | { |
2266 | struct specialix_port *port = (struct specialix_port *) private_; | 2266 | struct specialix_port *port = |
2267 | container_of(work, struct specialix_port, tqueue_hangup); | ||
2267 | struct tty_struct *tty; | 2268 | struct tty_struct *tty; |
2268 | 2269 | ||
2269 | func_enter(); | 2270 | func_enter(); |
@@ -2336,9 +2337,10 @@ static void sx_set_termios(struct tty_struct * tty, struct termios * old_termios | |||
2336 | } | 2337 | } |
2337 | 2338 | ||
2338 | 2339 | ||
2339 | static void do_softint(void *private_) | 2340 | static void do_softint(struct work_struct *work) |
2340 | { | 2341 | { |
2341 | struct specialix_port *port = (struct specialix_port *) private_; | 2342 | struct specialix_port *port = |
2343 | container_of(work, struct specialix_port, tqueue); | ||
2342 | struct tty_struct *tty; | 2344 | struct tty_struct *tty; |
2343 | 2345 | ||
2344 | func_enter(); | 2346 | func_enter(); |
@@ -2411,8 +2413,8 @@ static int sx_init_drivers(void) | |||
2411 | memset(sx_port, 0, sizeof(sx_port)); | 2413 | memset(sx_port, 0, sizeof(sx_port)); |
2412 | for (i = 0; i < SX_NPORT * SX_NBOARD; i++) { | 2414 | for (i = 0; i < SX_NPORT * SX_NBOARD; i++) { |
2413 | sx_port[i].magic = SPECIALIX_MAGIC; | 2415 | sx_port[i].magic = SPECIALIX_MAGIC; |
2414 | INIT_WORK(&sx_port[i].tqueue, do_softint, &sx_port[i]); | 2416 | INIT_WORK(&sx_port[i].tqueue, do_softint); |
2415 | INIT_WORK(&sx_port[i].tqueue_hangup, do_sx_hangup, &sx_port[i]); | 2417 | INIT_WORK(&sx_port[i].tqueue_hangup, do_sx_hangup); |
2416 | sx_port[i].close_delay = 50 * HZ/100; | 2418 | sx_port[i].close_delay = 50 * HZ/100; |
2417 | sx_port[i].closing_wait = 3000 * HZ/100; | 2419 | sx_port[i].closing_wait = 3000 * HZ/100; |
2418 | init_waitqueue_head(&sx_port[i].open_wait); | 2420 | init_waitqueue_head(&sx_port[i].open_wait); |
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index 06784adcc35c..147c30da81ea 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c | |||
@@ -802,7 +802,7 @@ static int save_tx_buffer_request(struct mgsl_struct *info,const char *Buffer, u | |||
802 | /* | 802 | /* |
803 | * Bottom half interrupt handlers | 803 | * Bottom half interrupt handlers |
804 | */ | 804 | */ |
805 | static void mgsl_bh_handler(void* Context); | 805 | static void mgsl_bh_handler(struct work_struct *work); |
806 | static void mgsl_bh_receive(struct mgsl_struct *info); | 806 | static void mgsl_bh_receive(struct mgsl_struct *info); |
807 | static void mgsl_bh_transmit(struct mgsl_struct *info); | 807 | static void mgsl_bh_transmit(struct mgsl_struct *info); |
808 | static void mgsl_bh_status(struct mgsl_struct *info); | 808 | static void mgsl_bh_status(struct mgsl_struct *info); |
@@ -1071,9 +1071,10 @@ static int mgsl_bh_action(struct mgsl_struct *info) | |||
1071 | /* | 1071 | /* |
1072 | * Perform bottom half processing of work items queued by ISR. | 1072 | * Perform bottom half processing of work items queued by ISR. |
1073 | */ | 1073 | */ |
1074 | static void mgsl_bh_handler(void* Context) | 1074 | static void mgsl_bh_handler(struct work_struct *work) |
1075 | { | 1075 | { |
1076 | struct mgsl_struct *info = (struct mgsl_struct*)Context; | 1076 | struct mgsl_struct *info = |
1077 | container_of(work, struct mgsl_struct, task); | ||
1077 | int action; | 1078 | int action; |
1078 | 1079 | ||
1079 | if (!info) | 1080 | if (!info) |
@@ -4337,7 +4338,7 @@ static struct mgsl_struct* mgsl_allocate_device(void) | |||
4337 | } else { | 4338 | } else { |
4338 | memset(info, 0, sizeof(struct mgsl_struct)); | 4339 | memset(info, 0, sizeof(struct mgsl_struct)); |
4339 | info->magic = MGSL_MAGIC; | 4340 | info->magic = MGSL_MAGIC; |
4340 | INIT_WORK(&info->task, mgsl_bh_handler, info); | 4341 | INIT_WORK(&info->task, mgsl_bh_handler); |
4341 | info->max_frame_size = 4096; | 4342 | info->max_frame_size = 4096; |
4342 | info->close_delay = 5*HZ/10; | 4343 | info->close_delay = 5*HZ/10; |
4343 | info->closing_wait = 30*HZ; | 4344 | info->closing_wait = 30*HZ; |
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c index d4334c79f8d4..07f34d43dc7f 100644 --- a/drivers/char/synclink_gt.c +++ b/drivers/char/synclink_gt.c | |||
@@ -485,7 +485,7 @@ static void enable_loopback(struct slgt_info *info); | |||
485 | static void set_rate(struct slgt_info *info, u32 data_rate); | 485 | static void set_rate(struct slgt_info *info, u32 data_rate); |
486 | 486 | ||
487 | static int bh_action(struct slgt_info *info); | 487 | static int bh_action(struct slgt_info *info); |
488 | static void bh_handler(void* context); | 488 | static void bh_handler(struct work_struct *work); |
489 | static void bh_transmit(struct slgt_info *info); | 489 | static void bh_transmit(struct slgt_info *info); |
490 | static void isr_serial(struct slgt_info *info); | 490 | static void isr_serial(struct slgt_info *info); |
491 | static void isr_rdma(struct slgt_info *info); | 491 | static void isr_rdma(struct slgt_info *info); |
@@ -1878,9 +1878,9 @@ static int bh_action(struct slgt_info *info) | |||
1878 | /* | 1878 | /* |
1879 | * perform bottom half processing | 1879 | * perform bottom half processing |
1880 | */ | 1880 | */ |
1881 | static void bh_handler(void* context) | 1881 | static void bh_handler(struct work_struct *work) |
1882 | { | 1882 | { |
1883 | struct slgt_info *info = context; | 1883 | struct slgt_info *info = container_of(work, struct slgt_info, task); |
1884 | int action; | 1884 | int action; |
1885 | 1885 | ||
1886 | if (!info) | 1886 | if (!info) |
@@ -3326,7 +3326,7 @@ static struct slgt_info *alloc_dev(int adapter_num, int port_num, struct pci_dev | |||
3326 | } else { | 3326 | } else { |
3327 | memset(info, 0, sizeof(struct slgt_info)); | 3327 | memset(info, 0, sizeof(struct slgt_info)); |
3328 | info->magic = MGSL_MAGIC; | 3328 | info->magic = MGSL_MAGIC; |
3329 | INIT_WORK(&info->task, bh_handler, info); | 3329 | INIT_WORK(&info->task, bh_handler); |
3330 | info->max_frame_size = 4096; | 3330 | info->max_frame_size = 4096; |
3331 | info->raw_rx_size = DMABUFSIZE; | 3331 | info->raw_rx_size = DMABUFSIZE; |
3332 | info->close_delay = 5*HZ/10; | 3332 | info->close_delay = 5*HZ/10; |
@@ -4799,6 +4799,6 @@ static void rx_timeout(unsigned long context) | |||
4799 | spin_lock_irqsave(&info->lock, flags); | 4799 | spin_lock_irqsave(&info->lock, flags); |
4800 | info->pending_bh |= BH_RECEIVE; | 4800 | info->pending_bh |= BH_RECEIVE; |
4801 | spin_unlock_irqrestore(&info->lock, flags); | 4801 | spin_unlock_irqrestore(&info->lock, flags); |
4802 | bh_handler(info); | 4802 | bh_handler(&info->task); |
4803 | } | 4803 | } |
4804 | 4804 | ||
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c index 3e932b681371..13a57245cf2e 100644 --- a/drivers/char/synclinkmp.c +++ b/drivers/char/synclinkmp.c | |||
@@ -602,7 +602,7 @@ static void enable_loopback(SLMP_INFO *info, int enable); | |||
602 | static void set_rate(SLMP_INFO *info, u32 data_rate); | 602 | static void set_rate(SLMP_INFO *info, u32 data_rate); |
603 | 603 | ||
604 | static int bh_action(SLMP_INFO *info); | 604 | static int bh_action(SLMP_INFO *info); |
605 | static void bh_handler(void* Context); | 605 | static void bh_handler(struct work_struct *work); |
606 | static void bh_receive(SLMP_INFO *info); | 606 | static void bh_receive(SLMP_INFO *info); |
607 | static void bh_transmit(SLMP_INFO *info); | 607 | static void bh_transmit(SLMP_INFO *info); |
608 | static void bh_status(SLMP_INFO *info); | 608 | static void bh_status(SLMP_INFO *info); |
@@ -2063,9 +2063,9 @@ int bh_action(SLMP_INFO *info) | |||
2063 | 2063 | ||
2064 | /* Perform bottom half processing of work items queued by ISR. | 2064 | /* Perform bottom half processing of work items queued by ISR. |
2065 | */ | 2065 | */ |
2066 | void bh_handler(void* Context) | 2066 | void bh_handler(struct work_struct *work) |
2067 | { | 2067 | { |
2068 | SLMP_INFO *info = (SLMP_INFO*)Context; | 2068 | SLMP_INFO *info = container_of(work, SLMP_INFO, task); |
2069 | int action; | 2069 | int action; |
2070 | 2070 | ||
2071 | if (!info) | 2071 | if (!info) |
@@ -3805,7 +3805,7 @@ static SLMP_INFO *alloc_dev(int adapter_num, int port_num, struct pci_dev *pdev) | |||
3805 | } else { | 3805 | } else { |
3806 | memset(info, 0, sizeof(SLMP_INFO)); | 3806 | memset(info, 0, sizeof(SLMP_INFO)); |
3807 | info->magic = MGSL_MAGIC; | 3807 | info->magic = MGSL_MAGIC; |
3808 | INIT_WORK(&info->task, bh_handler, info); | 3808 | INIT_WORK(&info->task, bh_handler); |
3809 | info->max_frame_size = 4096; | 3809 | info->max_frame_size = 4096; |
3810 | info->close_delay = 5*HZ/10; | 3810 | info->close_delay = 5*HZ/10; |
3811 | info->closing_wait = 30*HZ; | 3811 | info->closing_wait = 30*HZ; |
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index 5f49280779fb..c64f5bcff947 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c | |||
@@ -219,13 +219,13 @@ static struct sysrq_key_op sysrq_term_op = { | |||
219 | .enable_mask = SYSRQ_ENABLE_SIGNAL, | 219 | .enable_mask = SYSRQ_ENABLE_SIGNAL, |
220 | }; | 220 | }; |
221 | 221 | ||
222 | static void moom_callback(void *ignored) | 222 | static void moom_callback(struct work_struct *ignored) |
223 | { | 223 | { |
224 | out_of_memory(&NODE_DATA(0)->node_zonelists[ZONE_NORMAL], | 224 | out_of_memory(&NODE_DATA(0)->node_zonelists[ZONE_NORMAL], |
225 | GFP_KERNEL, 0); | 225 | GFP_KERNEL, 0); |
226 | } | 226 | } |
227 | 227 | ||
228 | static DECLARE_WORK(moom_work, moom_callback, NULL); | 228 | static DECLARE_WORK(moom_work, moom_callback); |
229 | 229 | ||
230 | static void sysrq_handle_moom(int key, struct tty_struct *tty) | 230 | static void sysrq_handle_moom(int key, struct tty_struct *tty) |
231 | { | 231 | { |
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index 6e1329d404d2..774fa861169a 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
@@ -325,9 +325,9 @@ static void user_reader_timeout(unsigned long ptr) | |||
325 | schedule_work(&chip->work); | 325 | schedule_work(&chip->work); |
326 | } | 326 | } |
327 | 327 | ||
328 | static void timeout_work(void *ptr) | 328 | static void timeout_work(struct work_struct *work) |
329 | { | 329 | { |
330 | struct tpm_chip *chip = ptr; | 330 | struct tpm_chip *chip = container_of(work, struct tpm_chip, work); |
331 | 331 | ||
332 | down(&chip->buffer_mutex); | 332 | down(&chip->buffer_mutex); |
333 | atomic_set(&chip->data_pending, 0); | 333 | atomic_set(&chip->data_pending, 0); |
@@ -1105,7 +1105,7 @@ struct tpm_chip *tpm_register_hardware(struct device *dev, const struct tpm_vend | |||
1105 | init_MUTEX(&chip->tpm_mutex); | 1105 | init_MUTEX(&chip->tpm_mutex); |
1106 | INIT_LIST_HEAD(&chip->list); | 1106 | INIT_LIST_HEAD(&chip->list); |
1107 | 1107 | ||
1108 | INIT_WORK(&chip->work, timeout_work, chip); | 1108 | INIT_WORK(&chip->work, timeout_work); |
1109 | 1109 | ||
1110 | init_timer(&chip->user_read_timer); | 1110 | init_timer(&chip->user_read_timer); |
1111 | chip->user_read_timer.function = user_reader_timeout; | 1111 | chip->user_read_timer.function = user_reader_timeout; |
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 50dc49205a23..b3cfc8bc613c 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c | |||
@@ -1254,7 +1254,7 @@ EXPORT_SYMBOL_GPL(tty_ldisc_flush); | |||
1254 | 1254 | ||
1255 | /** | 1255 | /** |
1256 | * do_tty_hangup - actual handler for hangup events | 1256 | * do_tty_hangup - actual handler for hangup events |
1257 | * @data: tty device | 1257 | * @work: tty device |
1258 | * | 1258 | * |
1259 | * This can be called by the "eventd" kernel thread. That is process | 1259 | * This can be called by the "eventd" kernel thread. That is process |
1260 | * synchronous but doesn't hold any locks, so we need to make sure we | 1260 | * synchronous but doesn't hold any locks, so we need to make sure we |
@@ -1274,9 +1274,10 @@ EXPORT_SYMBOL_GPL(tty_ldisc_flush); | |||
1274 | * tasklist_lock to walk task list for hangup event | 1274 | * tasklist_lock to walk task list for hangup event |
1275 | * | 1275 | * |
1276 | */ | 1276 | */ |
1277 | static void do_tty_hangup(void *data) | 1277 | static void do_tty_hangup(struct work_struct *work) |
1278 | { | 1278 | { |
1279 | struct tty_struct *tty = (struct tty_struct *) data; | 1279 | struct tty_struct *tty = |
1280 | container_of(work, struct tty_struct, hangup_work); | ||
1280 | struct file * cons_filp = NULL; | 1281 | struct file * cons_filp = NULL; |
1281 | struct file *filp, *f = NULL; | 1282 | struct file *filp, *f = NULL; |
1282 | struct task_struct *p; | 1283 | struct task_struct *p; |
@@ -1433,7 +1434,7 @@ void tty_vhangup(struct tty_struct * tty) | |||
1433 | 1434 | ||
1434 | printk(KERN_DEBUG "%s vhangup...\n", tty_name(tty, buf)); | 1435 | printk(KERN_DEBUG "%s vhangup...\n", tty_name(tty, buf)); |
1435 | #endif | 1436 | #endif |
1436 | do_tty_hangup((void *) tty); | 1437 | do_tty_hangup(&tty->hangup_work); |
1437 | } | 1438 | } |
1438 | EXPORT_SYMBOL(tty_vhangup); | 1439 | EXPORT_SYMBOL(tty_vhangup); |
1439 | 1440 | ||
@@ -3304,12 +3305,13 @@ int tty_ioctl(struct inode * inode, struct file * file, | |||
3304 | * Nasty bug: do_SAK is being called in interrupt context. This can | 3305 | * Nasty bug: do_SAK is being called in interrupt context. This can |
3305 | * deadlock. We punt it up to process context. AKPM - 16Mar2001 | 3306 | * deadlock. We punt it up to process context. AKPM - 16Mar2001 |
3306 | */ | 3307 | */ |
3307 | static void __do_SAK(void *arg) | 3308 | static void __do_SAK(struct work_struct *work) |
3308 | { | 3309 | { |
3310 | struct tty_struct *tty = | ||
3311 | container_of(work, struct tty_struct, SAK_work); | ||
3309 | #ifdef TTY_SOFT_SAK | 3312 | #ifdef TTY_SOFT_SAK |
3310 | tty_hangup(tty); | 3313 | tty_hangup(tty); |
3311 | #else | 3314 | #else |
3312 | struct tty_struct *tty = arg; | ||
3313 | struct task_struct *g, *p; | 3315 | struct task_struct *g, *p; |
3314 | int session; | 3316 | int session; |
3315 | int i; | 3317 | int i; |
@@ -3388,7 +3390,7 @@ void do_SAK(struct tty_struct *tty) | |||
3388 | { | 3390 | { |
3389 | if (!tty) | 3391 | if (!tty) |
3390 | return; | 3392 | return; |
3391 | PREPARE_WORK(&tty->SAK_work, __do_SAK, tty); | 3393 | PREPARE_WORK(&tty->SAK_work, __do_SAK); |
3392 | schedule_work(&tty->SAK_work); | 3394 | schedule_work(&tty->SAK_work); |
3393 | } | 3395 | } |
3394 | 3396 | ||
@@ -3396,7 +3398,7 @@ EXPORT_SYMBOL(do_SAK); | |||
3396 | 3398 | ||
3397 | /** | 3399 | /** |
3398 | * flush_to_ldisc | 3400 | * flush_to_ldisc |
3399 | * @private_: tty structure passed from work queue. | 3401 | * @work: tty structure passed from work queue. |
3400 | * | 3402 | * |
3401 | * This routine is called out of the software interrupt to flush data | 3403 | * This routine is called out of the software interrupt to flush data |
3402 | * from the buffer chain to the line discipline. | 3404 | * from the buffer chain to the line discipline. |
@@ -3406,9 +3408,10 @@ EXPORT_SYMBOL(do_SAK); | |||
3406 | * receive_buf method is single threaded for each tty instance. | 3408 | * receive_buf method is single threaded for each tty instance. |
3407 | */ | 3409 | */ |
3408 | 3410 | ||
3409 | static void flush_to_ldisc(void *private_) | 3411 | static void flush_to_ldisc(struct work_struct *work) |
3410 | { | 3412 | { |
3411 | struct tty_struct *tty = (struct tty_struct *) private_; | 3413 | struct tty_struct *tty = |
3414 | container_of(work, struct tty_struct, buf.work.work); | ||
3412 | unsigned long flags; | 3415 | unsigned long flags; |
3413 | struct tty_ldisc *disc; | 3416 | struct tty_ldisc *disc; |
3414 | struct tty_buffer *tbuf, *head; | 3417 | struct tty_buffer *tbuf, *head; |
@@ -3553,7 +3556,7 @@ void tty_flip_buffer_push(struct tty_struct *tty) | |||
3553 | spin_unlock_irqrestore(&tty->buf.lock, flags); | 3556 | spin_unlock_irqrestore(&tty->buf.lock, flags); |
3554 | 3557 | ||
3555 | if (tty->low_latency) | 3558 | if (tty->low_latency) |
3556 | flush_to_ldisc((void *) tty); | 3559 | flush_to_ldisc(&tty->buf.work.work); |
3557 | else | 3560 | else |
3558 | schedule_delayed_work(&tty->buf.work, 1); | 3561 | schedule_delayed_work(&tty->buf.work, 1); |
3559 | } | 3562 | } |
@@ -3580,17 +3583,17 @@ static void initialize_tty_struct(struct tty_struct *tty) | |||
3580 | tty->overrun_time = jiffies; | 3583 | tty->overrun_time = jiffies; |
3581 | tty->buf.head = tty->buf.tail = NULL; | 3584 | tty->buf.head = tty->buf.tail = NULL; |
3582 | tty_buffer_init(tty); | 3585 | tty_buffer_init(tty); |
3583 | INIT_WORK(&tty->buf.work, flush_to_ldisc, tty); | 3586 | INIT_DELAYED_WORK(&tty->buf.work, flush_to_ldisc); |
3584 | init_MUTEX(&tty->buf.pty_sem); | 3587 | init_MUTEX(&tty->buf.pty_sem); |
3585 | mutex_init(&tty->termios_mutex); | 3588 | mutex_init(&tty->termios_mutex); |
3586 | init_waitqueue_head(&tty->write_wait); | 3589 | init_waitqueue_head(&tty->write_wait); |
3587 | init_waitqueue_head(&tty->read_wait); | 3590 | init_waitqueue_head(&tty->read_wait); |
3588 | INIT_WORK(&tty->hangup_work, do_tty_hangup, tty); | 3591 | INIT_WORK(&tty->hangup_work, do_tty_hangup); |
3589 | mutex_init(&tty->atomic_read_lock); | 3592 | mutex_init(&tty->atomic_read_lock); |
3590 | mutex_init(&tty->atomic_write_lock); | 3593 | mutex_init(&tty->atomic_write_lock); |
3591 | spin_lock_init(&tty->read_lock); | 3594 | spin_lock_init(&tty->read_lock); |
3592 | INIT_LIST_HEAD(&tty->tty_files); | 3595 | INIT_LIST_HEAD(&tty->tty_files); |
3593 | INIT_WORK(&tty->SAK_work, NULL, NULL); | 3596 | INIT_WORK(&tty->SAK_work, NULL); |
3594 | } | 3597 | } |
3595 | 3598 | ||
3596 | /* | 3599 | /* |
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 87587b4385ab..75ff0286e1ad 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
@@ -155,7 +155,7 @@ static void con_flush_chars(struct tty_struct *tty); | |||
155 | static void set_vesa_blanking(char __user *p); | 155 | static void set_vesa_blanking(char __user *p); |
156 | static void set_cursor(struct vc_data *vc); | 156 | static void set_cursor(struct vc_data *vc); |
157 | static void hide_cursor(struct vc_data *vc); | 157 | static void hide_cursor(struct vc_data *vc); |
158 | static void console_callback(void *ignored); | 158 | static void console_callback(struct work_struct *ignored); |
159 | static void blank_screen_t(unsigned long dummy); | 159 | static void blank_screen_t(unsigned long dummy); |
160 | static void set_palette(struct vc_data *vc); | 160 | static void set_palette(struct vc_data *vc); |
161 | 161 | ||
@@ -174,7 +174,7 @@ static int vesa_blank_mode; /* 0:none 1:suspendV 2:suspendH 3:powerdown */ | |||
174 | static int blankinterval = 10*60*HZ; | 174 | static int blankinterval = 10*60*HZ; |
175 | static int vesa_off_interval; | 175 | static int vesa_off_interval; |
176 | 176 | ||
177 | static DECLARE_WORK(console_work, console_callback, NULL); | 177 | static DECLARE_WORK(console_work, console_callback); |
178 | 178 | ||
179 | /* | 179 | /* |
180 | * fg_console is the current virtual console, | 180 | * fg_console is the current virtual console, |
@@ -2154,7 +2154,7 @@ out: | |||
2154 | * with other console code and prevention of re-entrancy is | 2154 | * with other console code and prevention of re-entrancy is |
2155 | * ensured with console_sem. | 2155 | * ensured with console_sem. |
2156 | */ | 2156 | */ |
2157 | static void console_callback(void *ignored) | 2157 | static void console_callback(struct work_struct *ignored) |
2158 | { | 2158 | { |
2159 | acquire_console_sem(); | 2159 | acquire_console_sem(); |
2160 | 2160 | ||
diff --git a/drivers/connector/cn_queue.c b/drivers/connector/cn_queue.c index 05f8ce2cfb4a..b418b16e910e 100644 --- a/drivers/connector/cn_queue.c +++ b/drivers/connector/cn_queue.c | |||
@@ -31,9 +31,11 @@ | |||
31 | #include <linux/connector.h> | 31 | #include <linux/connector.h> |
32 | #include <linux/delay.h> | 32 | #include <linux/delay.h> |
33 | 33 | ||
34 | void cn_queue_wrapper(void *data) | 34 | void cn_queue_wrapper(struct work_struct *work) |
35 | { | 35 | { |
36 | struct cn_callback_data *d = data; | 36 | struct cn_callback_entry *cbq = |
37 | container_of(work, struct cn_callback_entry, work.work); | ||
38 | struct cn_callback_data *d = &cbq->data; | ||
37 | 39 | ||
38 | d->callback(d->callback_priv); | 40 | d->callback(d->callback_priv); |
39 | 41 | ||
@@ -57,7 +59,7 @@ static struct cn_callback_entry *cn_queue_alloc_callback_entry(char *name, struc | |||
57 | memcpy(&cbq->id.id, id, sizeof(struct cb_id)); | 59 | memcpy(&cbq->id.id, id, sizeof(struct cb_id)); |
58 | cbq->data.callback = callback; | 60 | cbq->data.callback = callback; |
59 | 61 | ||
60 | INIT_WORK(&cbq->work, &cn_queue_wrapper, &cbq->data); | 62 | INIT_DELAYED_WORK(&cbq->work, &cn_queue_wrapper); |
61 | return cbq; | 63 | return cbq; |
62 | } | 64 | } |
63 | 65 | ||
diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c index b49bacfd8de8..5e7cd45d10ee 100644 --- a/drivers/connector/connector.c +++ b/drivers/connector/connector.c | |||
@@ -135,40 +135,39 @@ static int cn_call_callback(struct cn_msg *msg, void (*destruct_data)(void *), v | |||
135 | spin_lock_bh(&dev->cbdev->queue_lock); | 135 | spin_lock_bh(&dev->cbdev->queue_lock); |
136 | list_for_each_entry(__cbq, &dev->cbdev->queue_list, callback_entry) { | 136 | list_for_each_entry(__cbq, &dev->cbdev->queue_list, callback_entry) { |
137 | if (cn_cb_equal(&__cbq->id.id, &msg->id)) { | 137 | if (cn_cb_equal(&__cbq->id.id, &msg->id)) { |
138 | if (likely(!test_bit(0, &__cbq->work.pending) && | 138 | if (likely(!test_bit(WORK_STRUCT_PENDING, |
139 | &__cbq->work.work.management) && | ||
139 | __cbq->data.ddata == NULL)) { | 140 | __cbq->data.ddata == NULL)) { |
140 | __cbq->data.callback_priv = msg; | 141 | __cbq->data.callback_priv = msg; |
141 | 142 | ||
142 | __cbq->data.ddata = data; | 143 | __cbq->data.ddata = data; |
143 | __cbq->data.destruct_data = destruct_data; | 144 | __cbq->data.destruct_data = destruct_data; |
144 | 145 | ||
145 | if (queue_work(dev->cbdev->cn_queue, | 146 | if (queue_delayed_work( |
146 | &__cbq->work)) | 147 | dev->cbdev->cn_queue, |
148 | &__cbq->work, 0)) | ||
147 | err = 0; | 149 | err = 0; |
148 | } else { | 150 | } else { |
149 | struct work_struct *w; | ||
150 | struct cn_callback_data *d; | 151 | struct cn_callback_data *d; |
151 | 152 | ||
152 | w = kzalloc(sizeof(*w) + sizeof(*d), GFP_ATOMIC); | 153 | __cbq = kzalloc(sizeof(*__cbq), GFP_ATOMIC); |
153 | if (w) { | 154 | if (__cbq) { |
154 | d = (struct cn_callback_data *)(w+1); | 155 | d = &__cbq->data; |
155 | |||
156 | d->callback_priv = msg; | 156 | d->callback_priv = msg; |
157 | d->callback = __cbq->data.callback; | 157 | d->callback = __cbq->data.callback; |
158 | d->ddata = data; | 158 | d->ddata = data; |
159 | d->destruct_data = destruct_data; | 159 | d->destruct_data = destruct_data; |
160 | d->free = w; | 160 | d->free = __cbq; |
161 | 161 | ||
162 | INIT_LIST_HEAD(&w->entry); | 162 | INIT_DELAYED_WORK(&__cbq->work, |
163 | w->pending = 0; | 163 | &cn_queue_wrapper); |
164 | w->func = &cn_queue_wrapper; | ||
165 | w->data = d; | ||
166 | init_timer(&w->timer); | ||
167 | 164 | ||
168 | if (queue_work(dev->cbdev->cn_queue, w)) | 165 | if (queue_delayed_work( |
166 | dev->cbdev->cn_queue, | ||
167 | &__cbq->work, 0)) | ||
169 | err = 0; | 168 | err = 0; |
170 | else { | 169 | else { |
171 | kfree(w); | 170 | kfree(__cbq); |
172 | err = -EINVAL; | 171 | err = -EINVAL; |
173 | } | 172 | } |
174 | } else | 173 | } else |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index dd0c2623e27b..7a7c6e6dfe4f 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -42,7 +42,7 @@ static DEFINE_SPINLOCK(cpufreq_driver_lock); | |||
42 | 42 | ||
43 | /* internal prototypes */ | 43 | /* internal prototypes */ |
44 | static int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event); | 44 | static int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event); |
45 | static void handle_update(void *data); | 45 | static void handle_update(struct work_struct *work); |
46 | 46 | ||
47 | /** | 47 | /** |
48 | * Two notifier lists: the "policy" list is involved in the | 48 | * Two notifier lists: the "policy" list is involved in the |
@@ -665,7 +665,7 @@ static int cpufreq_add_dev (struct sys_device * sys_dev) | |||
665 | mutex_init(&policy->lock); | 665 | mutex_init(&policy->lock); |
666 | mutex_lock(&policy->lock); | 666 | mutex_lock(&policy->lock); |
667 | init_completion(&policy->kobj_unregister); | 667 | init_completion(&policy->kobj_unregister); |
668 | INIT_WORK(&policy->update, handle_update, (void *)(long)cpu); | 668 | INIT_WORK(&policy->update, handle_update); |
669 | 669 | ||
670 | /* call driver. From then on the cpufreq must be able | 670 | /* call driver. From then on the cpufreq must be able |
671 | * to accept all calls to ->verify and ->setpolicy for this CPU | 671 | * to accept all calls to ->verify and ->setpolicy for this CPU |
@@ -895,9 +895,11 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev) | |||
895 | } | 895 | } |
896 | 896 | ||
897 | 897 | ||
898 | static void handle_update(void *data) | 898 | static void handle_update(struct work_struct *work) |
899 | { | 899 | { |
900 | unsigned int cpu = (unsigned int)(long)data; | 900 | struct cpufreq_policy *policy = |
901 | container_of(work, struct cpufreq_policy, update); | ||
902 | unsigned int cpu = policy->cpu; | ||
901 | dprintk("handle_update for cpu %u called\n", cpu); | 903 | dprintk("handle_update for cpu %u called\n", cpu); |
902 | cpufreq_update_policy(cpu); | 904 | cpufreq_update_policy(cpu); |
903 | } | 905 | } |
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index c4c578defabf..5ef5ede5b884 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c | |||
@@ -59,7 +59,7 @@ static unsigned int def_sampling_rate; | |||
59 | #define MAX_SAMPLING_DOWN_FACTOR (10) | 59 | #define MAX_SAMPLING_DOWN_FACTOR (10) |
60 | #define TRANSITION_LATENCY_LIMIT (10 * 1000) | 60 | #define TRANSITION_LATENCY_LIMIT (10 * 1000) |
61 | 61 | ||
62 | static void do_dbs_timer(void *data); | 62 | static void do_dbs_timer(struct work_struct *work); |
63 | 63 | ||
64 | struct cpu_dbs_info_s { | 64 | struct cpu_dbs_info_s { |
65 | struct cpufreq_policy *cur_policy; | 65 | struct cpufreq_policy *cur_policy; |
@@ -82,7 +82,7 @@ static unsigned int dbs_enable; /* number of CPUs using this policy */ | |||
82 | * is recursive for the same process. -Venki | 82 | * is recursive for the same process. -Venki |
83 | */ | 83 | */ |
84 | static DEFINE_MUTEX (dbs_mutex); | 84 | static DEFINE_MUTEX (dbs_mutex); |
85 | static DECLARE_WORK (dbs_work, do_dbs_timer, NULL); | 85 | static DECLARE_DELAYED_WORK(dbs_work, do_dbs_timer); |
86 | 86 | ||
87 | struct dbs_tuners { | 87 | struct dbs_tuners { |
88 | unsigned int sampling_rate; | 88 | unsigned int sampling_rate; |
@@ -420,7 +420,7 @@ static void dbs_check_cpu(int cpu) | |||
420 | } | 420 | } |
421 | } | 421 | } |
422 | 422 | ||
423 | static void do_dbs_timer(void *data) | 423 | static void do_dbs_timer(struct work_struct *work) |
424 | { | 424 | { |
425 | int i; | 425 | int i; |
426 | lock_cpu_hotplug(); | 426 | lock_cpu_hotplug(); |
@@ -435,7 +435,6 @@ static void do_dbs_timer(void *data) | |||
435 | 435 | ||
436 | static inline void dbs_timer_init(void) | 436 | static inline void dbs_timer_init(void) |
437 | { | 437 | { |
438 | INIT_WORK(&dbs_work, do_dbs_timer, NULL); | ||
439 | schedule_delayed_work(&dbs_work, | 438 | schedule_delayed_work(&dbs_work, |
440 | usecs_to_jiffies(dbs_tuners_ins.sampling_rate)); | 439 | usecs_to_jiffies(dbs_tuners_ins.sampling_rate)); |
441 | return; | 440 | return; |
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index bf8aa45d4f01..e1cc5113c2ae 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c | |||
@@ -47,13 +47,17 @@ static unsigned int def_sampling_rate; | |||
47 | #define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER (1000) | 47 | #define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER (1000) |
48 | #define TRANSITION_LATENCY_LIMIT (10 * 1000) | 48 | #define TRANSITION_LATENCY_LIMIT (10 * 1000) |
49 | 49 | ||
50 | static void do_dbs_timer(void *data); | 50 | static void do_dbs_timer(struct work_struct *work); |
51 | |||
52 | /* Sampling types */ | ||
53 | enum dbs_sample {DBS_NORMAL_SAMPLE, DBS_SUB_SAMPLE}; | ||
51 | 54 | ||
52 | struct cpu_dbs_info_s { | 55 | struct cpu_dbs_info_s { |
53 | cputime64_t prev_cpu_idle; | 56 | cputime64_t prev_cpu_idle; |
54 | cputime64_t prev_cpu_wall; | 57 | cputime64_t prev_cpu_wall; |
55 | struct cpufreq_policy *cur_policy; | 58 | struct cpufreq_policy *cur_policy; |
56 | struct work_struct work; | 59 | struct delayed_work work; |
60 | enum dbs_sample sample_type; | ||
57 | unsigned int enable; | 61 | unsigned int enable; |
58 | struct cpufreq_frequency_table *freq_table; | 62 | struct cpufreq_frequency_table *freq_table; |
59 | unsigned int freq_lo; | 63 | unsigned int freq_lo; |
@@ -407,30 +411,31 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info) | |||
407 | } | 411 | } |
408 | } | 412 | } |
409 | 413 | ||
410 | /* Sampling types */ | 414 | static void do_dbs_timer(struct work_struct *work) |
411 | enum {DBS_NORMAL_SAMPLE, DBS_SUB_SAMPLE}; | ||
412 | |||
413 | static void do_dbs_timer(void *data) | ||
414 | { | 415 | { |
415 | unsigned int cpu = smp_processor_id(); | 416 | unsigned int cpu = smp_processor_id(); |
416 | struct cpu_dbs_info_s *dbs_info = &per_cpu(cpu_dbs_info, cpu); | 417 | struct cpu_dbs_info_s *dbs_info = &per_cpu(cpu_dbs_info, cpu); |
418 | enum dbs_sample sample_type = dbs_info->sample_type; | ||
417 | /* We want all CPUs to do sampling nearly on same jiffy */ | 419 | /* We want all CPUs to do sampling nearly on same jiffy */ |
418 | int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); | 420 | int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); |
421 | |||
422 | /* Permit rescheduling of this work item */ | ||
423 | work_release(work); | ||
424 | |||
419 | delay -= jiffies % delay; | 425 | delay -= jiffies % delay; |
420 | 426 | ||
421 | if (!dbs_info->enable) | 427 | if (!dbs_info->enable) |
422 | return; | 428 | return; |
423 | /* Common NORMAL_SAMPLE setup */ | 429 | /* Common NORMAL_SAMPLE setup */ |
424 | INIT_WORK(&dbs_info->work, do_dbs_timer, (void *)DBS_NORMAL_SAMPLE); | 430 | dbs_info->sample_type = DBS_NORMAL_SAMPLE; |
425 | if (!dbs_tuners_ins.powersave_bias || | 431 | if (!dbs_tuners_ins.powersave_bias || |
426 | (unsigned long) data == DBS_NORMAL_SAMPLE) { | 432 | sample_type == DBS_NORMAL_SAMPLE) { |
427 | lock_cpu_hotplug(); | 433 | lock_cpu_hotplug(); |
428 | dbs_check_cpu(dbs_info); | 434 | dbs_check_cpu(dbs_info); |
429 | unlock_cpu_hotplug(); | 435 | unlock_cpu_hotplug(); |
430 | if (dbs_info->freq_lo) { | 436 | if (dbs_info->freq_lo) { |
431 | /* Setup timer for SUB_SAMPLE */ | 437 | /* Setup timer for SUB_SAMPLE */ |
432 | INIT_WORK(&dbs_info->work, do_dbs_timer, | 438 | dbs_info->sample_type = DBS_SUB_SAMPLE; |
433 | (void *)DBS_SUB_SAMPLE); | ||
434 | delay = dbs_info->freq_hi_jiffies; | 439 | delay = dbs_info->freq_hi_jiffies; |
435 | } | 440 | } |
436 | } else { | 441 | } else { |
@@ -449,7 +454,8 @@ static inline void dbs_timer_init(unsigned int cpu) | |||
449 | delay -= jiffies % delay; | 454 | delay -= jiffies % delay; |
450 | 455 | ||
451 | ondemand_powersave_bias_init(); | 456 | ondemand_powersave_bias_init(); |
452 | INIT_WORK(&dbs_info->work, do_dbs_timer, NULL); | 457 | INIT_DELAYED_WORK_NAR(&dbs_info->work, do_dbs_timer); |
458 | dbs_info->sample_type = DBS_NORMAL_SAMPLE; | ||
453 | queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work, delay); | 459 | queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work, delay); |
454 | } | 460 | } |
455 | 461 | ||
diff --git a/drivers/i2c/chips/ds1374.c b/drivers/i2c/chips/ds1374.c index 4630f1969a09..15edf40828b4 100644 --- a/drivers/i2c/chips/ds1374.c +++ b/drivers/i2c/chips/ds1374.c | |||
@@ -140,12 +140,14 @@ ulong ds1374_get_rtc_time(void) | |||
140 | return t1; | 140 | return t1; |
141 | } | 141 | } |
142 | 142 | ||
143 | static void ds1374_set_work(void *arg) | 143 | static ulong new_time; |
144 | |||
145 | static void ds1374_set_work(struct work_struct *work) | ||
144 | { | 146 | { |
145 | ulong t1, t2; | 147 | ulong t1, t2; |
146 | int limit = 10; /* arbitrary retry limit */ | 148 | int limit = 10; /* arbitrary retry limit */ |
147 | 149 | ||
148 | t1 = *(ulong *) arg; | 150 | t1 = new_time; |
149 | 151 | ||
150 | mutex_lock(&ds1374_mutex); | 152 | mutex_lock(&ds1374_mutex); |
151 | 153 | ||
@@ -167,11 +169,9 @@ static void ds1374_set_work(void *arg) | |||
167 | "can't confirm time set from rtc chip\n"); | 169 | "can't confirm time set from rtc chip\n"); |
168 | } | 170 | } |
169 | 171 | ||
170 | static ulong new_time; | ||
171 | |||
172 | static struct workqueue_struct *ds1374_workqueue; | 172 | static struct workqueue_struct *ds1374_workqueue; |
173 | 173 | ||
174 | static DECLARE_WORK(ds1374_work, ds1374_set_work, &new_time); | 174 | static DECLARE_WORK(ds1374_work, ds1374_set_work); |
175 | 175 | ||
176 | int ds1374_set_rtc_time(ulong nowtime) | 176 | int ds1374_set_rtc_time(ulong nowtime) |
177 | { | 177 | { |
@@ -180,7 +180,7 @@ int ds1374_set_rtc_time(ulong nowtime) | |||
180 | if (in_interrupt()) | 180 | if (in_interrupt()) |
181 | queue_work(ds1374_workqueue, &ds1374_work); | 181 | queue_work(ds1374_workqueue, &ds1374_work); |
182 | else | 182 | else |
183 | ds1374_set_work(&new_time); | 183 | ds1374_set_work(NULL); |
184 | 184 | ||
185 | return 0; | 185 | return 0; |
186 | } | 186 | } |
diff --git a/drivers/ieee1394/hosts.c b/drivers/ieee1394/hosts.c index d90a3a1898c0..8f4378a1631c 100644 --- a/drivers/ieee1394/hosts.c +++ b/drivers/ieee1394/hosts.c | |||
@@ -31,9 +31,10 @@ | |||
31 | #include "config_roms.h" | 31 | #include "config_roms.h" |
32 | 32 | ||
33 | 33 | ||
34 | static void delayed_reset_bus(void * __reset_info) | 34 | static void delayed_reset_bus(struct work_struct *work) |
35 | { | 35 | { |
36 | struct hpsb_host *host = (struct hpsb_host*)__reset_info; | 36 | struct hpsb_host *host = |
37 | container_of(work, struct hpsb_host, delayed_reset.work); | ||
37 | int generation = host->csr.generation + 1; | 38 | int generation = host->csr.generation + 1; |
38 | 39 | ||
39 | /* The generation field rolls over to 2 rather than 0 per IEEE | 40 | /* The generation field rolls over to 2 rather than 0 per IEEE |
@@ -145,7 +146,7 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, | |||
145 | 146 | ||
146 | atomic_set(&h->generation, 0); | 147 | atomic_set(&h->generation, 0); |
147 | 148 | ||
148 | INIT_WORK(&h->delayed_reset, delayed_reset_bus, h); | 149 | INIT_DELAYED_WORK(&h->delayed_reset, delayed_reset_bus); |
149 | 150 | ||
150 | init_timer(&h->timeout); | 151 | init_timer(&h->timeout); |
151 | h->timeout.data = (unsigned long) h; | 152 | h->timeout.data = (unsigned long) h; |
@@ -234,7 +235,7 @@ int hpsb_update_config_rom_image(struct hpsb_host *host) | |||
234 | * Config ROM in the near future. */ | 235 | * Config ROM in the near future. */ |
235 | reset_delay = HZ; | 236 | reset_delay = HZ; |
236 | 237 | ||
237 | PREPARE_WORK(&host->delayed_reset, delayed_reset_bus, host); | 238 | PREPARE_DELAYED_WORK(&host->delayed_reset, delayed_reset_bus); |
238 | schedule_delayed_work(&host->delayed_reset, reset_delay); | 239 | schedule_delayed_work(&host->delayed_reset, reset_delay); |
239 | 240 | ||
240 | return 0; | 241 | return 0; |
diff --git a/drivers/ieee1394/hosts.h b/drivers/ieee1394/hosts.h index bc6dbfadb891..d553e38c9543 100644 --- a/drivers/ieee1394/hosts.h +++ b/drivers/ieee1394/hosts.h | |||
@@ -62,7 +62,7 @@ struct hpsb_host { | |||
62 | struct class_device class_dev; | 62 | struct class_device class_dev; |
63 | 63 | ||
64 | int update_config_rom; | 64 | int update_config_rom; |
65 | struct work_struct delayed_reset; | 65 | struct delayed_work delayed_reset; |
66 | unsigned int config_roms; | 66 | unsigned int config_roms; |
67 | 67 | ||
68 | struct list_head addr_space; | 68 | struct list_head addr_space; |
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index 6986ac188281..cd156d4e779e 100644 --- a/drivers/ieee1394/sbp2.c +++ b/drivers/ieee1394/sbp2.c | |||
@@ -493,20 +493,25 @@ static void sbp2util_notify_fetch_agent(struct scsi_id_instance_data *scsi_id, | |||
493 | scsi_unblock_requests(scsi_id->scsi_host); | 493 | scsi_unblock_requests(scsi_id->scsi_host); |
494 | } | 494 | } |
495 | 495 | ||
496 | static void sbp2util_write_orb_pointer(void *p) | 496 | static void sbp2util_write_orb_pointer(struct work_struct *work) |
497 | { | 497 | { |
498 | struct scsi_id_instance_data *scsi_id = | ||
499 | container_of(work, struct scsi_id_instance_data, | ||
500 | protocol_work.work); | ||
498 | quadlet_t data[2]; | 501 | quadlet_t data[2]; |
499 | 502 | ||
500 | data[0] = ORB_SET_NODE_ID( | 503 | data[0] = ORB_SET_NODE_ID(scsi_id->hi->host->node_id); |
501 | ((struct scsi_id_instance_data *)p)->hi->host->node_id); | 504 | data[1] = scsi_id->last_orb_dma; |
502 | data[1] = ((struct scsi_id_instance_data *)p)->last_orb_dma; | ||
503 | sbp2util_cpu_to_be32_buffer(data, 8); | 505 | sbp2util_cpu_to_be32_buffer(data, 8); |
504 | sbp2util_notify_fetch_agent(p, SBP2_ORB_POINTER_OFFSET, data, 8); | 506 | sbp2util_notify_fetch_agent(scsi_id, SBP2_ORB_POINTER_OFFSET, data, 8); |
505 | } | 507 | } |
506 | 508 | ||
507 | static void sbp2util_write_doorbell(void *p) | 509 | static void sbp2util_write_doorbell(struct work_struct *work) |
508 | { | 510 | { |
509 | sbp2util_notify_fetch_agent(p, SBP2_DOORBELL_OFFSET, NULL, 4); | 511 | struct scsi_id_instance_data *scsi_id = |
512 | container_of(work, struct scsi_id_instance_data, | ||
513 | protocol_work.work); | ||
514 | sbp2util_notify_fetch_agent(scsi_id, SBP2_DOORBELL_OFFSET, NULL, 4); | ||
510 | } | 515 | } |
511 | 516 | ||
512 | /* | 517 | /* |
@@ -843,7 +848,7 @@ static struct scsi_id_instance_data *sbp2_alloc_device(struct unit_directory *ud | |||
843 | INIT_LIST_HEAD(&scsi_id->scsi_list); | 848 | INIT_LIST_HEAD(&scsi_id->scsi_list); |
844 | spin_lock_init(&scsi_id->sbp2_command_orb_lock); | 849 | spin_lock_init(&scsi_id->sbp2_command_orb_lock); |
845 | atomic_set(&scsi_id->state, SBP2LU_STATE_RUNNING); | 850 | atomic_set(&scsi_id->state, SBP2LU_STATE_RUNNING); |
846 | INIT_WORK(&scsi_id->protocol_work, NULL, NULL); | 851 | INIT_DELAYED_WORK(&scsi_id->protocol_work, NULL); |
847 | 852 | ||
848 | ud->device.driver_data = scsi_id; | 853 | ud->device.driver_data = scsi_id; |
849 | 854 | ||
@@ -2047,11 +2052,10 @@ static void sbp2_link_orb_command(struct scsi_id_instance_data *scsi_id, | |||
2047 | * We do not accept new commands until the job is over. | 2052 | * We do not accept new commands until the job is over. |
2048 | */ | 2053 | */ |
2049 | scsi_block_requests(scsi_id->scsi_host); | 2054 | scsi_block_requests(scsi_id->scsi_host); |
2050 | PREPARE_WORK(&scsi_id->protocol_work, | 2055 | PREPARE_DELAYED_WORK(&scsi_id->protocol_work, |
2051 | last_orb ? sbp2util_write_doorbell: | 2056 | last_orb ? sbp2util_write_doorbell: |
2052 | sbp2util_write_orb_pointer, | 2057 | sbp2util_write_orb_pointer); |
2053 | scsi_id); | 2058 | schedule_delayed_work(&scsi_id->protocol_work, 0); |
2054 | schedule_work(&scsi_id->protocol_work); | ||
2055 | } | 2059 | } |
2056 | } | 2060 | } |
2057 | 2061 | ||
diff --git a/drivers/ieee1394/sbp2.h b/drivers/ieee1394/sbp2.h index abbe48e646c3..1b16d6b9cf11 100644 --- a/drivers/ieee1394/sbp2.h +++ b/drivers/ieee1394/sbp2.h | |||
@@ -348,7 +348,7 @@ struct scsi_id_instance_data { | |||
348 | unsigned workarounds; | 348 | unsigned workarounds; |
349 | 349 | ||
350 | atomic_t state; | 350 | atomic_t state; |
351 | struct work_struct protocol_work; | 351 | struct delayed_work protocol_work; |
352 | }; | 352 | }; |
353 | 353 | ||
354 | /* For use in scsi_id_instance_data.state */ | 354 | /* For use in scsi_id_instance_data.state */ |
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c index 7767a11b6890..af939796750d 100644 --- a/drivers/infiniband/core/addr.c +++ b/drivers/infiniband/core/addr.c | |||
@@ -55,11 +55,11 @@ struct addr_req { | |||
55 | int status; | 55 | int status; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | static void process_req(void *data); | 58 | static void process_req(struct work_struct *work); |
59 | 59 | ||
60 | static DEFINE_MUTEX(lock); | 60 | static DEFINE_MUTEX(lock); |
61 | static LIST_HEAD(req_list); | 61 | static LIST_HEAD(req_list); |
62 | static DECLARE_WORK(work, process_req, NULL); | 62 | static DECLARE_DELAYED_WORK(work, process_req); |
63 | static struct workqueue_struct *addr_wq; | 63 | static struct workqueue_struct *addr_wq; |
64 | 64 | ||
65 | void rdma_addr_register_client(struct rdma_addr_client *client) | 65 | void rdma_addr_register_client(struct rdma_addr_client *client) |
@@ -215,7 +215,7 @@ out: | |||
215 | return ret; | 215 | return ret; |
216 | } | 216 | } |
217 | 217 | ||
218 | static void process_req(void *data) | 218 | static void process_req(struct work_struct *work) |
219 | { | 219 | { |
220 | struct addr_req *req, *temp_req; | 220 | struct addr_req *req, *temp_req; |
221 | struct sockaddr_in *src_in, *dst_in; | 221 | struct sockaddr_in *src_in, *dst_in; |
diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c index 20e9f64e67a6..98272fbbfb31 100644 --- a/drivers/infiniband/core/cache.c +++ b/drivers/infiniband/core/cache.c | |||
@@ -285,9 +285,10 @@ err: | |||
285 | kfree(tprops); | 285 | kfree(tprops); |
286 | } | 286 | } |
287 | 287 | ||
288 | static void ib_cache_task(void *work_ptr) | 288 | static void ib_cache_task(struct work_struct *_work) |
289 | { | 289 | { |
290 | struct ib_update_work *work = work_ptr; | 290 | struct ib_update_work *work = |
291 | container_of(_work, struct ib_update_work, work); | ||
291 | 292 | ||
292 | ib_cache_update(work->device, work->port_num); | 293 | ib_cache_update(work->device, work->port_num); |
293 | kfree(work); | 294 | kfree(work); |
@@ -306,7 +307,7 @@ static void ib_cache_event(struct ib_event_handler *handler, | |||
306 | event->event == IB_EVENT_CLIENT_REREGISTER) { | 307 | event->event == IB_EVENT_CLIENT_REREGISTER) { |
307 | work = kmalloc(sizeof *work, GFP_ATOMIC); | 308 | work = kmalloc(sizeof *work, GFP_ATOMIC); |
308 | if (work) { | 309 | if (work) { |
309 | INIT_WORK(&work->work, ib_cache_task, work); | 310 | INIT_WORK(&work->work, ib_cache_task); |
310 | work->device = event->device; | 311 | work->device = event->device; |
311 | work->port_num = event->element.port_num; | 312 | work->port_num = event->element.port_num; |
312 | schedule_work(&work->work); | 313 | schedule_work(&work->work); |
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index e5dc4530808a..79c937bf6962 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c | |||
@@ -101,7 +101,7 @@ struct cm_av { | |||
101 | }; | 101 | }; |
102 | 102 | ||
103 | struct cm_work { | 103 | struct cm_work { |
104 | struct work_struct work; | 104 | struct delayed_work work; |
105 | struct list_head list; | 105 | struct list_head list; |
106 | struct cm_port *port; | 106 | struct cm_port *port; |
107 | struct ib_mad_recv_wc *mad_recv_wc; /* Received MADs */ | 107 | struct ib_mad_recv_wc *mad_recv_wc; /* Received MADs */ |
@@ -161,7 +161,7 @@ struct cm_id_private { | |||
161 | atomic_t work_count; | 161 | atomic_t work_count; |
162 | }; | 162 | }; |
163 | 163 | ||
164 | static void cm_work_handler(void *data); | 164 | static void cm_work_handler(struct work_struct *work); |
165 | 165 | ||
166 | static inline void cm_deref_id(struct cm_id_private *cm_id_priv) | 166 | static inline void cm_deref_id(struct cm_id_private *cm_id_priv) |
167 | { | 167 | { |
@@ -668,8 +668,7 @@ static struct cm_timewait_info * cm_create_timewait_info(__be32 local_id) | |||
668 | return ERR_PTR(-ENOMEM); | 668 | return ERR_PTR(-ENOMEM); |
669 | 669 | ||
670 | timewait_info->work.local_id = local_id; | 670 | timewait_info->work.local_id = local_id; |
671 | INIT_WORK(&timewait_info->work.work, cm_work_handler, | 671 | INIT_DELAYED_WORK(&timewait_info->work.work, cm_work_handler); |
672 | &timewait_info->work); | ||
673 | timewait_info->work.cm_event.event = IB_CM_TIMEWAIT_EXIT; | 672 | timewait_info->work.cm_event.event = IB_CM_TIMEWAIT_EXIT; |
674 | return timewait_info; | 673 | return timewait_info; |
675 | } | 674 | } |
@@ -2995,9 +2994,9 @@ static void cm_send_handler(struct ib_mad_agent *mad_agent, | |||
2995 | } | 2994 | } |
2996 | } | 2995 | } |
2997 | 2996 | ||
2998 | static void cm_work_handler(void *data) | 2997 | static void cm_work_handler(struct work_struct *_work) |
2999 | { | 2998 | { |
3000 | struct cm_work *work = data; | 2999 | struct cm_work *work = container_of(_work, struct cm_work, work.work); |
3001 | int ret; | 3000 | int ret; |
3002 | 3001 | ||
3003 | switch (work->cm_event.event) { | 3002 | switch (work->cm_event.event) { |
@@ -3087,12 +3086,12 @@ static int cm_establish(struct ib_cm_id *cm_id) | |||
3087 | * we need to find the cm_id once we're in the context of the | 3086 | * we need to find the cm_id once we're in the context of the |
3088 | * worker thread, rather than holding a reference on it. | 3087 | * worker thread, rather than holding a reference on it. |
3089 | */ | 3088 | */ |
3090 | INIT_WORK(&work->work, cm_work_handler, work); | 3089 | INIT_DELAYED_WORK(&work->work, cm_work_handler); |
3091 | work->local_id = cm_id->local_id; | 3090 | work->local_id = cm_id->local_id; |
3092 | work->remote_id = cm_id->remote_id; | 3091 | work->remote_id = cm_id->remote_id; |
3093 | work->mad_recv_wc = NULL; | 3092 | work->mad_recv_wc = NULL; |
3094 | work->cm_event.event = IB_CM_USER_ESTABLISHED; | 3093 | work->cm_event.event = IB_CM_USER_ESTABLISHED; |
3095 | queue_work(cm.wq, &work->work); | 3094 | queue_delayed_work(cm.wq, &work->work, 0); |
3096 | out: | 3095 | out: |
3097 | return ret; | 3096 | return ret; |
3098 | } | 3097 | } |
@@ -3191,11 +3190,11 @@ static void cm_recv_handler(struct ib_mad_agent *mad_agent, | |||
3191 | return; | 3190 | return; |
3192 | } | 3191 | } |
3193 | 3192 | ||
3194 | INIT_WORK(&work->work, cm_work_handler, work); | 3193 | INIT_DELAYED_WORK(&work->work, cm_work_handler); |
3195 | work->cm_event.event = event; | 3194 | work->cm_event.event = event; |
3196 | work->mad_recv_wc = mad_recv_wc; | 3195 | work->mad_recv_wc = mad_recv_wc; |
3197 | work->port = (struct cm_port *)mad_agent->context; | 3196 | work->port = (struct cm_port *)mad_agent->context; |
3198 | queue_work(cm.wq, &work->work); | 3197 | queue_delayed_work(cm.wq, &work->work, 0); |
3199 | } | 3198 | } |
3200 | 3199 | ||
3201 | static int cm_init_qp_init_attr(struct cm_id_private *cm_id_priv, | 3200 | static int cm_init_qp_init_attr(struct cm_id_private *cm_id_priv, |
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index cf48f2697434..985a6b564d8f 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c | |||
@@ -1340,9 +1340,9 @@ static int cma_query_ib_route(struct rdma_id_private *id_priv, int timeout_ms, | |||
1340 | return (id_priv->query_id < 0) ? id_priv->query_id : 0; | 1340 | return (id_priv->query_id < 0) ? id_priv->query_id : 0; |
1341 | } | 1341 | } |
1342 | 1342 | ||
1343 | static void cma_work_handler(void *data) | 1343 | static void cma_work_handler(struct work_struct *_work) |
1344 | { | 1344 | { |
1345 | struct cma_work *work = data; | 1345 | struct cma_work *work = container_of(_work, struct cma_work, work); |
1346 | struct rdma_id_private *id_priv = work->id; | 1346 | struct rdma_id_private *id_priv = work->id; |
1347 | int destroy = 0; | 1347 | int destroy = 0; |
1348 | 1348 | ||
@@ -1373,7 +1373,7 @@ static int cma_resolve_ib_route(struct rdma_id_private *id_priv, int timeout_ms) | |||
1373 | return -ENOMEM; | 1373 | return -ENOMEM; |
1374 | 1374 | ||
1375 | work->id = id_priv; | 1375 | work->id = id_priv; |
1376 | INIT_WORK(&work->work, cma_work_handler, work); | 1376 | INIT_WORK(&work->work, cma_work_handler); |
1377 | work->old_state = CMA_ROUTE_QUERY; | 1377 | work->old_state = CMA_ROUTE_QUERY; |
1378 | work->new_state = CMA_ROUTE_RESOLVED; | 1378 | work->new_state = CMA_ROUTE_RESOLVED; |
1379 | work->event.event = RDMA_CM_EVENT_ROUTE_RESOLVED; | 1379 | work->event.event = RDMA_CM_EVENT_ROUTE_RESOLVED; |
@@ -1430,7 +1430,7 @@ static int cma_resolve_iw_route(struct rdma_id_private *id_priv, int timeout_ms) | |||
1430 | return -ENOMEM; | 1430 | return -ENOMEM; |
1431 | 1431 | ||
1432 | work->id = id_priv; | 1432 | work->id = id_priv; |
1433 | INIT_WORK(&work->work, cma_work_handler, work); | 1433 | INIT_WORK(&work->work, cma_work_handler); |
1434 | work->old_state = CMA_ROUTE_QUERY; | 1434 | work->old_state = CMA_ROUTE_QUERY; |
1435 | work->new_state = CMA_ROUTE_RESOLVED; | 1435 | work->new_state = CMA_ROUTE_RESOLVED; |
1436 | work->event.event = RDMA_CM_EVENT_ROUTE_RESOLVED; | 1436 | work->event.event = RDMA_CM_EVENT_ROUTE_RESOLVED; |
@@ -1583,7 +1583,7 @@ static int cma_resolve_loopback(struct rdma_id_private *id_priv) | |||
1583 | } | 1583 | } |
1584 | 1584 | ||
1585 | work->id = id_priv; | 1585 | work->id = id_priv; |
1586 | INIT_WORK(&work->work, cma_work_handler, work); | 1586 | INIT_WORK(&work->work, cma_work_handler); |
1587 | work->old_state = CMA_ADDR_QUERY; | 1587 | work->old_state = CMA_ADDR_QUERY; |
1588 | work->new_state = CMA_ADDR_RESOLVED; | 1588 | work->new_state = CMA_ADDR_RESOLVED; |
1589 | work->event.event = RDMA_CM_EVENT_ADDR_RESOLVED; | 1589 | work->event.event = RDMA_CM_EVENT_ADDR_RESOLVED; |
diff --git a/drivers/infiniband/core/iwcm.c b/drivers/infiniband/core/iwcm.c index cf797d7aea09..1039ad57d53b 100644 --- a/drivers/infiniband/core/iwcm.c +++ b/drivers/infiniband/core/iwcm.c | |||
@@ -828,9 +828,9 @@ static int process_event(struct iwcm_id_private *cm_id_priv, | |||
828 | * thread asleep on the destroy_comp list vs. an object destroyed | 828 | * thread asleep on the destroy_comp list vs. an object destroyed |
829 | * here synchronously when the last reference is removed. | 829 | * here synchronously when the last reference is removed. |
830 | */ | 830 | */ |
831 | static void cm_work_handler(void *arg) | 831 | static void cm_work_handler(struct work_struct *_work) |
832 | { | 832 | { |
833 | struct iwcm_work *work = arg; | 833 | struct iwcm_work *work = container_of(_work, struct iwcm_work, work); |
834 | struct iw_cm_event levent; | 834 | struct iw_cm_event levent; |
835 | struct iwcm_id_private *cm_id_priv = work->cm_id; | 835 | struct iwcm_id_private *cm_id_priv = work->cm_id; |
836 | unsigned long flags; | 836 | unsigned long flags; |
@@ -900,7 +900,7 @@ static int cm_event_handler(struct iw_cm_id *cm_id, | |||
900 | goto out; | 900 | goto out; |
901 | } | 901 | } |
902 | 902 | ||
903 | INIT_WORK(&work->work, cm_work_handler, work); | 903 | INIT_WORK(&work->work, cm_work_handler); |
904 | work->cm_id = cm_id_priv; | 904 | work->cm_id = cm_id_priv; |
905 | work->event = *iw_event; | 905 | work->event = *iw_event; |
906 | 906 | ||
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c index 3f9c16232c4d..15f38d94b3a8 100644 --- a/drivers/infiniband/core/mad.c +++ b/drivers/infiniband/core/mad.c | |||
@@ -65,8 +65,8 @@ static struct ib_mad_agent_private *find_mad_agent( | |||
65 | static int ib_mad_post_receive_mads(struct ib_mad_qp_info *qp_info, | 65 | static int ib_mad_post_receive_mads(struct ib_mad_qp_info *qp_info, |
66 | struct ib_mad_private *mad); | 66 | struct ib_mad_private *mad); |
67 | static void cancel_mads(struct ib_mad_agent_private *mad_agent_priv); | 67 | static void cancel_mads(struct ib_mad_agent_private *mad_agent_priv); |
68 | static void timeout_sends(void *data); | 68 | static void timeout_sends(struct work_struct *work); |
69 | static void local_completions(void *data); | 69 | static void local_completions(struct work_struct *work); |
70 | static int add_nonoui_reg_req(struct ib_mad_reg_req *mad_reg_req, | 70 | static int add_nonoui_reg_req(struct ib_mad_reg_req *mad_reg_req, |
71 | struct ib_mad_agent_private *agent_priv, | 71 | struct ib_mad_agent_private *agent_priv, |
72 | u8 mgmt_class); | 72 | u8 mgmt_class); |
@@ -356,10 +356,9 @@ struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device, | |||
356 | INIT_LIST_HEAD(&mad_agent_priv->wait_list); | 356 | INIT_LIST_HEAD(&mad_agent_priv->wait_list); |
357 | INIT_LIST_HEAD(&mad_agent_priv->done_list); | 357 | INIT_LIST_HEAD(&mad_agent_priv->done_list); |
358 | INIT_LIST_HEAD(&mad_agent_priv->rmpp_list); | 358 | INIT_LIST_HEAD(&mad_agent_priv->rmpp_list); |
359 | INIT_WORK(&mad_agent_priv->timed_work, timeout_sends, mad_agent_priv); | 359 | INIT_DELAYED_WORK(&mad_agent_priv->timed_work, timeout_sends); |
360 | INIT_LIST_HEAD(&mad_agent_priv->local_list); | 360 | INIT_LIST_HEAD(&mad_agent_priv->local_list); |
361 | INIT_WORK(&mad_agent_priv->local_work, local_completions, | 361 | INIT_WORK(&mad_agent_priv->local_work, local_completions); |
362 | mad_agent_priv); | ||
363 | atomic_set(&mad_agent_priv->refcount, 1); | 362 | atomic_set(&mad_agent_priv->refcount, 1); |
364 | init_completion(&mad_agent_priv->comp); | 363 | init_completion(&mad_agent_priv->comp); |
365 | 364 | ||
@@ -2198,12 +2197,12 @@ static void mad_error_handler(struct ib_mad_port_private *port_priv, | |||
2198 | /* | 2197 | /* |
2199 | * IB MAD completion callback | 2198 | * IB MAD completion callback |
2200 | */ | 2199 | */ |
2201 | static void ib_mad_completion_handler(void *data) | 2200 | static void ib_mad_completion_handler(struct work_struct *work) |
2202 | { | 2201 | { |
2203 | struct ib_mad_port_private *port_priv; | 2202 | struct ib_mad_port_private *port_priv; |
2204 | struct ib_wc wc; | 2203 | struct ib_wc wc; |
2205 | 2204 | ||
2206 | port_priv = (struct ib_mad_port_private *)data; | 2205 | port_priv = container_of(work, struct ib_mad_port_private, work); |
2207 | ib_req_notify_cq(port_priv->cq, IB_CQ_NEXT_COMP); | 2206 | ib_req_notify_cq(port_priv->cq, IB_CQ_NEXT_COMP); |
2208 | 2207 | ||
2209 | while (ib_poll_cq(port_priv->cq, 1, &wc) == 1) { | 2208 | while (ib_poll_cq(port_priv->cq, 1, &wc) == 1) { |
@@ -2324,7 +2323,7 @@ void ib_cancel_mad(struct ib_mad_agent *mad_agent, | |||
2324 | } | 2323 | } |
2325 | EXPORT_SYMBOL(ib_cancel_mad); | 2324 | EXPORT_SYMBOL(ib_cancel_mad); |
2326 | 2325 | ||
2327 | static void local_completions(void *data) | 2326 | static void local_completions(struct work_struct *work) |
2328 | { | 2327 | { |
2329 | struct ib_mad_agent_private *mad_agent_priv; | 2328 | struct ib_mad_agent_private *mad_agent_priv; |
2330 | struct ib_mad_local_private *local; | 2329 | struct ib_mad_local_private *local; |
@@ -2334,7 +2333,8 @@ static void local_completions(void *data) | |||
2334 | struct ib_wc wc; | 2333 | struct ib_wc wc; |
2335 | struct ib_mad_send_wc mad_send_wc; | 2334 | struct ib_mad_send_wc mad_send_wc; |
2336 | 2335 | ||
2337 | mad_agent_priv = (struct ib_mad_agent_private *)data; | 2336 | mad_agent_priv = |
2337 | container_of(work, struct ib_mad_agent_private, local_work); | ||
2338 | 2338 | ||
2339 | spin_lock_irqsave(&mad_agent_priv->lock, flags); | 2339 | spin_lock_irqsave(&mad_agent_priv->lock, flags); |
2340 | while (!list_empty(&mad_agent_priv->local_list)) { | 2340 | while (!list_empty(&mad_agent_priv->local_list)) { |
@@ -2434,14 +2434,15 @@ static int retry_send(struct ib_mad_send_wr_private *mad_send_wr) | |||
2434 | return ret; | 2434 | return ret; |
2435 | } | 2435 | } |
2436 | 2436 | ||
2437 | static void timeout_sends(void *data) | 2437 | static void timeout_sends(struct work_struct *work) |
2438 | { | 2438 | { |
2439 | struct ib_mad_agent_private *mad_agent_priv; | 2439 | struct ib_mad_agent_private *mad_agent_priv; |
2440 | struct ib_mad_send_wr_private *mad_send_wr; | 2440 | struct ib_mad_send_wr_private *mad_send_wr; |
2441 | struct ib_mad_send_wc mad_send_wc; | 2441 | struct ib_mad_send_wc mad_send_wc; |
2442 | unsigned long flags, delay; | 2442 | unsigned long flags, delay; |
2443 | 2443 | ||
2444 | mad_agent_priv = (struct ib_mad_agent_private *)data; | 2444 | mad_agent_priv = container_of(work, struct ib_mad_agent_private, |
2445 | timed_work.work); | ||
2445 | mad_send_wc.vendor_err = 0; | 2446 | mad_send_wc.vendor_err = 0; |
2446 | 2447 | ||
2447 | spin_lock_irqsave(&mad_agent_priv->lock, flags); | 2448 | spin_lock_irqsave(&mad_agent_priv->lock, flags); |
@@ -2799,7 +2800,7 @@ static int ib_mad_port_open(struct ib_device *device, | |||
2799 | ret = -ENOMEM; | 2800 | ret = -ENOMEM; |
2800 | goto error8; | 2801 | goto error8; |
2801 | } | 2802 | } |
2802 | INIT_WORK(&port_priv->work, ib_mad_completion_handler, port_priv); | 2803 | INIT_WORK(&port_priv->work, ib_mad_completion_handler); |
2803 | 2804 | ||
2804 | spin_lock_irqsave(&ib_mad_port_list_lock, flags); | 2805 | spin_lock_irqsave(&ib_mad_port_list_lock, flags); |
2805 | list_add_tail(&port_priv->port_list, &ib_mad_port_list); | 2806 | list_add_tail(&port_priv->port_list, &ib_mad_port_list); |
diff --git a/drivers/infiniband/core/mad_priv.h b/drivers/infiniband/core/mad_priv.h index d06b59083f6e..d5548e73e068 100644 --- a/drivers/infiniband/core/mad_priv.h +++ b/drivers/infiniband/core/mad_priv.h | |||
@@ -102,7 +102,7 @@ struct ib_mad_agent_private { | |||
102 | struct list_head send_list; | 102 | struct list_head send_list; |
103 | struct list_head wait_list; | 103 | struct list_head wait_list; |
104 | struct list_head done_list; | 104 | struct list_head done_list; |
105 | struct work_struct timed_work; | 105 | struct delayed_work timed_work; |
106 | unsigned long timeout; | 106 | unsigned long timeout; |
107 | struct list_head local_list; | 107 | struct list_head local_list; |
108 | struct work_struct local_work; | 108 | struct work_struct local_work; |
diff --git a/drivers/infiniband/core/mad_rmpp.c b/drivers/infiniband/core/mad_rmpp.c index 1ef79d015a1e..3663fd7022be 100644 --- a/drivers/infiniband/core/mad_rmpp.c +++ b/drivers/infiniband/core/mad_rmpp.c | |||
@@ -45,8 +45,8 @@ enum rmpp_state { | |||
45 | struct mad_rmpp_recv { | 45 | struct mad_rmpp_recv { |
46 | struct ib_mad_agent_private *agent; | 46 | struct ib_mad_agent_private *agent; |
47 | struct list_head list; | 47 | struct list_head list; |
48 | struct work_struct timeout_work; | 48 | struct delayed_work timeout_work; |
49 | struct work_struct cleanup_work; | 49 | struct delayed_work cleanup_work; |
50 | struct completion comp; | 50 | struct completion comp; |
51 | enum rmpp_state state; | 51 | enum rmpp_state state; |
52 | spinlock_t lock; | 52 | spinlock_t lock; |
@@ -233,9 +233,10 @@ static void nack_recv(struct ib_mad_agent_private *agent, | |||
233 | } | 233 | } |
234 | } | 234 | } |
235 | 235 | ||
236 | static void recv_timeout_handler(void *data) | 236 | static void recv_timeout_handler(struct work_struct *work) |
237 | { | 237 | { |
238 | struct mad_rmpp_recv *rmpp_recv = data; | 238 | struct mad_rmpp_recv *rmpp_recv = |
239 | container_of(work, struct mad_rmpp_recv, timeout_work.work); | ||
239 | struct ib_mad_recv_wc *rmpp_wc; | 240 | struct ib_mad_recv_wc *rmpp_wc; |
240 | unsigned long flags; | 241 | unsigned long flags; |
241 | 242 | ||
@@ -254,9 +255,10 @@ static void recv_timeout_handler(void *data) | |||
254 | ib_free_recv_mad(rmpp_wc); | 255 | ib_free_recv_mad(rmpp_wc); |
255 | } | 256 | } |
256 | 257 | ||
257 | static void recv_cleanup_handler(void *data) | 258 | static void recv_cleanup_handler(struct work_struct *work) |
258 | { | 259 | { |
259 | struct mad_rmpp_recv *rmpp_recv = data; | 260 | struct mad_rmpp_recv *rmpp_recv = |
261 | container_of(work, struct mad_rmpp_recv, cleanup_work.work); | ||
260 | unsigned long flags; | 262 | unsigned long flags; |
261 | 263 | ||
262 | spin_lock_irqsave(&rmpp_recv->agent->lock, flags); | 264 | spin_lock_irqsave(&rmpp_recv->agent->lock, flags); |
@@ -285,8 +287,8 @@ create_rmpp_recv(struct ib_mad_agent_private *agent, | |||
285 | 287 | ||
286 | rmpp_recv->agent = agent; | 288 | rmpp_recv->agent = agent; |
287 | init_completion(&rmpp_recv->comp); | 289 | init_completion(&rmpp_recv->comp); |
288 | INIT_WORK(&rmpp_recv->timeout_work, recv_timeout_handler, rmpp_recv); | 290 | INIT_DELAYED_WORK(&rmpp_recv->timeout_work, recv_timeout_handler); |
289 | INIT_WORK(&rmpp_recv->cleanup_work, recv_cleanup_handler, rmpp_recv); | 291 | INIT_DELAYED_WORK(&rmpp_recv->cleanup_work, recv_cleanup_handler); |
290 | spin_lock_init(&rmpp_recv->lock); | 292 | spin_lock_init(&rmpp_recv->lock); |
291 | rmpp_recv->state = RMPP_STATE_ACTIVE; | 293 | rmpp_recv->state = RMPP_STATE_ACTIVE; |
292 | atomic_set(&rmpp_recv->refcount, 1); | 294 | atomic_set(&rmpp_recv->refcount, 1); |
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c index 1706d3c7e95e..e45afba75341 100644 --- a/drivers/infiniband/core/sa_query.c +++ b/drivers/infiniband/core/sa_query.c | |||
@@ -360,9 +360,10 @@ static void free_sm_ah(struct kref *kref) | |||
360 | kfree(sm_ah); | 360 | kfree(sm_ah); |
361 | } | 361 | } |
362 | 362 | ||
363 | static void update_sm_ah(void *port_ptr) | 363 | static void update_sm_ah(struct work_struct *work) |
364 | { | 364 | { |
365 | struct ib_sa_port *port = port_ptr; | 365 | struct ib_sa_port *port = |
366 | container_of(work, struct ib_sa_port, update_task); | ||
366 | struct ib_sa_sm_ah *new_ah, *old_ah; | 367 | struct ib_sa_sm_ah *new_ah, *old_ah; |
367 | struct ib_port_attr port_attr; | 368 | struct ib_port_attr port_attr; |
368 | struct ib_ah_attr ah_attr; | 369 | struct ib_ah_attr ah_attr; |
@@ -992,8 +993,7 @@ static void ib_sa_add_one(struct ib_device *device) | |||
992 | if (IS_ERR(sa_dev->port[i].agent)) | 993 | if (IS_ERR(sa_dev->port[i].agent)) |
993 | goto err; | 994 | goto err; |
994 | 995 | ||
995 | INIT_WORK(&sa_dev->port[i].update_task, | 996 | INIT_WORK(&sa_dev->port[i].update_task, update_sm_ah); |
996 | update_sm_ah, &sa_dev->port[i]); | ||
997 | } | 997 | } |
998 | 998 | ||
999 | ib_set_client_data(device, &sa_client, sa_dev); | 999 | ib_set_client_data(device, &sa_client, sa_dev); |
@@ -1010,7 +1010,7 @@ static void ib_sa_add_one(struct ib_device *device) | |||
1010 | goto err; | 1010 | goto err; |
1011 | 1011 | ||
1012 | for (i = 0; i <= e - s; ++i) | 1012 | for (i = 0; i <= e - s; ++i) |
1013 | update_sm_ah(&sa_dev->port[i]); | 1013 | update_sm_ah(&sa_dev->port[i].update_task); |
1014 | 1014 | ||
1015 | return; | 1015 | return; |
1016 | 1016 | ||
diff --git a/drivers/infiniband/core/uverbs_mem.c b/drivers/infiniband/core/uverbs_mem.c index efe147dbeb42..db12cc0841df 100644 --- a/drivers/infiniband/core/uverbs_mem.c +++ b/drivers/infiniband/core/uverbs_mem.c | |||
@@ -179,9 +179,10 @@ void ib_umem_release(struct ib_device *dev, struct ib_umem *umem) | |||
179 | up_write(¤t->mm->mmap_sem); | 179 | up_write(¤t->mm->mmap_sem); |
180 | } | 180 | } |
181 | 181 | ||
182 | static void ib_umem_account(void *work_ptr) | 182 | static void ib_umem_account(struct work_struct *_work) |
183 | { | 183 | { |
184 | struct ib_umem_account_work *work = work_ptr; | 184 | struct ib_umem_account_work *work = |
185 | container_of(_work, struct ib_umem_account_work, work); | ||
185 | 186 | ||
186 | down_write(&work->mm->mmap_sem); | 187 | down_write(&work->mm->mmap_sem); |
187 | work->mm->locked_vm -= work->diff; | 188 | work->mm->locked_vm -= work->diff; |
@@ -216,7 +217,7 @@ void ib_umem_release_on_close(struct ib_device *dev, struct ib_umem *umem) | |||
216 | return; | 217 | return; |
217 | } | 218 | } |
218 | 219 | ||
219 | INIT_WORK(&work->work, ib_umem_account, work); | 220 | INIT_WORK(&work->work, ib_umem_account); |
220 | work->mm = mm; | 221 | work->mm = mm; |
221 | work->diff = PAGE_ALIGN(umem->length + umem->offset) >> PAGE_SHIFT; | 222 | work->diff = PAGE_ALIGN(umem->length + umem->offset) >> PAGE_SHIFT; |
222 | 223 | ||
diff --git a/drivers/infiniband/hw/ipath/ipath_user_pages.c b/drivers/infiniband/hw/ipath/ipath_user_pages.c index 413754b1d8a2..8536aeb96af8 100644 --- a/drivers/infiniband/hw/ipath/ipath_user_pages.c +++ b/drivers/infiniband/hw/ipath/ipath_user_pages.c | |||
@@ -214,9 +214,10 @@ struct ipath_user_pages_work { | |||
214 | unsigned long num_pages; | 214 | unsigned long num_pages; |
215 | }; | 215 | }; |
216 | 216 | ||
217 | static void user_pages_account(void *ptr) | 217 | static void user_pages_account(struct work_struct *_work) |
218 | { | 218 | { |
219 | struct ipath_user_pages_work *work = ptr; | 219 | struct ipath_user_pages_work *work = |
220 | container_of(_work, struct ipath_user_pages_work, work); | ||
220 | 221 | ||
221 | down_write(&work->mm->mmap_sem); | 222 | down_write(&work->mm->mmap_sem); |
222 | work->mm->locked_vm -= work->num_pages; | 223 | work->mm->locked_vm -= work->num_pages; |
@@ -242,7 +243,7 @@ void ipath_release_user_pages_on_close(struct page **p, size_t num_pages) | |||
242 | 243 | ||
243 | goto bail; | 244 | goto bail; |
244 | 245 | ||
245 | INIT_WORK(&work->work, user_pages_account, work); | 246 | INIT_WORK(&work->work, user_pages_account); |
246 | work->mm = mm; | 247 | work->mm = mm; |
247 | work->num_pages = num_pages; | 248 | work->num_pages = num_pages; |
248 | 249 | ||
diff --git a/drivers/infiniband/hw/mthca/mthca_catas.c b/drivers/infiniband/hw/mthca/mthca_catas.c index cd044ea2dfa4..e948158a28d9 100644 --- a/drivers/infiniband/hw/mthca/mthca_catas.c +++ b/drivers/infiniband/hw/mthca/mthca_catas.c | |||
@@ -57,7 +57,7 @@ static int catas_reset_disable; | |||
57 | module_param_named(catas_reset_disable, catas_reset_disable, int, 0644); | 57 | module_param_named(catas_reset_disable, catas_reset_disable, int, 0644); |
58 | MODULE_PARM_DESC(catas_reset_disable, "disable reset on catastrophic event if nonzero"); | 58 | MODULE_PARM_DESC(catas_reset_disable, "disable reset on catastrophic event if nonzero"); |
59 | 59 | ||
60 | static void catas_reset(void *work_ptr) | 60 | static void catas_reset(struct work_struct *work) |
61 | { | 61 | { |
62 | struct mthca_dev *dev, *tmpdev; | 62 | struct mthca_dev *dev, *tmpdev; |
63 | LIST_HEAD(tlist); | 63 | LIST_HEAD(tlist); |
@@ -203,7 +203,7 @@ void mthca_stop_catas_poll(struct mthca_dev *dev) | |||
203 | 203 | ||
204 | int __init mthca_catas_init(void) | 204 | int __init mthca_catas_init(void) |
205 | { | 205 | { |
206 | INIT_WORK(&catas_work, catas_reset, NULL); | 206 | INIT_WORK(&catas_work, catas_reset); |
207 | 207 | ||
208 | catas_wq = create_singlethread_workqueue("mthca_catas"); | 208 | catas_wq = create_singlethread_workqueue("mthca_catas"); |
209 | if (!catas_wq) | 209 | if (!catas_wq) |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h index f2b61851a49c..99547996aba2 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib.h +++ b/drivers/infiniband/ulp/ipoib/ipoib.h | |||
@@ -136,11 +136,11 @@ struct ipoib_dev_priv { | |||
136 | struct list_head multicast_list; | 136 | struct list_head multicast_list; |
137 | struct rb_root multicast_tree; | 137 | struct rb_root multicast_tree; |
138 | 138 | ||
139 | struct work_struct pkey_task; | 139 | struct delayed_work pkey_task; |
140 | struct work_struct mcast_task; | 140 | struct delayed_work mcast_task; |
141 | struct work_struct flush_task; | 141 | struct work_struct flush_task; |
142 | struct work_struct restart_task; | 142 | struct work_struct restart_task; |
143 | struct work_struct ah_reap_task; | 143 | struct delayed_work ah_reap_task; |
144 | 144 | ||
145 | struct ib_device *ca; | 145 | struct ib_device *ca; |
146 | u8 port; | 146 | u8 port; |
@@ -254,13 +254,13 @@ int ipoib_add_pkey_attr(struct net_device *dev); | |||
254 | 254 | ||
255 | void ipoib_send(struct net_device *dev, struct sk_buff *skb, | 255 | void ipoib_send(struct net_device *dev, struct sk_buff *skb, |
256 | struct ipoib_ah *address, u32 qpn); | 256 | struct ipoib_ah *address, u32 qpn); |
257 | void ipoib_reap_ah(void *dev_ptr); | 257 | void ipoib_reap_ah(struct work_struct *work); |
258 | 258 | ||
259 | void ipoib_flush_paths(struct net_device *dev); | 259 | void ipoib_flush_paths(struct net_device *dev); |
260 | struct ipoib_dev_priv *ipoib_intf_alloc(const char *format); | 260 | struct ipoib_dev_priv *ipoib_intf_alloc(const char *format); |
261 | 261 | ||
262 | int ipoib_ib_dev_init(struct net_device *dev, struct ib_device *ca, int port); | 262 | int ipoib_ib_dev_init(struct net_device *dev, struct ib_device *ca, int port); |
263 | void ipoib_ib_dev_flush(void *dev); | 263 | void ipoib_ib_dev_flush(struct work_struct *work); |
264 | void ipoib_ib_dev_cleanup(struct net_device *dev); | 264 | void ipoib_ib_dev_cleanup(struct net_device *dev); |
265 | 265 | ||
266 | int ipoib_ib_dev_open(struct net_device *dev); | 266 | int ipoib_ib_dev_open(struct net_device *dev); |
@@ -271,10 +271,10 @@ int ipoib_ib_dev_stop(struct net_device *dev); | |||
271 | int ipoib_dev_init(struct net_device *dev, struct ib_device *ca, int port); | 271 | int ipoib_dev_init(struct net_device *dev, struct ib_device *ca, int port); |
272 | void ipoib_dev_cleanup(struct net_device *dev); | 272 | void ipoib_dev_cleanup(struct net_device *dev); |
273 | 273 | ||
274 | void ipoib_mcast_join_task(void *dev_ptr); | 274 | void ipoib_mcast_join_task(struct work_struct *work); |
275 | void ipoib_mcast_send(struct net_device *dev, void *mgid, struct sk_buff *skb); | 275 | void ipoib_mcast_send(struct net_device *dev, void *mgid, struct sk_buff *skb); |
276 | 276 | ||
277 | void ipoib_mcast_restart_task(void *dev_ptr); | 277 | void ipoib_mcast_restart_task(struct work_struct *work); |
278 | int ipoib_mcast_start_thread(struct net_device *dev); | 278 | int ipoib_mcast_start_thread(struct net_device *dev); |
279 | int ipoib_mcast_stop_thread(struct net_device *dev, int flush); | 279 | int ipoib_mcast_stop_thread(struct net_device *dev, int flush); |
280 | 280 | ||
@@ -312,7 +312,7 @@ void ipoib_event(struct ib_event_handler *handler, | |||
312 | int ipoib_vlan_add(struct net_device *pdev, unsigned short pkey); | 312 | int ipoib_vlan_add(struct net_device *pdev, unsigned short pkey); |
313 | int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey); | 313 | int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey); |
314 | 314 | ||
315 | void ipoib_pkey_poll(void *dev); | 315 | void ipoib_pkey_poll(struct work_struct *work); |
316 | int ipoib_pkey_dev_delay_open(struct net_device *dev); | 316 | int ipoib_pkey_dev_delay_open(struct net_device *dev); |
317 | 317 | ||
318 | #ifdef CONFIG_INFINIBAND_IPOIB_DEBUG | 318 | #ifdef CONFIG_INFINIBAND_IPOIB_DEBUG |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 8bf5e9ec7c95..f10fba5d3265 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c | |||
@@ -400,10 +400,11 @@ static void __ipoib_reap_ah(struct net_device *dev) | |||
400 | spin_unlock_irq(&priv->tx_lock); | 400 | spin_unlock_irq(&priv->tx_lock); |
401 | } | 401 | } |
402 | 402 | ||
403 | void ipoib_reap_ah(void *dev_ptr) | 403 | void ipoib_reap_ah(struct work_struct *work) |
404 | { | 404 | { |
405 | struct net_device *dev = dev_ptr; | 405 | struct ipoib_dev_priv *priv = |
406 | struct ipoib_dev_priv *priv = netdev_priv(dev); | 406 | container_of(work, struct ipoib_dev_priv, ah_reap_task.work); |
407 | struct net_device *dev = priv->dev; | ||
407 | 408 | ||
408 | __ipoib_reap_ah(dev); | 409 | __ipoib_reap_ah(dev); |
409 | 410 | ||
@@ -613,10 +614,11 @@ int ipoib_ib_dev_init(struct net_device *dev, struct ib_device *ca, int port) | |||
613 | return 0; | 614 | return 0; |
614 | } | 615 | } |
615 | 616 | ||
616 | void ipoib_ib_dev_flush(void *_dev) | 617 | void ipoib_ib_dev_flush(struct work_struct *work) |
617 | { | 618 | { |
618 | struct net_device *dev = (struct net_device *)_dev; | 619 | struct ipoib_dev_priv *cpriv, *priv = |
619 | struct ipoib_dev_priv *priv = netdev_priv(dev), *cpriv; | 620 | container_of(work, struct ipoib_dev_priv, flush_task); |
621 | struct net_device *dev = priv->dev; | ||
620 | 622 | ||
621 | if (!test_bit(IPOIB_FLAG_INITIALIZED, &priv->flags) ) { | 623 | if (!test_bit(IPOIB_FLAG_INITIALIZED, &priv->flags) ) { |
622 | ipoib_dbg(priv, "Not flushing - IPOIB_FLAG_INITIALIZED not set.\n"); | 624 | ipoib_dbg(priv, "Not flushing - IPOIB_FLAG_INITIALIZED not set.\n"); |
@@ -638,14 +640,14 @@ void ipoib_ib_dev_flush(void *_dev) | |||
638 | */ | 640 | */ |
639 | if (test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags)) { | 641 | if (test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags)) { |
640 | ipoib_ib_dev_up(dev); | 642 | ipoib_ib_dev_up(dev); |
641 | ipoib_mcast_restart_task(dev); | 643 | ipoib_mcast_restart_task(&priv->restart_task); |
642 | } | 644 | } |
643 | 645 | ||
644 | mutex_lock(&priv->vlan_mutex); | 646 | mutex_lock(&priv->vlan_mutex); |
645 | 647 | ||
646 | /* Flush any child interfaces too */ | 648 | /* Flush any child interfaces too */ |
647 | list_for_each_entry(cpriv, &priv->child_intfs, list) | 649 | list_for_each_entry(cpriv, &priv->child_intfs, list) |
648 | ipoib_ib_dev_flush(cpriv->dev); | 650 | ipoib_ib_dev_flush(&cpriv->flush_task); |
649 | 651 | ||
650 | mutex_unlock(&priv->vlan_mutex); | 652 | mutex_unlock(&priv->vlan_mutex); |
651 | } | 653 | } |
@@ -672,10 +674,11 @@ void ipoib_ib_dev_cleanup(struct net_device *dev) | |||
672 | * change async notification is available. | 674 | * change async notification is available. |
673 | */ | 675 | */ |
674 | 676 | ||
675 | void ipoib_pkey_poll(void *dev_ptr) | 677 | void ipoib_pkey_poll(struct work_struct *work) |
676 | { | 678 | { |
677 | struct net_device *dev = dev_ptr; | 679 | struct ipoib_dev_priv *priv = |
678 | struct ipoib_dev_priv *priv = netdev_priv(dev); | 680 | container_of(work, struct ipoib_dev_priv, pkey_task.work); |
681 | struct net_device *dev = priv->dev; | ||
679 | 682 | ||
680 | ipoib_pkey_dev_check_presence(dev); | 683 | ipoib_pkey_dev_check_presence(dev); |
681 | 684 | ||
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 5ba3154320b4..c09280243726 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -940,11 +940,11 @@ static void ipoib_setup(struct net_device *dev) | |||
940 | INIT_LIST_HEAD(&priv->dead_ahs); | 940 | INIT_LIST_HEAD(&priv->dead_ahs); |
941 | INIT_LIST_HEAD(&priv->multicast_list); | 941 | INIT_LIST_HEAD(&priv->multicast_list); |
942 | 942 | ||
943 | INIT_WORK(&priv->pkey_task, ipoib_pkey_poll, priv->dev); | 943 | INIT_DELAYED_WORK(&priv->pkey_task, ipoib_pkey_poll); |
944 | INIT_WORK(&priv->mcast_task, ipoib_mcast_join_task, priv->dev); | 944 | INIT_DELAYED_WORK(&priv->mcast_task, ipoib_mcast_join_task); |
945 | INIT_WORK(&priv->flush_task, ipoib_ib_dev_flush, priv->dev); | 945 | INIT_WORK(&priv->flush_task, ipoib_ib_dev_flush); |
946 | INIT_WORK(&priv->restart_task, ipoib_mcast_restart_task, priv->dev); | 946 | INIT_WORK(&priv->restart_task, ipoib_mcast_restart_task); |
947 | INIT_WORK(&priv->ah_reap_task, ipoib_reap_ah, priv->dev); | 947 | INIT_DELAYED_WORK(&priv->ah_reap_task, ipoib_reap_ah); |
948 | } | 948 | } |
949 | 949 | ||
950 | struct ipoib_dev_priv *ipoib_intf_alloc(const char *name) | 950 | struct ipoib_dev_priv *ipoib_intf_alloc(const char *name) |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index d282d65e3ee0..b04b72ca32ed 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c | |||
@@ -399,7 +399,8 @@ static void ipoib_mcast_join_complete(int status, | |||
399 | mcast->backoff = 1; | 399 | mcast->backoff = 1; |
400 | mutex_lock(&mcast_mutex); | 400 | mutex_lock(&mcast_mutex); |
401 | if (test_bit(IPOIB_MCAST_RUN, &priv->flags)) | 401 | if (test_bit(IPOIB_MCAST_RUN, &priv->flags)) |
402 | queue_work(ipoib_workqueue, &priv->mcast_task); | 402 | queue_delayed_work(ipoib_workqueue, |
403 | &priv->mcast_task, 0); | ||
403 | mutex_unlock(&mcast_mutex); | 404 | mutex_unlock(&mcast_mutex); |
404 | complete(&mcast->done); | 405 | complete(&mcast->done); |
405 | return; | 406 | return; |
@@ -435,7 +436,8 @@ static void ipoib_mcast_join_complete(int status, | |||
435 | 436 | ||
436 | if (test_bit(IPOIB_MCAST_RUN, &priv->flags)) { | 437 | if (test_bit(IPOIB_MCAST_RUN, &priv->flags)) { |
437 | if (status == -ETIMEDOUT) | 438 | if (status == -ETIMEDOUT) |
438 | queue_work(ipoib_workqueue, &priv->mcast_task); | 439 | queue_delayed_work(ipoib_workqueue, &priv->mcast_task, |
440 | 0); | ||
439 | else | 441 | else |
440 | queue_delayed_work(ipoib_workqueue, &priv->mcast_task, | 442 | queue_delayed_work(ipoib_workqueue, &priv->mcast_task, |
441 | mcast->backoff * HZ); | 443 | mcast->backoff * HZ); |
@@ -517,10 +519,11 @@ static void ipoib_mcast_join(struct net_device *dev, struct ipoib_mcast *mcast, | |||
517 | mcast->query_id = ret; | 519 | mcast->query_id = ret; |
518 | } | 520 | } |
519 | 521 | ||
520 | void ipoib_mcast_join_task(void *dev_ptr) | 522 | void ipoib_mcast_join_task(struct work_struct *work) |
521 | { | 523 | { |
522 | struct net_device *dev = dev_ptr; | 524 | struct ipoib_dev_priv *priv = |
523 | struct ipoib_dev_priv *priv = netdev_priv(dev); | 525 | container_of(work, struct ipoib_dev_priv, mcast_task.work); |
526 | struct net_device *dev = priv->dev; | ||
524 | 527 | ||
525 | if (!test_bit(IPOIB_MCAST_RUN, &priv->flags)) | 528 | if (!test_bit(IPOIB_MCAST_RUN, &priv->flags)) |
526 | return; | 529 | return; |
@@ -610,7 +613,7 @@ int ipoib_mcast_start_thread(struct net_device *dev) | |||
610 | 613 | ||
611 | mutex_lock(&mcast_mutex); | 614 | mutex_lock(&mcast_mutex); |
612 | if (!test_and_set_bit(IPOIB_MCAST_RUN, &priv->flags)) | 615 | if (!test_and_set_bit(IPOIB_MCAST_RUN, &priv->flags)) |
613 | queue_work(ipoib_workqueue, &priv->mcast_task); | 616 | queue_delayed_work(ipoib_workqueue, &priv->mcast_task, 0); |
614 | mutex_unlock(&mcast_mutex); | 617 | mutex_unlock(&mcast_mutex); |
615 | 618 | ||
616 | spin_lock_irq(&priv->lock); | 619 | spin_lock_irq(&priv->lock); |
@@ -818,10 +821,11 @@ void ipoib_mcast_dev_flush(struct net_device *dev) | |||
818 | } | 821 | } |
819 | } | 822 | } |
820 | 823 | ||
821 | void ipoib_mcast_restart_task(void *dev_ptr) | 824 | void ipoib_mcast_restart_task(struct work_struct *work) |
822 | { | 825 | { |
823 | struct net_device *dev = dev_ptr; | 826 | struct ipoib_dev_priv *priv = |
824 | struct ipoib_dev_priv *priv = netdev_priv(dev); | 827 | container_of(work, struct ipoib_dev_priv, restart_task); |
828 | struct net_device *dev = priv->dev; | ||
825 | struct dev_mc_list *mclist; | 829 | struct dev_mc_list *mclist; |
826 | struct ipoib_mcast *mcast, *tmcast; | 830 | struct ipoib_mcast *mcast, *tmcast; |
827 | LIST_HEAD(remove_list); | 831 | LIST_HEAD(remove_list); |
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index 18a000034996..693b77002897 100644 --- a/drivers/infiniband/ulp/iser/iser_verbs.c +++ b/drivers/infiniband/ulp/iser/iser_verbs.c | |||
@@ -48,7 +48,7 @@ | |||
48 | 48 | ||
49 | static void iser_cq_tasklet_fn(unsigned long data); | 49 | static void iser_cq_tasklet_fn(unsigned long data); |
50 | static void iser_cq_callback(struct ib_cq *cq, void *cq_context); | 50 | static void iser_cq_callback(struct ib_cq *cq, void *cq_context); |
51 | static void iser_comp_error_worker(void *data); | 51 | static void iser_comp_error_worker(struct work_struct *work); |
52 | 52 | ||
53 | static void iser_cq_event_callback(struct ib_event *cause, void *context) | 53 | static void iser_cq_event_callback(struct ib_event *cause, void *context) |
54 | { | 54 | { |
@@ -480,8 +480,7 @@ int iser_conn_init(struct iser_conn **ibconn) | |||
480 | init_waitqueue_head(&ib_conn->wait); | 480 | init_waitqueue_head(&ib_conn->wait); |
481 | atomic_set(&ib_conn->post_recv_buf_count, 0); | 481 | atomic_set(&ib_conn->post_recv_buf_count, 0); |
482 | atomic_set(&ib_conn->post_send_buf_count, 0); | 482 | atomic_set(&ib_conn->post_send_buf_count, 0); |
483 | INIT_WORK(&ib_conn->comperror_work, iser_comp_error_worker, | 483 | INIT_WORK(&ib_conn->comperror_work, iser_comp_error_worker); |
484 | ib_conn); | ||
485 | INIT_LIST_HEAD(&ib_conn->conn_list); | 484 | INIT_LIST_HEAD(&ib_conn->conn_list); |
486 | spin_lock_init(&ib_conn->lock); | 485 | spin_lock_init(&ib_conn->lock); |
487 | 486 | ||
@@ -754,9 +753,10 @@ int iser_post_send(struct iser_desc *tx_desc) | |||
754 | return ret_val; | 753 | return ret_val; |
755 | } | 754 | } |
756 | 755 | ||
757 | static void iser_comp_error_worker(void *data) | 756 | static void iser_comp_error_worker(struct work_struct *work) |
758 | { | 757 | { |
759 | struct iser_conn *ib_conn = data; | 758 | struct iser_conn *ib_conn = |
759 | container_of(work, struct iser_conn, comperror_work); | ||
760 | 760 | ||
761 | /* getting here when the state is UP means that the conn is being * | 761 | /* getting here when the state is UP means that the conn is being * |
762 | * terminated asynchronously from the iSCSI layer's perspective. */ | 762 | * terminated asynchronously from the iSCSI layer's perspective. */ |
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 64ab5fc7cca3..a6289595557b 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c | |||
@@ -390,9 +390,10 @@ static void srp_disconnect_target(struct srp_target_port *target) | |||
390 | wait_for_completion(&target->done); | 390 | wait_for_completion(&target->done); |
391 | } | 391 | } |
392 | 392 | ||
393 | static void srp_remove_work(void *target_ptr) | 393 | static void srp_remove_work(struct work_struct *work) |
394 | { | 394 | { |
395 | struct srp_target_port *target = target_ptr; | 395 | struct srp_target_port *target = |
396 | container_of(work, struct srp_target_port, work); | ||
396 | 397 | ||
397 | spin_lock_irq(target->scsi_host->host_lock); | 398 | spin_lock_irq(target->scsi_host->host_lock); |
398 | if (target->state != SRP_TARGET_DEAD) { | 399 | if (target->state != SRP_TARGET_DEAD) { |
@@ -575,7 +576,7 @@ err: | |||
575 | spin_lock_irq(target->scsi_host->host_lock); | 576 | spin_lock_irq(target->scsi_host->host_lock); |
576 | if (target->state == SRP_TARGET_CONNECTING) { | 577 | if (target->state == SRP_TARGET_CONNECTING) { |
577 | target->state = SRP_TARGET_DEAD; | 578 | target->state = SRP_TARGET_DEAD; |
578 | INIT_WORK(&target->work, srp_remove_work, target); | 579 | INIT_WORK(&target->work, srp_remove_work); |
579 | schedule_work(&target->work); | 580 | schedule_work(&target->work); |
580 | } | 581 | } |
581 | spin_unlock_irq(target->scsi_host->host_lock); | 582 | spin_unlock_irq(target->scsi_host->host_lock); |
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index cbb93669d1ce..8451b29a3db5 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c | |||
@@ -567,9 +567,9 @@ static int atkbd_set_leds(struct atkbd *atkbd) | |||
567 | * interrupt context. | 567 | * interrupt context. |
568 | */ | 568 | */ |
569 | 569 | ||
570 | static void atkbd_event_work(void *data) | 570 | static void atkbd_event_work(struct work_struct *work) |
571 | { | 571 | { |
572 | struct atkbd *atkbd = data; | 572 | struct atkbd *atkbd = container_of(work, struct atkbd, event_work); |
573 | 573 | ||
574 | mutex_lock(&atkbd->event_mutex); | 574 | mutex_lock(&atkbd->event_mutex); |
575 | 575 | ||
@@ -943,7 +943,7 @@ static int atkbd_connect(struct serio *serio, struct serio_driver *drv) | |||
943 | 943 | ||
944 | atkbd->dev = dev; | 944 | atkbd->dev = dev; |
945 | ps2_init(&atkbd->ps2dev, serio); | 945 | ps2_init(&atkbd->ps2dev, serio); |
946 | INIT_WORK(&atkbd->event_work, atkbd_event_work, atkbd); | 946 | INIT_WORK(&atkbd->event_work, atkbd_event_work); |
947 | mutex_init(&atkbd->event_mutex); | 947 | mutex_init(&atkbd->event_mutex); |
948 | 948 | ||
949 | switch (serio->id.type) { | 949 | switch (serio->id.type) { |
diff --git a/drivers/input/keyboard/lkkbd.c b/drivers/input/keyboard/lkkbd.c index 979b93e33da7..b7f049b45b6b 100644 --- a/drivers/input/keyboard/lkkbd.c +++ b/drivers/input/keyboard/lkkbd.c | |||
@@ -572,9 +572,9 @@ lkkbd_event (struct input_dev *dev, unsigned int type, unsigned int code, | |||
572 | * were in. | 572 | * were in. |
573 | */ | 573 | */ |
574 | static void | 574 | static void |
575 | lkkbd_reinit (void *data) | 575 | lkkbd_reinit (struct work_struct *work) |
576 | { | 576 | { |
577 | struct lkkbd *lk = data; | 577 | struct lkkbd *lk = container_of(work, struct lkkbd, tq); |
578 | int division; | 578 | int division; |
579 | unsigned char leds_on = 0; | 579 | unsigned char leds_on = 0; |
580 | unsigned char leds_off = 0; | 580 | unsigned char leds_off = 0; |
@@ -651,7 +651,7 @@ lkkbd_connect (struct serio *serio, struct serio_driver *drv) | |||
651 | 651 | ||
652 | lk->serio = serio; | 652 | lk->serio = serio; |
653 | lk->dev = input_dev; | 653 | lk->dev = input_dev; |
654 | INIT_WORK (&lk->tq, lkkbd_reinit, lk); | 654 | INIT_WORK (&lk->tq, lkkbd_reinit); |
655 | lk->bell_volume = bell_volume; | 655 | lk->bell_volume = bell_volume; |
656 | lk->keyclick_volume = keyclick_volume; | 656 | lk->keyclick_volume = keyclick_volume; |
657 | lk->ctrlclick_volume = ctrlclick_volume; | 657 | lk->ctrlclick_volume = ctrlclick_volume; |
diff --git a/drivers/input/keyboard/sunkbd.c b/drivers/input/keyboard/sunkbd.c index cac4781103c3..6cd887c5eb0a 100644 --- a/drivers/input/keyboard/sunkbd.c +++ b/drivers/input/keyboard/sunkbd.c | |||
@@ -208,9 +208,9 @@ static int sunkbd_initialize(struct sunkbd *sunkbd) | |||
208 | * were in. | 208 | * were in. |
209 | */ | 209 | */ |
210 | 210 | ||
211 | static void sunkbd_reinit(void *data) | 211 | static void sunkbd_reinit(struct work_struct *work) |
212 | { | 212 | { |
213 | struct sunkbd *sunkbd = data; | 213 | struct sunkbd *sunkbd = container_of(work, struct sunkbd, tq); |
214 | 214 | ||
215 | wait_event_interruptible_timeout(sunkbd->wait, sunkbd->reset >= 0, HZ); | 215 | wait_event_interruptible_timeout(sunkbd->wait, sunkbd->reset >= 0, HZ); |
216 | 216 | ||
@@ -248,7 +248,7 @@ static int sunkbd_connect(struct serio *serio, struct serio_driver *drv) | |||
248 | sunkbd->serio = serio; | 248 | sunkbd->serio = serio; |
249 | sunkbd->dev = input_dev; | 249 | sunkbd->dev = input_dev; |
250 | init_waitqueue_head(&sunkbd->wait); | 250 | init_waitqueue_head(&sunkbd->wait); |
251 | INIT_WORK(&sunkbd->tq, sunkbd_reinit, sunkbd); | 251 | INIT_WORK(&sunkbd->tq, sunkbd_reinit); |
252 | snprintf(sunkbd->phys, sizeof(sunkbd->phys), "%s/input0", serio->phys); | 252 | snprintf(sunkbd->phys, sizeof(sunkbd->phys), "%s/input0", serio->phys); |
253 | 253 | ||
254 | serio_set_drvdata(serio, sunkbd); | 254 | serio_set_drvdata(serio, sunkbd); |
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 6f9b2c7cc9c2..52bb2226ce2f 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
@@ -888,9 +888,10 @@ static int psmouse_poll(struct psmouse *psmouse) | |||
888 | * psmouse_resync() attempts to re-validate current protocol. | 888 | * psmouse_resync() attempts to re-validate current protocol. |
889 | */ | 889 | */ |
890 | 890 | ||
891 | static void psmouse_resync(void *p) | 891 | static void psmouse_resync(struct work_struct *work) |
892 | { | 892 | { |
893 | struct psmouse *psmouse = p, *parent = NULL; | 893 | struct psmouse *parent = NULL, *psmouse = |
894 | container_of(work, struct psmouse, resync_work); | ||
894 | struct serio *serio = psmouse->ps2dev.serio; | 895 | struct serio *serio = psmouse->ps2dev.serio; |
895 | psmouse_ret_t rc = PSMOUSE_GOOD_DATA; | 896 | psmouse_ret_t rc = PSMOUSE_GOOD_DATA; |
896 | int failed = 0, enabled = 0; | 897 | int failed = 0, enabled = 0; |
@@ -1121,7 +1122,7 @@ static int psmouse_connect(struct serio *serio, struct serio_driver *drv) | |||
1121 | goto out; | 1122 | goto out; |
1122 | 1123 | ||
1123 | ps2_init(&psmouse->ps2dev, serio); | 1124 | ps2_init(&psmouse->ps2dev, serio); |
1124 | INIT_WORK(&psmouse->resync_work, psmouse_resync, psmouse); | 1125 | INIT_WORK(&psmouse->resync_work, psmouse_resync); |
1125 | psmouse->dev = input_dev; | 1126 | psmouse->dev = input_dev; |
1126 | snprintf(psmouse->phys, sizeof(psmouse->phys), "%s/input0", serio->phys); | 1127 | snprintf(psmouse->phys, sizeof(psmouse->phys), "%s/input0", serio->phys); |
1127 | 1128 | ||
diff --git a/drivers/input/serio/libps2.c b/drivers/input/serio/libps2.c index e5b1b60757bb..b3e84d3bb7f7 100644 --- a/drivers/input/serio/libps2.c +++ b/drivers/input/serio/libps2.c | |||
@@ -251,9 +251,9 @@ EXPORT_SYMBOL(ps2_command); | |||
251 | * ps2_schedule_command(), to a PS/2 device (keyboard, mouse, etc.) | 251 | * ps2_schedule_command(), to a PS/2 device (keyboard, mouse, etc.) |
252 | */ | 252 | */ |
253 | 253 | ||
254 | static void ps2_execute_scheduled_command(void *data) | 254 | static void ps2_execute_scheduled_command(struct work_struct *work) |
255 | { | 255 | { |
256 | struct ps2work *ps2work = data; | 256 | struct ps2work *ps2work = container_of(work, struct ps2work, work); |
257 | 257 | ||
258 | ps2_command(ps2work->ps2dev, ps2work->param, ps2work->command); | 258 | ps2_command(ps2work->ps2dev, ps2work->param, ps2work->command); |
259 | kfree(ps2work); | 259 | kfree(ps2work); |
@@ -278,7 +278,7 @@ int ps2_schedule_command(struct ps2dev *ps2dev, unsigned char *param, int comman | |||
278 | ps2work->ps2dev = ps2dev; | 278 | ps2work->ps2dev = ps2dev; |
279 | ps2work->command = command; | 279 | ps2work->command = command; |
280 | memcpy(ps2work->param, param, send); | 280 | memcpy(ps2work->param, param, send); |
281 | INIT_WORK(&ps2work->work, ps2_execute_scheduled_command, ps2work); | 281 | INIT_WORK(&ps2work->work, ps2_execute_scheduled_command); |
282 | 282 | ||
283 | if (!schedule_work(&ps2work->work)) { | 283 | if (!schedule_work(&ps2work->work)) { |
284 | kfree(ps2work); | 284 | kfree(ps2work); |
diff --git a/drivers/isdn/act2000/capi.c b/drivers/isdn/act2000/capi.c index 6ae6eb322111..946c38cf6f8a 100644 --- a/drivers/isdn/act2000/capi.c +++ b/drivers/isdn/act2000/capi.c | |||
@@ -627,8 +627,10 @@ handle_ack(act2000_card *card, act2000_chan *chan, __u8 blocknr) { | |||
627 | } | 627 | } |
628 | 628 | ||
629 | void | 629 | void |
630 | actcapi_dispatch(act2000_card *card) | 630 | actcapi_dispatch(struct work_struct *work) |
631 | { | 631 | { |
632 | struct act2000_card *card = | ||
633 | container_of(work, struct act2000_card, rcv_tq); | ||
632 | struct sk_buff *skb; | 634 | struct sk_buff *skb; |
633 | actcapi_msg *msg; | 635 | actcapi_msg *msg; |
634 | __u16 ccmd; | 636 | __u16 ccmd; |
diff --git a/drivers/isdn/act2000/capi.h b/drivers/isdn/act2000/capi.h index 49f453c53c64..e55f6a931f66 100644 --- a/drivers/isdn/act2000/capi.h +++ b/drivers/isdn/act2000/capi.h | |||
@@ -356,7 +356,7 @@ extern int actcapi_connect_req(act2000_card *, act2000_chan *, char *, char, int | |||
356 | extern void actcapi_select_b2_protocol_req(act2000_card *, act2000_chan *); | 356 | extern void actcapi_select_b2_protocol_req(act2000_card *, act2000_chan *); |
357 | extern void actcapi_disconnect_b3_req(act2000_card *, act2000_chan *); | 357 | extern void actcapi_disconnect_b3_req(act2000_card *, act2000_chan *); |
358 | extern void actcapi_connect_resp(act2000_card *, act2000_chan *, __u8); | 358 | extern void actcapi_connect_resp(act2000_card *, act2000_chan *, __u8); |
359 | extern void actcapi_dispatch(act2000_card *); | 359 | extern void actcapi_dispatch(struct work_struct *); |
360 | #ifdef DEBUG_MSG | 360 | #ifdef DEBUG_MSG |
361 | extern void actcapi_debug_msg(struct sk_buff *skb, int); | 361 | extern void actcapi_debug_msg(struct sk_buff *skb, int); |
362 | #else | 362 | #else |
diff --git a/drivers/isdn/act2000/module.c b/drivers/isdn/act2000/module.c index d89dcde4eade..90593e2ef872 100644 --- a/drivers/isdn/act2000/module.c +++ b/drivers/isdn/act2000/module.c | |||
@@ -192,8 +192,11 @@ act2000_set_msn(act2000_card *card, char *eazmsn) | |||
192 | } | 192 | } |
193 | 193 | ||
194 | static void | 194 | static void |
195 | act2000_transmit(struct act2000_card *card) | 195 | act2000_transmit(struct work_struct *work) |
196 | { | 196 | { |
197 | struct act2000_card *card = | ||
198 | container_of(work, struct act2000_card, snd_tq); | ||
199 | |||
197 | switch (card->bus) { | 200 | switch (card->bus) { |
198 | case ACT2000_BUS_ISA: | 201 | case ACT2000_BUS_ISA: |
199 | act2000_isa_send(card); | 202 | act2000_isa_send(card); |
@@ -207,8 +210,11 @@ act2000_transmit(struct act2000_card *card) | |||
207 | } | 210 | } |
208 | 211 | ||
209 | static void | 212 | static void |
210 | act2000_receive(struct act2000_card *card) | 213 | act2000_receive(struct work_struct *work) |
211 | { | 214 | { |
215 | struct act2000_card *card = | ||
216 | container_of(work, struct act2000_card, poll_tq); | ||
217 | |||
212 | switch (card->bus) { | 218 | switch (card->bus) { |
213 | case ACT2000_BUS_ISA: | 219 | case ACT2000_BUS_ISA: |
214 | act2000_isa_receive(card); | 220 | act2000_isa_receive(card); |
@@ -227,7 +233,7 @@ act2000_poll(unsigned long data) | |||
227 | act2000_card * card = (act2000_card *)data; | 233 | act2000_card * card = (act2000_card *)data; |
228 | unsigned long flags; | 234 | unsigned long flags; |
229 | 235 | ||
230 | act2000_receive(card); | 236 | act2000_receive(&card->poll_tq); |
231 | spin_lock_irqsave(&card->lock, flags); | 237 | spin_lock_irqsave(&card->lock, flags); |
232 | mod_timer(&card->ptimer, jiffies+3); | 238 | mod_timer(&card->ptimer, jiffies+3); |
233 | spin_unlock_irqrestore(&card->lock, flags); | 239 | spin_unlock_irqrestore(&card->lock, flags); |
@@ -578,9 +584,9 @@ act2000_alloccard(int bus, int port, int irq, char *id) | |||
578 | skb_queue_head_init(&card->sndq); | 584 | skb_queue_head_init(&card->sndq); |
579 | skb_queue_head_init(&card->rcvq); | 585 | skb_queue_head_init(&card->rcvq); |
580 | skb_queue_head_init(&card->ackq); | 586 | skb_queue_head_init(&card->ackq); |
581 | INIT_WORK(&card->snd_tq, (void *) (void *) act2000_transmit, card); | 587 | INIT_WORK(&card->snd_tq, act2000_transmit); |
582 | INIT_WORK(&card->rcv_tq, (void *) (void *) actcapi_dispatch, card); | 588 | INIT_WORK(&card->rcv_tq, actcapi_dispatch); |
583 | INIT_WORK(&card->poll_tq, (void *) (void *) act2000_receive, card); | 589 | INIT_WORK(&card->poll_tq, act2000_receive); |
584 | init_timer(&card->ptimer); | 590 | init_timer(&card->ptimer); |
585 | card->interface.owner = THIS_MODULE; | 591 | card->interface.owner = THIS_MODULE; |
586 | card->interface.channels = ACT2000_BCH; | 592 | card->interface.channels = ACT2000_BCH; |
diff --git a/drivers/isdn/capi/kcapi.c b/drivers/isdn/capi/kcapi.c index 8c4fcb9027b3..783a25526315 100644 --- a/drivers/isdn/capi/kcapi.c +++ b/drivers/isdn/capi/kcapi.c | |||
@@ -208,9 +208,10 @@ static void notify_down(u32 contr) | |||
208 | } | 208 | } |
209 | } | 209 | } |
210 | 210 | ||
211 | static void notify_handler(void *data) | 211 | static void notify_handler(struct work_struct *work) |
212 | { | 212 | { |
213 | struct capi_notifier *np = data; | 213 | struct capi_notifier *np = |
214 | container_of(work, struct capi_notifier, work); | ||
214 | 215 | ||
215 | switch (np->cmd) { | 216 | switch (np->cmd) { |
216 | case KCI_CONTRUP: | 217 | case KCI_CONTRUP: |
@@ -235,7 +236,7 @@ static int notify_push(unsigned int cmd, u32 controller, u16 applid, u32 ncci) | |||
235 | if (!np) | 236 | if (!np) |
236 | return -ENOMEM; | 237 | return -ENOMEM; |
237 | 238 | ||
238 | INIT_WORK(&np->work, notify_handler, np); | 239 | INIT_WORK(&np->work, notify_handler); |
239 | np->cmd = cmd; | 240 | np->cmd = cmd; |
240 | np->controller = controller; | 241 | np->controller = controller; |
241 | np->applid = applid; | 242 | np->applid = applid; |
@@ -248,10 +249,11 @@ static int notify_push(unsigned int cmd, u32 controller, u16 applid, u32 ncci) | |||
248 | 249 | ||
249 | /* -------- Receiver ------------------------------------------ */ | 250 | /* -------- Receiver ------------------------------------------ */ |
250 | 251 | ||
251 | static void recv_handler(void *_ap) | 252 | static void recv_handler(struct work_struct *work) |
252 | { | 253 | { |
253 | struct sk_buff *skb; | 254 | struct sk_buff *skb; |
254 | struct capi20_appl *ap = (struct capi20_appl *) _ap; | 255 | struct capi20_appl *ap = |
256 | container_of(work, struct capi20_appl, recv_work); | ||
255 | 257 | ||
256 | if ((!ap) || (ap->release_in_progress)) | 258 | if ((!ap) || (ap->release_in_progress)) |
257 | return; | 259 | return; |
@@ -527,7 +529,7 @@ u16 capi20_register(struct capi20_appl *ap) | |||
527 | ap->callback = NULL; | 529 | ap->callback = NULL; |
528 | init_MUTEX(&ap->recv_sem); | 530 | init_MUTEX(&ap->recv_sem); |
529 | skb_queue_head_init(&ap->recv_queue); | 531 | skb_queue_head_init(&ap->recv_queue); |
530 | INIT_WORK(&ap->recv_work, recv_handler, (void *)ap); | 532 | INIT_WORK(&ap->recv_work, recv_handler); |
531 | ap->release_in_progress = 0; | 533 | ap->release_in_progress = 0; |
532 | 534 | ||
533 | write_unlock_irqrestore(&application_lock, flags); | 535 | write_unlock_irqrestore(&application_lock, flags); |
diff --git a/drivers/isdn/hisax/amd7930_fn.c b/drivers/isdn/hisax/amd7930_fn.c index bec59010bc66..3b19caeba258 100644 --- a/drivers/isdn/hisax/amd7930_fn.c +++ b/drivers/isdn/hisax/amd7930_fn.c | |||
@@ -232,9 +232,10 @@ Amd7930_new_ph(struct IsdnCardState *cs) | |||
232 | 232 | ||
233 | 233 | ||
234 | static void | 234 | static void |
235 | Amd7930_bh(struct IsdnCardState *cs) | 235 | Amd7930_bh(struct work_struct *work) |
236 | { | 236 | { |
237 | 237 | struct IsdnCardState *cs = | |
238 | container_of(work, struct IsdnCardState, tqueue); | ||
238 | struct PStack *stptr; | 239 | struct PStack *stptr; |
239 | 240 | ||
240 | if (!cs) | 241 | if (!cs) |
@@ -789,7 +790,7 @@ Amd7930_init(struct IsdnCardState *cs) | |||
789 | void __devinit | 790 | void __devinit |
790 | setup_Amd7930(struct IsdnCardState *cs) | 791 | setup_Amd7930(struct IsdnCardState *cs) |
791 | { | 792 | { |
792 | INIT_WORK(&cs->tqueue, (void *)(void *) Amd7930_bh, cs); | 793 | INIT_WORK(&cs->tqueue, Amd7930_bh); |
793 | cs->dbusytimer.function = (void *) dbusy_timer_handler; | 794 | cs->dbusytimer.function = (void *) dbusy_timer_handler; |
794 | cs->dbusytimer.data = (long) cs; | 795 | cs->dbusytimer.data = (long) cs; |
795 | init_timer(&cs->dbusytimer); | 796 | init_timer(&cs->dbusytimer); |
diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c index 785b08554fca..cede72cdbb31 100644 --- a/drivers/isdn/hisax/config.c +++ b/drivers/isdn/hisax/config.c | |||
@@ -1137,7 +1137,6 @@ static int checkcard(int cardnr, char *id, int *busy_flag, struct module *lockow | |||
1137 | cs->tx_skb = NULL; | 1137 | cs->tx_skb = NULL; |
1138 | cs->tx_cnt = 0; | 1138 | cs->tx_cnt = 0; |
1139 | cs->event = 0; | 1139 | cs->event = 0; |
1140 | cs->tqueue.data = cs; | ||
1141 | 1140 | ||
1142 | skb_queue_head_init(&cs->rq); | 1141 | skb_queue_head_init(&cs->rq); |
1143 | skb_queue_head_init(&cs->sq); | 1142 | skb_queue_head_init(&cs->sq); |
@@ -1554,7 +1553,7 @@ static void hisax_b_l2l1(struct PStack *st, int pr, void *arg); | |||
1554 | static int hisax_cardmsg(struct IsdnCardState *cs, int mt, void *arg); | 1553 | static int hisax_cardmsg(struct IsdnCardState *cs, int mt, void *arg); |
1555 | static int hisax_bc_setstack(struct PStack *st, struct BCState *bcs); | 1554 | static int hisax_bc_setstack(struct PStack *st, struct BCState *bcs); |
1556 | static void hisax_bc_close(struct BCState *bcs); | 1555 | static void hisax_bc_close(struct BCState *bcs); |
1557 | static void hisax_bh(struct IsdnCardState *cs); | 1556 | static void hisax_bh(struct work_struct *work); |
1558 | static void EChannel_proc_rcv(struct hisax_d_if *d_if); | 1557 | static void EChannel_proc_rcv(struct hisax_d_if *d_if); |
1559 | 1558 | ||
1560 | int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[], | 1559 | int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[], |
@@ -1586,7 +1585,7 @@ int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[], | |||
1586 | hisax_d_if->cs = cs; | 1585 | hisax_d_if->cs = cs; |
1587 | cs->hw.hisax_d_if = hisax_d_if; | 1586 | cs->hw.hisax_d_if = hisax_d_if; |
1588 | cs->cardmsg = hisax_cardmsg; | 1587 | cs->cardmsg = hisax_cardmsg; |
1589 | INIT_WORK(&cs->tqueue, (void *)(void *)hisax_bh, cs); | 1588 | INIT_WORK(&cs->tqueue, hisax_bh); |
1590 | cs->channel[0].d_st->l2.l2l1 = hisax_d_l2l1; | 1589 | cs->channel[0].d_st->l2.l2l1 = hisax_d_l2l1; |
1591 | for (i = 0; i < 2; i++) { | 1590 | for (i = 0; i < 2; i++) { |
1592 | cs->bcs[i].BC_SetStack = hisax_bc_setstack; | 1591 | cs->bcs[i].BC_SetStack = hisax_bc_setstack; |
@@ -1618,8 +1617,10 @@ static void hisax_sched_event(struct IsdnCardState *cs, int event) | |||
1618 | schedule_work(&cs->tqueue); | 1617 | schedule_work(&cs->tqueue); |
1619 | } | 1618 | } |
1620 | 1619 | ||
1621 | static void hisax_bh(struct IsdnCardState *cs) | 1620 | static void hisax_bh(struct work_struct *work) |
1622 | { | 1621 | { |
1622 | struct IsdnCardState *cs = | ||
1623 | container_of(work, struct IsdnCardState, tqueue); | ||
1623 | struct PStack *st; | 1624 | struct PStack *st; |
1624 | int pr; | 1625 | int pr; |
1625 | 1626 | ||
diff --git a/drivers/isdn/hisax/hfc4s8s_l1.c b/drivers/isdn/hisax/hfc4s8s_l1.c index d852c9d998b2..de9b1a4d6bac 100644 --- a/drivers/isdn/hisax/hfc4s8s_l1.c +++ b/drivers/isdn/hisax/hfc4s8s_l1.c | |||
@@ -1083,8 +1083,9 @@ tx_b_frame(struct hfc4s8s_btype *bch) | |||
1083 | /* bottom half handler for interrupt */ | 1083 | /* bottom half handler for interrupt */ |
1084 | /*************************************/ | 1084 | /*************************************/ |
1085 | static void | 1085 | static void |
1086 | hfc4s8s_bh(hfc4s8s_hw * hw) | 1086 | hfc4s8s_bh(struct work_struct *work) |
1087 | { | 1087 | { |
1088 | hfc4s8s_hw *hw = container_of(work, hfc4s8s_hw, tqueue); | ||
1088 | u_char b; | 1089 | u_char b; |
1089 | struct hfc4s8s_l1 *l1p; | 1090 | struct hfc4s8s_l1 *l1p; |
1090 | volatile u_char *fifo_stat; | 1091 | volatile u_char *fifo_stat; |
@@ -1550,7 +1551,7 @@ setup_instance(hfc4s8s_hw * hw) | |||
1550 | goto out; | 1551 | goto out; |
1551 | } | 1552 | } |
1552 | 1553 | ||
1553 | INIT_WORK(&hw->tqueue, (void *) (void *) hfc4s8s_bh, hw); | 1554 | INIT_WORK(&hw->tqueue, hfc4s8s_bh); |
1554 | 1555 | ||
1555 | if (request_irq | 1556 | if (request_irq |
1556 | (hw->irq, hfc4s8s_interrupt, IRQF_SHARED, hw->card_name, hw)) { | 1557 | (hw->irq, hfc4s8s_interrupt, IRQF_SHARED, hw->card_name, hw)) { |
diff --git a/drivers/isdn/hisax/hfc_2bds0.c b/drivers/isdn/hisax/hfc_2bds0.c index 6360e8214720..8d9864453a23 100644 --- a/drivers/isdn/hisax/hfc_2bds0.c +++ b/drivers/isdn/hisax/hfc_2bds0.c | |||
@@ -549,10 +549,11 @@ setstack_2b(struct PStack *st, struct BCState *bcs) | |||
549 | } | 549 | } |
550 | 550 | ||
551 | static void | 551 | static void |
552 | hfcd_bh(struct IsdnCardState *cs) | 552 | hfcd_bh(struct work_struct *work) |
553 | { | 553 | { |
554 | if (!cs) | 554 | struct IsdnCardState *cs = |
555 | return; | 555 | container_of(work, struct IsdnCardState, tqueue); |
556 | |||
556 | if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) { | 557 | if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) { |
557 | switch (cs->dc.hfcd.ph_state) { | 558 | switch (cs->dc.hfcd.ph_state) { |
558 | case (0): | 559 | case (0): |
@@ -1072,5 +1073,5 @@ set_cs_func(struct IsdnCardState *cs) | |||
1072 | cs->dbusytimer.function = (void *) hfc_dbusy_timer; | 1073 | cs->dbusytimer.function = (void *) hfc_dbusy_timer; |
1073 | cs->dbusytimer.data = (long) cs; | 1074 | cs->dbusytimer.data = (long) cs; |
1074 | init_timer(&cs->dbusytimer); | 1075 | init_timer(&cs->dbusytimer); |
1075 | INIT_WORK(&cs->tqueue, (void *)(void *) hfcd_bh, cs); | 1076 | INIT_WORK(&cs->tqueue, hfcd_bh); |
1076 | } | 1077 | } |
diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c index 93f60b563515..5db0a85b827f 100644 --- a/drivers/isdn/hisax/hfc_pci.c +++ b/drivers/isdn/hisax/hfc_pci.c | |||
@@ -1506,8 +1506,10 @@ setstack_2b(struct PStack *st, struct BCState *bcs) | |||
1506 | /* handle L1 state changes */ | 1506 | /* handle L1 state changes */ |
1507 | /***************************/ | 1507 | /***************************/ |
1508 | static void | 1508 | static void |
1509 | hfcpci_bh(struct IsdnCardState *cs) | 1509 | hfcpci_bh(struct work_struct *work) |
1510 | { | 1510 | { |
1511 | struct IsdnCardState *cs = | ||
1512 | container_of(work, struct IsdnCardState, tqueue); | ||
1511 | u_long flags; | 1513 | u_long flags; |
1512 | // struct PStack *stptr; | 1514 | // struct PStack *stptr; |
1513 | 1515 | ||
@@ -1722,7 +1724,7 @@ setup_hfcpci(struct IsdnCard *card) | |||
1722 | Write_hfc(cs, HFCPCI_INT_M2, cs->hw.hfcpci.int_m2); | 1724 | Write_hfc(cs, HFCPCI_INT_M2, cs->hw.hfcpci.int_m2); |
1723 | /* At this point the needed PCI config is done */ | 1725 | /* At this point the needed PCI config is done */ |
1724 | /* fifos are still not enabled */ | 1726 | /* fifos are still not enabled */ |
1725 | INIT_WORK(&cs->tqueue, (void *)(void *) hfcpci_bh, cs); | 1727 | INIT_WORK(&cs->tqueue, hfcpci_bh); |
1726 | cs->setstack_d = setstack_hfcpci; | 1728 | cs->setstack_d = setstack_hfcpci; |
1727 | cs->BC_Send_Data = &hfcpci_send_data; | 1729 | cs->BC_Send_Data = &hfcpci_send_data; |
1728 | cs->readisac = NULL; | 1730 | cs->readisac = NULL; |
diff --git a/drivers/isdn/hisax/hfc_sx.c b/drivers/isdn/hisax/hfc_sx.c index 954d1536db1f..4fd09d21a27f 100644 --- a/drivers/isdn/hisax/hfc_sx.c +++ b/drivers/isdn/hisax/hfc_sx.c | |||
@@ -1251,8 +1251,10 @@ setstack_2b(struct PStack *st, struct BCState *bcs) | |||
1251 | /* handle L1 state changes */ | 1251 | /* handle L1 state changes */ |
1252 | /***************************/ | 1252 | /***************************/ |
1253 | static void | 1253 | static void |
1254 | hfcsx_bh(struct IsdnCardState *cs) | 1254 | hfcsx_bh(struct work_struct *work) |
1255 | { | 1255 | { |
1256 | struct IsdnCardState *cs = | ||
1257 | container_of(work, struct IsdnCardState, tqueue); | ||
1256 | u_long flags; | 1258 | u_long flags; |
1257 | 1259 | ||
1258 | if (!cs) | 1260 | if (!cs) |
@@ -1499,7 +1501,7 @@ setup_hfcsx(struct IsdnCard *card) | |||
1499 | cs->dbusytimer.function = (void *) hfcsx_dbusy_timer; | 1501 | cs->dbusytimer.function = (void *) hfcsx_dbusy_timer; |
1500 | cs->dbusytimer.data = (long) cs; | 1502 | cs->dbusytimer.data = (long) cs; |
1501 | init_timer(&cs->dbusytimer); | 1503 | init_timer(&cs->dbusytimer); |
1502 | INIT_WORK(&cs->tqueue, (void *)(void *) hfcsx_bh, cs); | 1504 | INIT_WORK(&cs->tqueue, hfcsx_bh); |
1503 | cs->readisac = NULL; | 1505 | cs->readisac = NULL; |
1504 | cs->writeisac = NULL; | 1506 | cs->writeisac = NULL; |
1505 | cs->readisacfifo = NULL; | 1507 | cs->readisacfifo = NULL; |
diff --git a/drivers/isdn/hisax/icc.c b/drivers/isdn/hisax/icc.c index da706925d54d..682cac32f259 100644 --- a/drivers/isdn/hisax/icc.c +++ b/drivers/isdn/hisax/icc.c | |||
@@ -77,8 +77,10 @@ icc_new_ph(struct IsdnCardState *cs) | |||
77 | } | 77 | } |
78 | 78 | ||
79 | static void | 79 | static void |
80 | icc_bh(struct IsdnCardState *cs) | 80 | icc_bh(struct work_struct *work) |
81 | { | 81 | { |
82 | struct IsdnCardState *cs = | ||
83 | container_of(work, struct IsdnCardState, tqueue); | ||
82 | struct PStack *stptr; | 84 | struct PStack *stptr; |
83 | 85 | ||
84 | if (!cs) | 86 | if (!cs) |
@@ -674,7 +676,7 @@ clear_pending_icc_ints(struct IsdnCardState *cs) | |||
674 | void __devinit | 676 | void __devinit |
675 | setup_icc(struct IsdnCardState *cs) | 677 | setup_icc(struct IsdnCardState *cs) |
676 | { | 678 | { |
677 | INIT_WORK(&cs->tqueue, (void *)(void *) icc_bh, cs); | 679 | INIT_WORK(&cs->tqueue, icc_bh); |
678 | cs->dbusytimer.function = (void *) dbusy_timer_handler; | 680 | cs->dbusytimer.function = (void *) dbusy_timer_handler; |
679 | cs->dbusytimer.data = (long) cs; | 681 | cs->dbusytimer.data = (long) cs; |
680 | init_timer(&cs->dbusytimer); | 682 | init_timer(&cs->dbusytimer); |
diff --git a/drivers/isdn/hisax/isac.c b/drivers/isdn/hisax/isac.c index 282f349408bc..4e9f23803dae 100644 --- a/drivers/isdn/hisax/isac.c +++ b/drivers/isdn/hisax/isac.c | |||
@@ -81,8 +81,10 @@ isac_new_ph(struct IsdnCardState *cs) | |||
81 | } | 81 | } |
82 | 82 | ||
83 | static void | 83 | static void |
84 | isac_bh(struct IsdnCardState *cs) | 84 | isac_bh(struct work_struct *work) |
85 | { | 85 | { |
86 | struct IsdnCardState *cs = | ||
87 | container_of(work, struct IsdnCardState, tqueue); | ||
86 | struct PStack *stptr; | 88 | struct PStack *stptr; |
87 | 89 | ||
88 | if (!cs) | 90 | if (!cs) |
@@ -674,7 +676,7 @@ clear_pending_isac_ints(struct IsdnCardState *cs) | |||
674 | void __devinit | 676 | void __devinit |
675 | setup_isac(struct IsdnCardState *cs) | 677 | setup_isac(struct IsdnCardState *cs) |
676 | { | 678 | { |
677 | INIT_WORK(&cs->tqueue, (void *)(void *) isac_bh, cs); | 679 | INIT_WORK(&cs->tqueue, isac_bh); |
678 | cs->dbusytimer.function = (void *) dbusy_timer_handler; | 680 | cs->dbusytimer.function = (void *) dbusy_timer_handler; |
679 | cs->dbusytimer.data = (long) cs; | 681 | cs->dbusytimer.data = (long) cs; |
680 | init_timer(&cs->dbusytimer); | 682 | init_timer(&cs->dbusytimer); |
diff --git a/drivers/isdn/hisax/isar.c b/drivers/isdn/hisax/isar.c index 674af673ff96..6f1a6583b17d 100644 --- a/drivers/isdn/hisax/isar.c +++ b/drivers/isdn/hisax/isar.c | |||
@@ -437,8 +437,10 @@ extern void BChannel_bh(struct BCState *); | |||
437 | #define B_LL_OK 10 | 437 | #define B_LL_OK 10 |
438 | 438 | ||
439 | static void | 439 | static void |
440 | isar_bh(struct BCState *bcs) | 440 | isar_bh(struct work_struct *work) |
441 | { | 441 | { |
442 | struct BCState *bcs = container_of(work, struct BCState, tqueue); | ||
443 | |||
442 | BChannel_bh(bcs); | 444 | BChannel_bh(bcs); |
443 | if (test_and_clear_bit(B_LL_NOCARRIER, &bcs->event)) | 445 | if (test_and_clear_bit(B_LL_NOCARRIER, &bcs->event)) |
444 | ll_deliver_faxstat(bcs, ISDN_FAX_CLASS1_NOCARR); | 446 | ll_deliver_faxstat(bcs, ISDN_FAX_CLASS1_NOCARR); |
@@ -1580,7 +1582,7 @@ isar_setup(struct IsdnCardState *cs) | |||
1580 | cs->bcs[i].mode = 0; | 1582 | cs->bcs[i].mode = 0; |
1581 | cs->bcs[i].hw.isar.dpath = i + 1; | 1583 | cs->bcs[i].hw.isar.dpath = i + 1; |
1582 | modeisar(&cs->bcs[i], 0, 0); | 1584 | modeisar(&cs->bcs[i], 0, 0); |
1583 | INIT_WORK(&cs->bcs[i].tqueue, (void *)(void *) isar_bh, &cs->bcs[i]); | 1585 | INIT_WORK(&cs->bcs[i].tqueue, isar_bh); |
1584 | } | 1586 | } |
1585 | } | 1587 | } |
1586 | 1588 | ||
diff --git a/drivers/isdn/hisax/isdnl1.c b/drivers/isdn/hisax/isdnl1.c index bab356886483..a14204ec88ee 100644 --- a/drivers/isdn/hisax/isdnl1.c +++ b/drivers/isdn/hisax/isdnl1.c | |||
@@ -315,8 +315,10 @@ BChannel_proc_ack(struct BCState *bcs) | |||
315 | } | 315 | } |
316 | 316 | ||
317 | void | 317 | void |
318 | BChannel_bh(struct BCState *bcs) | 318 | BChannel_bh(struct work_struct *work) |
319 | { | 319 | { |
320 | struct BCState *bcs = container_of(work, struct BCState, tqueue); | ||
321 | |||
320 | if (!bcs) | 322 | if (!bcs) |
321 | return; | 323 | return; |
322 | if (test_and_clear_bit(B_RCVBUFREADY, &bcs->event)) | 324 | if (test_and_clear_bit(B_RCVBUFREADY, &bcs->event)) |
@@ -362,7 +364,7 @@ init_bcstate(struct IsdnCardState *cs, int bc) | |||
362 | 364 | ||
363 | bcs->cs = cs; | 365 | bcs->cs = cs; |
364 | bcs->channel = bc; | 366 | bcs->channel = bc; |
365 | INIT_WORK(&bcs->tqueue, (void *)(void *) BChannel_bh, bcs); | 367 | INIT_WORK(&bcs->tqueue, BChannel_bh); |
366 | spin_lock_init(&bcs->aclock); | 368 | spin_lock_init(&bcs->aclock); |
367 | bcs->BC_SetStack = NULL; | 369 | bcs->BC_SetStack = NULL; |
368 | bcs->BC_Close = NULL; | 370 | bcs->BC_Close = NULL; |
diff --git a/drivers/isdn/hisax/w6692.c b/drivers/isdn/hisax/w6692.c index 1655341797a9..3aeceaf9769e 100644 --- a/drivers/isdn/hisax/w6692.c +++ b/drivers/isdn/hisax/w6692.c | |||
@@ -101,8 +101,10 @@ W6692_new_ph(struct IsdnCardState *cs) | |||
101 | } | 101 | } |
102 | 102 | ||
103 | static void | 103 | static void |
104 | W6692_bh(struct IsdnCardState *cs) | 104 | W6692_bh(struct work_struct *work) |
105 | { | 105 | { |
106 | struct IsdnCardState *cs = | ||
107 | container_of(work, struct IsdnCardState, tqueue); | ||
106 | struct PStack *stptr; | 108 | struct PStack *stptr; |
107 | 109 | ||
108 | if (!cs) | 110 | if (!cs) |
@@ -1070,7 +1072,7 @@ setup_w6692(struct IsdnCard *card) | |||
1070 | id_list[cs->subtyp].card_name, cs->irq, | 1072 | id_list[cs->subtyp].card_name, cs->irq, |
1071 | cs->hw.w6692.iobase); | 1073 | cs->hw.w6692.iobase); |
1072 | 1074 | ||
1073 | INIT_WORK(&cs->tqueue, (void *)(void *) W6692_bh, cs); | 1075 | INIT_WORK(&cs->tqueue, W6692_bh); |
1074 | cs->readW6692 = &ReadW6692; | 1076 | cs->readW6692 = &ReadW6692; |
1075 | cs->writeW6692 = &WriteW6692; | 1077 | cs->writeW6692 = &WriteW6692; |
1076 | cs->readisacfifo = &ReadISACfifo; | 1078 | cs->readisacfifo = &ReadISACfifo; |
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c index 1f8d6ae66b41..2e4daebfb7e0 100644 --- a/drivers/isdn/i4l/isdn_net.c +++ b/drivers/isdn/i4l/isdn_net.c | |||
@@ -984,9 +984,9 @@ void isdn_net_write_super(isdn_net_local *lp, struct sk_buff *skb) | |||
984 | /* | 984 | /* |
985 | * called from tq_immediate | 985 | * called from tq_immediate |
986 | */ | 986 | */ |
987 | static void isdn_net_softint(void *private) | 987 | static void isdn_net_softint(struct work_struct *work) |
988 | { | 988 | { |
989 | isdn_net_local *lp = private; | 989 | isdn_net_local *lp = container_of(work, isdn_net_local, tqueue); |
990 | struct sk_buff *skb; | 990 | struct sk_buff *skb; |
991 | 991 | ||
992 | spin_lock_bh(&lp->xmit_lock); | 992 | spin_lock_bh(&lp->xmit_lock); |
@@ -2596,7 +2596,7 @@ isdn_net_new(char *name, struct net_device *master) | |||
2596 | netdev->local->netdev = netdev; | 2596 | netdev->local->netdev = netdev; |
2597 | netdev->local->next = netdev->local; | 2597 | netdev->local->next = netdev->local; |
2598 | 2598 | ||
2599 | INIT_WORK(&netdev->local->tqueue, (void *)(void *) isdn_net_softint, netdev->local); | 2599 | INIT_WORK(&netdev->local->tqueue, isdn_net_softint); |
2600 | spin_lock_init(&netdev->local->xmit_lock); | 2600 | spin_lock_init(&netdev->local->xmit_lock); |
2601 | 2601 | ||
2602 | netdev->local->isdn_device = -1; | 2602 | netdev->local->isdn_device = -1; |
diff --git a/drivers/isdn/pcbit/drv.c b/drivers/isdn/pcbit/drv.c index 6ead5e1508b7..1966f3410a13 100644 --- a/drivers/isdn/pcbit/drv.c +++ b/drivers/isdn/pcbit/drv.c | |||
@@ -68,8 +68,6 @@ static void pcbit_set_msn(struct pcbit_dev *dev, char *list); | |||
68 | static int pcbit_check_msn(struct pcbit_dev *dev, char *msn); | 68 | static int pcbit_check_msn(struct pcbit_dev *dev, char *msn); |
69 | 69 | ||
70 | 70 | ||
71 | extern void pcbit_deliver(void * data); | ||
72 | |||
73 | int pcbit_init_dev(int board, int mem_base, int irq) | 71 | int pcbit_init_dev(int board, int mem_base, int irq) |
74 | { | 72 | { |
75 | struct pcbit_dev *dev; | 73 | struct pcbit_dev *dev; |
@@ -129,7 +127,7 @@ int pcbit_init_dev(int board, int mem_base, int irq) | |||
129 | memset(dev->b2, 0, sizeof(struct pcbit_chan)); | 127 | memset(dev->b2, 0, sizeof(struct pcbit_chan)); |
130 | dev->b2->id = 1; | 128 | dev->b2->id = 1; |
131 | 129 | ||
132 | INIT_WORK(&dev->qdelivery, pcbit_deliver, dev); | 130 | INIT_WORK(&dev->qdelivery, pcbit_deliver); |
133 | 131 | ||
134 | /* | 132 | /* |
135 | * interrupts | 133 | * interrupts |
diff --git a/drivers/isdn/pcbit/layer2.c b/drivers/isdn/pcbit/layer2.c index 937fd2120381..0c9f6df873fc 100644 --- a/drivers/isdn/pcbit/layer2.c +++ b/drivers/isdn/pcbit/layer2.c | |||
@@ -67,7 +67,6 @@ extern void pcbit_l3_receive(struct pcbit_dev *dev, ulong msg, | |||
67 | * Prototypes | 67 | * Prototypes |
68 | */ | 68 | */ |
69 | 69 | ||
70 | void pcbit_deliver(void *data); | ||
71 | static void pcbit_transmit(struct pcbit_dev *dev); | 70 | static void pcbit_transmit(struct pcbit_dev *dev); |
72 | 71 | ||
73 | static void pcbit_recv_ack(struct pcbit_dev *dev, unsigned char ack); | 72 | static void pcbit_recv_ack(struct pcbit_dev *dev, unsigned char ack); |
@@ -299,11 +298,12 @@ pcbit_transmit(struct pcbit_dev *dev) | |||
299 | */ | 298 | */ |
300 | 299 | ||
301 | void | 300 | void |
302 | pcbit_deliver(void *data) | 301 | pcbit_deliver(struct work_struct *work) |
303 | { | 302 | { |
304 | struct frame_buf *frame; | 303 | struct frame_buf *frame; |
305 | unsigned long flags, msg; | 304 | unsigned long flags, msg; |
306 | struct pcbit_dev *dev = (struct pcbit_dev *) data; | 305 | struct pcbit_dev *dev = |
306 | container_of(work, struct pcbit_dev, qdelivery); | ||
307 | 307 | ||
308 | spin_lock_irqsave(&dev->lock, flags); | 308 | spin_lock_irqsave(&dev->lock, flags); |
309 | 309 | ||
diff --git a/drivers/isdn/pcbit/pcbit.h b/drivers/isdn/pcbit/pcbit.h index 388bacefd23a..19c18e88ff16 100644 --- a/drivers/isdn/pcbit/pcbit.h +++ b/drivers/isdn/pcbit/pcbit.h | |||
@@ -166,4 +166,6 @@ struct pcbit_ioctl { | |||
166 | #define L2_RUNNING 5 | 166 | #define L2_RUNNING 5 |
167 | #define L2_ERROR 6 | 167 | #define L2_ERROR 6 |
168 | 168 | ||
169 | extern void pcbit_deliver(struct work_struct *work); | ||
170 | |||
169 | #endif | 171 | #endif |
diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c index f1b6f563673a..5ed41fe84e57 100644 --- a/drivers/macintosh/rack-meter.c +++ b/drivers/macintosh/rack-meter.c | |||
@@ -48,7 +48,8 @@ struct rackmeter_dma { | |||
48 | } ____cacheline_aligned; | 48 | } ____cacheline_aligned; |
49 | 49 | ||
50 | struct rackmeter_cpu { | 50 | struct rackmeter_cpu { |
51 | struct work_struct sniffer; | 51 | struct delayed_work sniffer; |
52 | struct rackmeter *rm; | ||
52 | cputime64_t prev_wall; | 53 | cputime64_t prev_wall; |
53 | cputime64_t prev_idle; | 54 | cputime64_t prev_idle; |
54 | int zero; | 55 | int zero; |
@@ -208,11 +209,12 @@ static void rackmeter_setup_dbdma(struct rackmeter *rm) | |||
208 | rackmeter_do_pause(rm, 0); | 209 | rackmeter_do_pause(rm, 0); |
209 | } | 210 | } |
210 | 211 | ||
211 | static void rackmeter_do_timer(void *data) | 212 | static void rackmeter_do_timer(struct work_struct *work) |
212 | { | 213 | { |
213 | struct rackmeter *rm = data; | 214 | struct rackmeter_cpu *rcpu = |
215 | container_of(work, struct rackmeter_cpu, sniffer.work); | ||
216 | struct rackmeter *rm = rcpu->rm; | ||
214 | unsigned int cpu = smp_processor_id(); | 217 | unsigned int cpu = smp_processor_id(); |
215 | struct rackmeter_cpu *rcpu = &rm->cpu[cpu]; | ||
216 | cputime64_t cur_jiffies, total_idle_ticks; | 218 | cputime64_t cur_jiffies, total_idle_ticks; |
217 | unsigned int total_ticks, idle_ticks; | 219 | unsigned int total_ticks, idle_ticks; |
218 | int i, offset, load, cumm, pause; | 220 | int i, offset, load, cumm, pause; |
@@ -263,8 +265,10 @@ static void __devinit rackmeter_init_cpu_sniffer(struct rackmeter *rm) | |||
263 | * on those machines yet | 265 | * on those machines yet |
264 | */ | 266 | */ |
265 | 267 | ||
266 | INIT_WORK(&rm->cpu[0].sniffer, rackmeter_do_timer, rm); | 268 | rm->cpu[0].rm = rm; |
267 | INIT_WORK(&rm->cpu[1].sniffer, rackmeter_do_timer, rm); | 269 | INIT_DELAYED_WORK(&rm->cpu[0].sniffer, rackmeter_do_timer); |
270 | rm->cpu[1].rm = rm; | ||
271 | INIT_DELAYED_WORK(&rm->cpu[1].sniffer, rackmeter_do_timer); | ||
268 | 272 | ||
269 | for_each_online_cpu(cpu) { | 273 | for_each_online_cpu(cpu) { |
270 | struct rackmeter_cpu *rcpu; | 274 | struct rackmeter_cpu *rcpu; |
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index 4f724cdd2efa..6dde27ab79a8 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c | |||
@@ -601,7 +601,7 @@ core_initcall(smu_late_init); | |||
601 | * sysfs visibility | 601 | * sysfs visibility |
602 | */ | 602 | */ |
603 | 603 | ||
604 | static void smu_expose_childs(void *unused) | 604 | static void smu_expose_childs(struct work_struct *unused) |
605 | { | 605 | { |
606 | struct device_node *np; | 606 | struct device_node *np; |
607 | 607 | ||
@@ -611,7 +611,7 @@ static void smu_expose_childs(void *unused) | |||
611 | &smu->of_dev->dev); | 611 | &smu->of_dev->dev); |
612 | } | 612 | } |
613 | 613 | ||
614 | static DECLARE_WORK(smu_expose_childs_work, smu_expose_childs, NULL); | 614 | static DECLARE_WORK(smu_expose_childs_work, smu_expose_childs); |
615 | 615 | ||
616 | static int smu_platform_probe(struct of_device* dev, | 616 | static int smu_platform_probe(struct of_device* dev, |
617 | const struct of_device_id *match) | 617 | const struct of_device_id *match) |
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 08a40f4e4f60..ed2d4ef27fd8 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c | |||
@@ -458,11 +458,11 @@ static void dec_pending(struct crypt_io *io, int error) | |||
458 | * interrupt context. | 458 | * interrupt context. |
459 | */ | 459 | */ |
460 | static struct workqueue_struct *_kcryptd_workqueue; | 460 | static struct workqueue_struct *_kcryptd_workqueue; |
461 | static void kcryptd_do_work(void *data); | 461 | static void kcryptd_do_work(struct work_struct *work); |
462 | 462 | ||
463 | static void kcryptd_queue_io(struct crypt_io *io) | 463 | static void kcryptd_queue_io(struct crypt_io *io) |
464 | { | 464 | { |
465 | INIT_WORK(&io->work, kcryptd_do_work, io); | 465 | INIT_WORK(&io->work, kcryptd_do_work); |
466 | queue_work(_kcryptd_workqueue, &io->work); | 466 | queue_work(_kcryptd_workqueue, &io->work); |
467 | } | 467 | } |
468 | 468 | ||
@@ -618,9 +618,9 @@ static void process_read_endio(struct crypt_io *io) | |||
618 | dec_pending(io, crypt_convert(cc, &ctx)); | 618 | dec_pending(io, crypt_convert(cc, &ctx)); |
619 | } | 619 | } |
620 | 620 | ||
621 | static void kcryptd_do_work(void *data) | 621 | static void kcryptd_do_work(struct work_struct *work) |
622 | { | 622 | { |
623 | struct crypt_io *io = data; | 623 | struct crypt_io *io = container_of(work, struct crypt_io, work); |
624 | 624 | ||
625 | if (io->post_process) | 625 | if (io->post_process) |
626 | process_read_endio(io); | 626 | process_read_endio(io); |
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index d754e0bc6e90..e77ee6fd1044 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c | |||
@@ -104,8 +104,8 @@ typedef int (*action_fn) (struct pgpath *pgpath); | |||
104 | static kmem_cache_t *_mpio_cache; | 104 | static kmem_cache_t *_mpio_cache; |
105 | 105 | ||
106 | struct workqueue_struct *kmultipathd; | 106 | struct workqueue_struct *kmultipathd; |
107 | static void process_queued_ios(void *data); | 107 | static void process_queued_ios(struct work_struct *work); |
108 | static void trigger_event(void *data); | 108 | static void trigger_event(struct work_struct *work); |
109 | 109 | ||
110 | 110 | ||
111 | /*----------------------------------------------- | 111 | /*----------------------------------------------- |
@@ -173,8 +173,8 @@ static struct multipath *alloc_multipath(struct dm_target *ti) | |||
173 | INIT_LIST_HEAD(&m->priority_groups); | 173 | INIT_LIST_HEAD(&m->priority_groups); |
174 | spin_lock_init(&m->lock); | 174 | spin_lock_init(&m->lock); |
175 | m->queue_io = 1; | 175 | m->queue_io = 1; |
176 | INIT_WORK(&m->process_queued_ios, process_queued_ios, m); | 176 | INIT_WORK(&m->process_queued_ios, process_queued_ios); |
177 | INIT_WORK(&m->trigger_event, trigger_event, m); | 177 | INIT_WORK(&m->trigger_event, trigger_event); |
178 | m->mpio_pool = mempool_create_slab_pool(MIN_IOS, _mpio_cache); | 178 | m->mpio_pool = mempool_create_slab_pool(MIN_IOS, _mpio_cache); |
179 | if (!m->mpio_pool) { | 179 | if (!m->mpio_pool) { |
180 | kfree(m); | 180 | kfree(m); |
@@ -379,9 +379,10 @@ static void dispatch_queued_ios(struct multipath *m) | |||
379 | } | 379 | } |
380 | } | 380 | } |
381 | 381 | ||
382 | static void process_queued_ios(void *data) | 382 | static void process_queued_ios(struct work_struct *work) |
383 | { | 383 | { |
384 | struct multipath *m = (struct multipath *) data; | 384 | struct multipath *m = |
385 | container_of(work, struct multipath, process_queued_ios); | ||
385 | struct hw_handler *hwh = &m->hw_handler; | 386 | struct hw_handler *hwh = &m->hw_handler; |
386 | struct pgpath *pgpath = NULL; | 387 | struct pgpath *pgpath = NULL; |
387 | unsigned init_required = 0, must_queue = 1; | 388 | unsigned init_required = 0, must_queue = 1; |
@@ -421,9 +422,10 @@ out: | |||
421 | * An event is triggered whenever a path is taken out of use. | 422 | * An event is triggered whenever a path is taken out of use. |
422 | * Includes path failure and PG bypass. | 423 | * Includes path failure and PG bypass. |
423 | */ | 424 | */ |
424 | static void trigger_event(void *data) | 425 | static void trigger_event(struct work_struct *work) |
425 | { | 426 | { |
426 | struct multipath *m = (struct multipath *) data; | 427 | struct multipath *m = |
428 | container_of(work, struct multipath, trigger_event); | ||
427 | 429 | ||
428 | dm_table_event(m->ti->table); | 430 | dm_table_event(m->ti->table); |
429 | } | 431 | } |
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index 48a653b3f518..fc8cbb168e3e 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c | |||
@@ -883,7 +883,7 @@ static void do_mirror(struct mirror_set *ms) | |||
883 | do_writes(ms, &writes); | 883 | do_writes(ms, &writes); |
884 | } | 884 | } |
885 | 885 | ||
886 | static void do_work(void *ignored) | 886 | static void do_work(struct work_struct *ignored) |
887 | { | 887 | { |
888 | struct mirror_set *ms; | 888 | struct mirror_set *ms; |
889 | 889 | ||
@@ -1269,7 +1269,7 @@ static int __init dm_mirror_init(void) | |||
1269 | dm_dirty_log_exit(); | 1269 | dm_dirty_log_exit(); |
1270 | return r; | 1270 | return r; |
1271 | } | 1271 | } |
1272 | INIT_WORK(&_kmirrord_work, do_work, NULL); | 1272 | INIT_WORK(&_kmirrord_work, do_work); |
1273 | 1273 | ||
1274 | r = dm_register_target(&mirror_target); | 1274 | r = dm_register_target(&mirror_target); |
1275 | if (r < 0) { | 1275 | if (r < 0) { |
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 5281e0094072..91c7aa1fed0e 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c | |||
@@ -40,7 +40,7 @@ | |||
40 | #define SNAPSHOT_PAGES 256 | 40 | #define SNAPSHOT_PAGES 256 |
41 | 41 | ||
42 | struct workqueue_struct *ksnapd; | 42 | struct workqueue_struct *ksnapd; |
43 | static void flush_queued_bios(void *data); | 43 | static void flush_queued_bios(struct work_struct *work); |
44 | 44 | ||
45 | struct pending_exception { | 45 | struct pending_exception { |
46 | struct exception e; | 46 | struct exception e; |
@@ -528,7 +528,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
528 | } | 528 | } |
529 | 529 | ||
530 | bio_list_init(&s->queued_bios); | 530 | bio_list_init(&s->queued_bios); |
531 | INIT_WORK(&s->queued_bios_work, flush_queued_bios, s); | 531 | INIT_WORK(&s->queued_bios_work, flush_queued_bios); |
532 | 532 | ||
533 | /* Add snapshot to the list of snapshots for this origin */ | 533 | /* Add snapshot to the list of snapshots for this origin */ |
534 | /* Exceptions aren't triggered till snapshot_resume() is called */ | 534 | /* Exceptions aren't triggered till snapshot_resume() is called */ |
@@ -603,9 +603,10 @@ static void flush_bios(struct bio *bio) | |||
603 | } | 603 | } |
604 | } | 604 | } |
605 | 605 | ||
606 | static void flush_queued_bios(void *data) | 606 | static void flush_queued_bios(struct work_struct *work) |
607 | { | 607 | { |
608 | struct dm_snapshot *s = (struct dm_snapshot *) data; | 608 | struct dm_snapshot *s = |
609 | container_of(work, struct dm_snapshot, queued_bios_work); | ||
609 | struct bio *queued_bios; | 610 | struct bio *queued_bios; |
610 | unsigned long flags; | 611 | unsigned long flags; |
611 | 612 | ||
diff --git a/drivers/md/kcopyd.c b/drivers/md/kcopyd.c index f1db6eff4857..b3c01496c737 100644 --- a/drivers/md/kcopyd.c +++ b/drivers/md/kcopyd.c | |||
@@ -417,7 +417,7 @@ static int process_jobs(struct list_head *jobs, int (*fn) (struct kcopyd_job *)) | |||
417 | /* | 417 | /* |
418 | * kcopyd does this every time it's woken up. | 418 | * kcopyd does this every time it's woken up. |
419 | */ | 419 | */ |
420 | static void do_work(void *ignored) | 420 | static void do_work(struct work_struct *ignored) |
421 | { | 421 | { |
422 | /* | 422 | /* |
423 | * The order that these are called is *very* important. | 423 | * The order that these are called is *very* important. |
@@ -628,7 +628,7 @@ static int kcopyd_init(void) | |||
628 | } | 628 | } |
629 | 629 | ||
630 | kcopyd_clients++; | 630 | kcopyd_clients++; |
631 | INIT_WORK(&_kcopyd_work, do_work, NULL); | 631 | INIT_WORK(&_kcopyd_work, do_work); |
632 | mutex_unlock(&kcopyd_init_lock); | 632 | mutex_unlock(&kcopyd_init_lock); |
633 | return 0; | 633 | return 0; |
634 | } | 634 | } |
diff --git a/drivers/media/dvb/b2c2/flexcop-pci.c b/drivers/media/dvb/b2c2/flexcop-pci.c index 06893243f3d4..6e166801505d 100644 --- a/drivers/media/dvb/b2c2/flexcop-pci.c +++ b/drivers/media/dvb/b2c2/flexcop-pci.c | |||
@@ -63,7 +63,7 @@ struct flexcop_pci { | |||
63 | 63 | ||
64 | unsigned long last_irq; | 64 | unsigned long last_irq; |
65 | 65 | ||
66 | struct work_struct irq_check_work; | 66 | struct delayed_work irq_check_work; |
67 | 67 | ||
68 | struct flexcop_device *fc_dev; | 68 | struct flexcop_device *fc_dev; |
69 | }; | 69 | }; |
@@ -97,9 +97,10 @@ static int flexcop_pci_write_ibi_reg(struct flexcop_device *fc, flexcop_ibi_regi | |||
97 | return 0; | 97 | return 0; |
98 | } | 98 | } |
99 | 99 | ||
100 | static void flexcop_pci_irq_check_work(void *data) | 100 | static void flexcop_pci_irq_check_work(struct work_struct *work) |
101 | { | 101 | { |
102 | struct flexcop_pci *fc_pci = data; | 102 | struct flexcop_pci *fc_pci = |
103 | container_of(work, struct flexcop_pci, irq_check_work.work); | ||
103 | struct flexcop_device *fc = fc_pci->fc_dev; | 104 | struct flexcop_device *fc = fc_pci->fc_dev; |
104 | 105 | ||
105 | flexcop_ibi_value v = fc->read_ibi_reg(fc,sram_dest_reg_714); | 106 | flexcop_ibi_value v = fc->read_ibi_reg(fc,sram_dest_reg_714); |
@@ -371,7 +372,7 @@ static int flexcop_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
371 | if ((ret = flexcop_pci_dma_init(fc_pci)) != 0) | 372 | if ((ret = flexcop_pci_dma_init(fc_pci)) != 0) |
372 | goto err_fc_exit; | 373 | goto err_fc_exit; |
373 | 374 | ||
374 | INIT_WORK(&fc_pci->irq_check_work, flexcop_pci_irq_check_work, fc_pci); | 375 | INIT_DELAYED_WORK(&fc_pci->irq_check_work, flexcop_pci_irq_check_work); |
375 | 376 | ||
376 | return ret; | 377 | return ret; |
377 | 378 | ||
diff --git a/drivers/media/dvb/cinergyT2/cinergyT2.c b/drivers/media/dvb/cinergyT2/cinergyT2.c index 8a7dd507cf6e..206c13e47a06 100644 --- a/drivers/media/dvb/cinergyT2/cinergyT2.c +++ b/drivers/media/dvb/cinergyT2/cinergyT2.c | |||
@@ -128,7 +128,7 @@ struct cinergyt2 { | |||
128 | 128 | ||
129 | struct dvbt_set_parameters_msg param; | 129 | struct dvbt_set_parameters_msg param; |
130 | struct dvbt_get_status_msg status; | 130 | struct dvbt_get_status_msg status; |
131 | struct work_struct query_work; | 131 | struct delayed_work query_work; |
132 | 132 | ||
133 | wait_queue_head_t poll_wq; | 133 | wait_queue_head_t poll_wq; |
134 | int pending_fe_events; | 134 | int pending_fe_events; |
@@ -142,7 +142,7 @@ struct cinergyt2 { | |||
142 | #ifdef ENABLE_RC | 142 | #ifdef ENABLE_RC |
143 | struct input_dev *rc_input_dev; | 143 | struct input_dev *rc_input_dev; |
144 | char phys[64]; | 144 | char phys[64]; |
145 | struct work_struct rc_query_work; | 145 | struct delayed_work rc_query_work; |
146 | int rc_input_event; | 146 | int rc_input_event; |
147 | u32 rc_last_code; | 147 | u32 rc_last_code; |
148 | unsigned long last_event_jiffies; | 148 | unsigned long last_event_jiffies; |
@@ -723,9 +723,10 @@ static struct dvb_device cinergyt2_fe_template = { | |||
723 | 723 | ||
724 | #ifdef ENABLE_RC | 724 | #ifdef ENABLE_RC |
725 | 725 | ||
726 | static void cinergyt2_query_rc (void *data) | 726 | static void cinergyt2_query_rc (struct work_struct *work) |
727 | { | 727 | { |
728 | struct cinergyt2 *cinergyt2 = data; | 728 | struct cinergyt2 *cinergyt2 = |
729 | container_of(work, struct cinergyt2, rc_query_work.work); | ||
729 | char buf[1] = { CINERGYT2_EP1_GET_RC_EVENTS }; | 730 | char buf[1] = { CINERGYT2_EP1_GET_RC_EVENTS }; |
730 | struct cinergyt2_rc_event rc_events[12]; | 731 | struct cinergyt2_rc_event rc_events[12]; |
731 | int n, len, i; | 732 | int n, len, i; |
@@ -806,7 +807,7 @@ static int cinergyt2_register_rc(struct cinergyt2 *cinergyt2) | |||
806 | strlcat(cinergyt2->phys, "/input0", sizeof(cinergyt2->phys)); | 807 | strlcat(cinergyt2->phys, "/input0", sizeof(cinergyt2->phys)); |
807 | cinergyt2->rc_input_event = KEY_MAX; | 808 | cinergyt2->rc_input_event = KEY_MAX; |
808 | cinergyt2->rc_last_code = ~0; | 809 | cinergyt2->rc_last_code = ~0; |
809 | INIT_WORK(&cinergyt2->rc_query_work, cinergyt2_query_rc, cinergyt2); | 810 | INIT_DELAYED_WORK(&cinergyt2->rc_query_work, cinergyt2_query_rc); |
810 | 811 | ||
811 | input_dev->name = DRIVER_NAME " remote control"; | 812 | input_dev->name = DRIVER_NAME " remote control"; |
812 | input_dev->phys = cinergyt2->phys; | 813 | input_dev->phys = cinergyt2->phys; |
@@ -847,9 +848,10 @@ static inline void cinergyt2_resume_rc(struct cinergyt2 *cinergyt2) { } | |||
847 | 848 | ||
848 | #endif /* ENABLE_RC */ | 849 | #endif /* ENABLE_RC */ |
849 | 850 | ||
850 | static void cinergyt2_query (void *data) | 851 | static void cinergyt2_query (struct work_struct *work) |
851 | { | 852 | { |
852 | struct cinergyt2 *cinergyt2 = (struct cinergyt2 *) data; | 853 | struct cinergyt2 *cinergyt2 = |
854 | container_of(work, struct cinergyt2, query_work.work); | ||
853 | char cmd [] = { CINERGYT2_EP1_GET_TUNER_STATUS }; | 855 | char cmd [] = { CINERGYT2_EP1_GET_TUNER_STATUS }; |
854 | struct dvbt_get_status_msg *s = &cinergyt2->status; | 856 | struct dvbt_get_status_msg *s = &cinergyt2->status; |
855 | uint8_t lock_bits; | 857 | uint8_t lock_bits; |
@@ -893,7 +895,7 @@ static int cinergyt2_probe (struct usb_interface *intf, | |||
893 | 895 | ||
894 | mutex_init(&cinergyt2->sem); | 896 | mutex_init(&cinergyt2->sem); |
895 | init_waitqueue_head (&cinergyt2->poll_wq); | 897 | init_waitqueue_head (&cinergyt2->poll_wq); |
896 | INIT_WORK(&cinergyt2->query_work, cinergyt2_query, cinergyt2); | 898 | INIT_DELAYED_WORK(&cinergyt2->query_work, cinergyt2_query); |
897 | 899 | ||
898 | cinergyt2->udev = interface_to_usbdev(intf); | 900 | cinergyt2->udev = interface_to_usbdev(intf); |
899 | cinergyt2->param.cmd = CINERGYT2_EP1_SET_TUNER_PARAMETERS; | 901 | cinergyt2->param.cmd = CINERGYT2_EP1_SET_TUNER_PARAMETERS; |
diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c index 8859ab74f0fe..ebf4dc5190f6 100644 --- a/drivers/media/dvb/dvb-core/dvb_net.c +++ b/drivers/media/dvb/dvb-core/dvb_net.c | |||
@@ -127,6 +127,7 @@ struct dvb_net_priv { | |||
127 | int in_use; | 127 | int in_use; |
128 | struct net_device_stats stats; | 128 | struct net_device_stats stats; |
129 | u16 pid; | 129 | u16 pid; |
130 | struct net_device *net; | ||
130 | struct dvb_net *host; | 131 | struct dvb_net *host; |
131 | struct dmx_demux *demux; | 132 | struct dmx_demux *demux; |
132 | struct dmx_section_feed *secfeed; | 133 | struct dmx_section_feed *secfeed; |
@@ -1123,10 +1124,11 @@ static int dvb_set_mc_filter (struct net_device *dev, struct dev_mc_list *mc) | |||
1123 | } | 1124 | } |
1124 | 1125 | ||
1125 | 1126 | ||
1126 | static void wq_set_multicast_list (void *data) | 1127 | static void wq_set_multicast_list (struct work_struct *work) |
1127 | { | 1128 | { |
1128 | struct net_device *dev = data; | 1129 | struct dvb_net_priv *priv = |
1129 | struct dvb_net_priv *priv = dev->priv; | 1130 | container_of(work, struct dvb_net_priv, set_multicast_list_wq); |
1131 | struct net_device *dev = priv->net; | ||
1130 | 1132 | ||
1131 | dvb_net_feed_stop(dev); | 1133 | dvb_net_feed_stop(dev); |
1132 | priv->rx_mode = RX_MODE_UNI; | 1134 | priv->rx_mode = RX_MODE_UNI; |
@@ -1167,9 +1169,11 @@ static void dvb_net_set_multicast_list (struct net_device *dev) | |||
1167 | } | 1169 | } |
1168 | 1170 | ||
1169 | 1171 | ||
1170 | static void wq_restart_net_feed (void *data) | 1172 | static void wq_restart_net_feed (struct work_struct *work) |
1171 | { | 1173 | { |
1172 | struct net_device *dev = data; | 1174 | struct dvb_net_priv *priv = |
1175 | container_of(work, struct dvb_net_priv, restart_net_feed_wq); | ||
1176 | struct net_device *dev = priv->net; | ||
1173 | 1177 | ||
1174 | if (netif_running(dev)) { | 1178 | if (netif_running(dev)) { |
1175 | dvb_net_feed_stop(dev); | 1179 | dvb_net_feed_stop(dev); |
@@ -1276,6 +1280,7 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid, u8 feedtype) | |||
1276 | dvbnet->device[if_num] = net; | 1280 | dvbnet->device[if_num] = net; |
1277 | 1281 | ||
1278 | priv = net->priv; | 1282 | priv = net->priv; |
1283 | priv->net = net; | ||
1279 | priv->demux = dvbnet->demux; | 1284 | priv->demux = dvbnet->demux; |
1280 | priv->pid = pid; | 1285 | priv->pid = pid; |
1281 | priv->rx_mode = RX_MODE_UNI; | 1286 | priv->rx_mode = RX_MODE_UNI; |
@@ -1284,8 +1289,8 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid, u8 feedtype) | |||
1284 | priv->feedtype = feedtype; | 1289 | priv->feedtype = feedtype; |
1285 | reset_ule(priv); | 1290 | reset_ule(priv); |
1286 | 1291 | ||
1287 | INIT_WORK(&priv->set_multicast_list_wq, wq_set_multicast_list, net); | 1292 | INIT_WORK(&priv->set_multicast_list_wq, wq_set_multicast_list); |
1288 | INIT_WORK(&priv->restart_net_feed_wq, wq_restart_net_feed, net); | 1293 | INIT_WORK(&priv->restart_net_feed_wq, wq_restart_net_feed); |
1289 | mutex_init(&priv->mutex); | 1294 | mutex_init(&priv->mutex); |
1290 | 1295 | ||
1291 | net->base_addr = pid; | 1296 | net->base_addr = pid; |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-remote.c b/drivers/media/dvb/dvb-usb/dvb-usb-remote.c index 0a3a0b6c2350..794e4471561c 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-remote.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-remote.c | |||
@@ -13,9 +13,10 @@ | |||
13 | * | 13 | * |
14 | * TODO: Fix the repeat rate of the input device. | 14 | * TODO: Fix the repeat rate of the input device. |
15 | */ | 15 | */ |
16 | static void dvb_usb_read_remote_control(void *data) | 16 | static void dvb_usb_read_remote_control(struct work_struct *work) |
17 | { | 17 | { |
18 | struct dvb_usb_device *d = data; | 18 | struct dvb_usb_device *d = |
19 | container_of(work, struct dvb_usb_device, rc_query_work.work); | ||
19 | u32 event; | 20 | u32 event; |
20 | int state; | 21 | int state; |
21 | 22 | ||
@@ -128,7 +129,7 @@ int dvb_usb_remote_init(struct dvb_usb_device *d) | |||
128 | 129 | ||
129 | input_register_device(d->rc_input_dev); | 130 | input_register_device(d->rc_input_dev); |
130 | 131 | ||
131 | INIT_WORK(&d->rc_query_work, dvb_usb_read_remote_control, d); | 132 | INIT_DELAYED_WORK(&d->rc_query_work, dvb_usb_read_remote_control); |
132 | 133 | ||
133 | info("schedule remote query interval to %d msecs.", d->props.rc_interval); | 134 | info("schedule remote query interval to %d msecs.", d->props.rc_interval); |
134 | schedule_delayed_work(&d->rc_query_work,msecs_to_jiffies(d->props.rc_interval)); | 135 | schedule_delayed_work(&d->rc_query_work,msecs_to_jiffies(d->props.rc_interval)); |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h index 376c45a8e779..0d721731a524 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb.h | |||
@@ -369,7 +369,7 @@ struct dvb_usb_device { | |||
369 | /* remote control */ | 369 | /* remote control */ |
370 | struct input_dev *rc_input_dev; | 370 | struct input_dev *rc_input_dev; |
371 | char rc_phys[64]; | 371 | char rc_phys[64]; |
372 | struct work_struct rc_query_work; | 372 | struct delayed_work rc_query_work; |
373 | u32 last_event; | 373 | u32 last_event; |
374 | int last_state; | 374 | int last_state; |
375 | 375 | ||
diff --git a/drivers/media/video/cpia_pp.c b/drivers/media/video/cpia_pp.c index 41f4b8d17559..b12cec94f4cc 100644 --- a/drivers/media/video/cpia_pp.c +++ b/drivers/media/video/cpia_pp.c | |||
@@ -82,6 +82,8 @@ struct pp_cam_entry { | |||
82 | struct pardevice *pdev; | 82 | struct pardevice *pdev; |
83 | struct parport *port; | 83 | struct parport *port; |
84 | struct work_struct cb_task; | 84 | struct work_struct cb_task; |
85 | void (*cb_func)(void *cbdata); | ||
86 | void *cb_data; | ||
85 | int open_count; | 87 | int open_count; |
86 | wait_queue_head_t wq_stream; | 88 | wait_queue_head_t wq_stream; |
87 | /* image state flags */ | 89 | /* image state flags */ |
@@ -130,6 +132,20 @@ static void cpia_parport_disable_irq( struct parport *port ) { | |||
130 | #define PARPORT_CHUNK_SIZE PAGE_SIZE | 132 | #define PARPORT_CHUNK_SIZE PAGE_SIZE |
131 | 133 | ||
132 | 134 | ||
135 | static void cpia_pp_run_callback(struct work_struct *work) | ||
136 | { | ||
137 | void (*cb_func)(void *cbdata); | ||
138 | void *cb_data; | ||
139 | struct pp_cam_entry *cam; | ||
140 | |||
141 | cam = container_of(work, struct pp_cam_entry, cb_task); | ||
142 | cb_func = cam->cb_func; | ||
143 | cb_data = cam->cb_data; | ||
144 | work_release(work); | ||
145 | |||
146 | cb_func(cb_data); | ||
147 | } | ||
148 | |||
133 | /**************************************************************************** | 149 | /**************************************************************************** |
134 | * | 150 | * |
135 | * CPiA-specific low-level parport functions for nibble uploads | 151 | * CPiA-specific low-level parport functions for nibble uploads |
@@ -664,7 +680,9 @@ static int cpia_pp_registerCallback(void *privdata, void (*cb)(void *cbdata), vo | |||
664 | int retval = 0; | 680 | int retval = 0; |
665 | 681 | ||
666 | if(cam->port->irq != PARPORT_IRQ_NONE) { | 682 | if(cam->port->irq != PARPORT_IRQ_NONE) { |
667 | INIT_WORK(&cam->cb_task, cb, cbdata); | 683 | cam->cb_func = cb; |
684 | cam->cb_data = cbdata; | ||
685 | INIT_WORK_NAR(&cam->cb_task, cpia_pp_run_callback); | ||
668 | } else { | 686 | } else { |
669 | retval = -1; | 687 | retval = -1; |
670 | } | 688 | } |
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c index 57e1c024a547..e60a0a52e4b2 100644 --- a/drivers/media/video/cx88/cx88-input.c +++ b/drivers/media/video/cx88/cx88-input.c | |||
@@ -145,9 +145,9 @@ static void ir_timer(unsigned long data) | |||
145 | schedule_work(&ir->work); | 145 | schedule_work(&ir->work); |
146 | } | 146 | } |
147 | 147 | ||
148 | static void cx88_ir_work(void *data) | 148 | static void cx88_ir_work(struct work_struct *work) |
149 | { | 149 | { |
150 | struct cx88_IR *ir = data; | 150 | struct cx88_IR *ir = container_of(work, struct cx88_IR, work); |
151 | unsigned long timeout; | 151 | unsigned long timeout; |
152 | 152 | ||
153 | cx88_ir_handle_key(ir); | 153 | cx88_ir_handle_key(ir); |
@@ -308,7 +308,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) | |||
308 | core->ir = ir; | 308 | core->ir = ir; |
309 | 309 | ||
310 | if (ir->polling) { | 310 | if (ir->polling) { |
311 | INIT_WORK(&ir->work, cx88_ir_work, ir); | 311 | INIT_WORK(&ir->work, cx88_ir_work); |
312 | init_timer(&ir->timer); | 312 | init_timer(&ir->timer); |
313 | ir->timer.function = ir_timer; | 313 | ir->timer.function = ir_timer; |
314 | ir->timer.data = (unsigned long)ir; | 314 | ir->timer.data = (unsigned long)ir; |
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c index 1457b1602221..ab87e7bfe84f 100644 --- a/drivers/media/video/ir-kbd-i2c.c +++ b/drivers/media/video/ir-kbd-i2c.c | |||
@@ -268,9 +268,9 @@ static void ir_timer(unsigned long data) | |||
268 | schedule_work(&ir->work); | 268 | schedule_work(&ir->work); |
269 | } | 269 | } |
270 | 270 | ||
271 | static void ir_work(void *data) | 271 | static void ir_work(struct work_struct *work) |
272 | { | 272 | { |
273 | struct IR_i2c *ir = data; | 273 | struct IR_i2c *ir = container_of(work, struct IR_i2c, work); |
274 | ir_key_poll(ir); | 274 | ir_key_poll(ir); |
275 | mod_timer(&ir->timer, jiffies+HZ/10); | 275 | mod_timer(&ir->timer, jiffies+HZ/10); |
276 | } | 276 | } |
@@ -400,7 +400,7 @@ static int ir_attach(struct i2c_adapter *adap, int addr, | |||
400 | ir->input->name,ir->input->phys,adap->name); | 400 | ir->input->name,ir->input->phys,adap->name); |
401 | 401 | ||
402 | /* start polling via eventd */ | 402 | /* start polling via eventd */ |
403 | INIT_WORK(&ir->work, ir_work, ir); | 403 | INIT_WORK(&ir->work, ir_work); |
404 | init_timer(&ir->timer); | 404 | init_timer(&ir->timer); |
405 | ir->timer.function = ir_timer; | 405 | ir->timer.function = ir_timer; |
406 | ir->timer.data = (unsigned long)ir; | 406 | ir->timer.data = (unsigned long)ir; |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-context.c b/drivers/media/video/pvrusb2/pvrusb2-context.c index f129f316d20e..cf129746205d 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-context.c +++ b/drivers/media/video/pvrusb2/pvrusb2-context.c | |||
@@ -45,16 +45,21 @@ static void pvr2_context_trigger_poll(struct pvr2_context *mp) | |||
45 | } | 45 | } |
46 | 46 | ||
47 | 47 | ||
48 | static void pvr2_context_poll(struct pvr2_context *mp) | 48 | static void pvr2_context_poll(struct work_struct *work) |
49 | { | 49 | { |
50 | struct pvr2_context *mp = | ||
51 | container_of(work, struct pvr2_context, workpoll); | ||
50 | pvr2_context_enter(mp); do { | 52 | pvr2_context_enter(mp); do { |
51 | pvr2_hdw_poll(mp->hdw); | 53 | pvr2_hdw_poll(mp->hdw); |
52 | } while (0); pvr2_context_exit(mp); | 54 | } while (0); pvr2_context_exit(mp); |
53 | } | 55 | } |
54 | 56 | ||
55 | 57 | ||
56 | static void pvr2_context_setup(struct pvr2_context *mp) | 58 | static void pvr2_context_setup(struct work_struct *work) |
57 | { | 59 | { |
60 | struct pvr2_context *mp = | ||
61 | container_of(work, struct pvr2_context, workinit); | ||
62 | |||
58 | pvr2_context_enter(mp); do { | 63 | pvr2_context_enter(mp); do { |
59 | if (!pvr2_hdw_dev_ok(mp->hdw)) break; | 64 | if (!pvr2_hdw_dev_ok(mp->hdw)) break; |
60 | pvr2_hdw_setup(mp->hdw); | 65 | pvr2_hdw_setup(mp->hdw); |
@@ -92,8 +97,8 @@ struct pvr2_context *pvr2_context_create( | |||
92 | } | 97 | } |
93 | 98 | ||
94 | mp->workqueue = create_singlethread_workqueue("pvrusb2"); | 99 | mp->workqueue = create_singlethread_workqueue("pvrusb2"); |
95 | INIT_WORK(&mp->workinit,(void (*)(void*))pvr2_context_setup,mp); | 100 | INIT_WORK(&mp->workinit, pvr2_context_setup); |
96 | INIT_WORK(&mp->workpoll,(void (*)(void*))pvr2_context_poll,mp); | 101 | INIT_WORK(&mp->workpoll, pvr2_context_poll); |
97 | queue_work(mp->workqueue,&mp->workinit); | 102 | queue_work(mp->workqueue,&mp->workinit); |
98 | done: | 103 | done: |
99 | return mp; | 104 | return mp; |
diff --git a/drivers/media/video/saa6588.c b/drivers/media/video/saa6588.c index 7b9859c33018..92eabf88a09b 100644 --- a/drivers/media/video/saa6588.c +++ b/drivers/media/video/saa6588.c | |||
@@ -324,9 +324,9 @@ static void saa6588_timer(unsigned long data) | |||
324 | schedule_work(&s->work); | 324 | schedule_work(&s->work); |
325 | } | 325 | } |
326 | 326 | ||
327 | static void saa6588_work(void *data) | 327 | static void saa6588_work(struct work_struct *work) |
328 | { | 328 | { |
329 | struct saa6588 *s = (struct saa6588 *)data; | 329 | struct saa6588 *s = container_of(work, struct saa6588, work); |
330 | 330 | ||
331 | saa6588_i2c_poll(s); | 331 | saa6588_i2c_poll(s); |
332 | mod_timer(&s->timer, jiffies + msecs_to_jiffies(20)); | 332 | mod_timer(&s->timer, jiffies + msecs_to_jiffies(20)); |
@@ -419,7 +419,7 @@ static int saa6588_attach(struct i2c_adapter *adap, int addr, int kind) | |||
419 | saa6588_configure(s); | 419 | saa6588_configure(s); |
420 | 420 | ||
421 | /* start polling via eventd */ | 421 | /* start polling via eventd */ |
422 | INIT_WORK(&s->work, saa6588_work, s); | 422 | INIT_WORK(&s->work, saa6588_work); |
423 | init_timer(&s->timer); | 423 | init_timer(&s->timer); |
424 | s->timer.function = saa6588_timer; | 424 | s->timer.function = saa6588_timer; |
425 | s->timer.data = (unsigned long)s; | 425 | s->timer.data = (unsigned long)s; |
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c index 65d044086ce9..daaae870a2c4 100644 --- a/drivers/media/video/saa7134/saa7134-empress.c +++ b/drivers/media/video/saa7134/saa7134-empress.c | |||
@@ -343,9 +343,10 @@ static struct video_device saa7134_empress_template = | |||
343 | .minor = -1, | 343 | .minor = -1, |
344 | }; | 344 | }; |
345 | 345 | ||
346 | static void empress_signal_update(void* data) | 346 | static void empress_signal_update(struct work_struct *work) |
347 | { | 347 | { |
348 | struct saa7134_dev* dev = (struct saa7134_dev*) data; | 348 | struct saa7134_dev* dev = |
349 | container_of(work, struct saa7134_dev, empress_workqueue); | ||
349 | 350 | ||
350 | if (dev->nosignal) { | 351 | if (dev->nosignal) { |
351 | dprintk("no video signal\n"); | 352 | dprintk("no video signal\n"); |
@@ -378,7 +379,7 @@ static int empress_init(struct saa7134_dev *dev) | |||
378 | "%s empress (%s)", dev->name, | 379 | "%s empress (%s)", dev->name, |
379 | saa7134_boards[dev->board].name); | 380 | saa7134_boards[dev->board].name); |
380 | 381 | ||
381 | INIT_WORK(&dev->empress_workqueue, empress_signal_update, (void*) dev); | 382 | INIT_WORK(&dev->empress_workqueue, empress_signal_update); |
382 | 383 | ||
383 | err = video_register_device(dev->empress_dev,VFL_TYPE_GRABBER, | 384 | err = video_register_device(dev->empress_dev,VFL_TYPE_GRABBER, |
384 | empress_nr[dev->nr]); | 385 | empress_nr[dev->nr]); |
@@ -399,7 +400,7 @@ static int empress_init(struct saa7134_dev *dev) | |||
399 | sizeof(struct saa7134_buf), | 400 | sizeof(struct saa7134_buf), |
400 | dev); | 401 | dev); |
401 | 402 | ||
402 | empress_signal_update(dev); | 403 | empress_signal_update(&dev->empress_workqueue); |
403 | return 0; | 404 | return 0; |
404 | } | 405 | } |
405 | 406 | ||
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index 1dd491773150..ef2b55e19910 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c | |||
@@ -1018,9 +1018,10 @@ mptfc_init_host_attr(MPT_ADAPTER *ioc,int portnum) | |||
1018 | } | 1018 | } |
1019 | 1019 | ||
1020 | static void | 1020 | static void |
1021 | mptfc_setup_reset(void *arg) | 1021 | mptfc_setup_reset(struct work_struct *work) |
1022 | { | 1022 | { |
1023 | MPT_ADAPTER *ioc = (MPT_ADAPTER *)arg; | 1023 | MPT_ADAPTER *ioc = |
1024 | container_of(work, MPT_ADAPTER, fc_setup_reset_work); | ||
1024 | u64 pn; | 1025 | u64 pn; |
1025 | struct mptfc_rport_info *ri; | 1026 | struct mptfc_rport_info *ri; |
1026 | 1027 | ||
@@ -1043,9 +1044,10 @@ mptfc_setup_reset(void *arg) | |||
1043 | } | 1044 | } |
1044 | 1045 | ||
1045 | static void | 1046 | static void |
1046 | mptfc_rescan_devices(void *arg) | 1047 | mptfc_rescan_devices(struct work_struct *work) |
1047 | { | 1048 | { |
1048 | MPT_ADAPTER *ioc = (MPT_ADAPTER *)arg; | 1049 | MPT_ADAPTER *ioc = |
1050 | container_of(work, MPT_ADAPTER, fc_rescan_work); | ||
1049 | int ii; | 1051 | int ii; |
1050 | u64 pn; | 1052 | u64 pn; |
1051 | struct mptfc_rport_info *ri; | 1053 | struct mptfc_rport_info *ri; |
@@ -1154,8 +1156,8 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1154 | } | 1156 | } |
1155 | 1157 | ||
1156 | spin_lock_init(&ioc->fc_rescan_work_lock); | 1158 | spin_lock_init(&ioc->fc_rescan_work_lock); |
1157 | INIT_WORK(&ioc->fc_rescan_work, mptfc_rescan_devices,(void *)ioc); | 1159 | INIT_WORK(&ioc->fc_rescan_work, mptfc_rescan_devices); |
1158 | INIT_WORK(&ioc->fc_setup_reset_work, mptfc_setup_reset, (void *)ioc); | 1160 | INIT_WORK(&ioc->fc_setup_reset_work, mptfc_setup_reset); |
1159 | 1161 | ||
1160 | spin_lock_irqsave(&ioc->FreeQlock, flags); | 1162 | spin_lock_irqsave(&ioc->FreeQlock, flags); |
1161 | 1163 | ||
diff --git a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c index 314c3a27585d..b7c4407c5e3f 100644 --- a/drivers/message/fusion/mptlan.c +++ b/drivers/message/fusion/mptlan.c | |||
@@ -111,7 +111,8 @@ struct mpt_lan_priv { | |||
111 | u32 total_received; | 111 | u32 total_received; |
112 | struct net_device_stats stats; /* Per device statistics */ | 112 | struct net_device_stats stats; /* Per device statistics */ |
113 | 113 | ||
114 | struct work_struct post_buckets_task; | 114 | struct delayed_work post_buckets_task; |
115 | struct net_device *dev; | ||
115 | unsigned long post_buckets_active; | 116 | unsigned long post_buckets_active; |
116 | }; | 117 | }; |
117 | 118 | ||
@@ -132,7 +133,7 @@ static int lan_reply (MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, | |||
132 | static int mpt_lan_open(struct net_device *dev); | 133 | static int mpt_lan_open(struct net_device *dev); |
133 | static int mpt_lan_reset(struct net_device *dev); | 134 | static int mpt_lan_reset(struct net_device *dev); |
134 | static int mpt_lan_close(struct net_device *dev); | 135 | static int mpt_lan_close(struct net_device *dev); |
135 | static void mpt_lan_post_receive_buckets(void *dev_id); | 136 | static void mpt_lan_post_receive_buckets(struct mpt_lan_priv *priv); |
136 | static void mpt_lan_wake_post_buckets_task(struct net_device *dev, | 137 | static void mpt_lan_wake_post_buckets_task(struct net_device *dev, |
137 | int priority); | 138 | int priority); |
138 | static int mpt_lan_receive_post_turbo(struct net_device *dev, u32 tmsg); | 139 | static int mpt_lan_receive_post_turbo(struct net_device *dev, u32 tmsg); |
@@ -345,7 +346,7 @@ mpt_lan_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) | |||
345 | priv->mpt_rxfidx[++priv->mpt_rxfidx_tail] = i; | 346 | priv->mpt_rxfidx[++priv->mpt_rxfidx_tail] = i; |
346 | spin_unlock_irqrestore(&priv->rxfidx_lock, flags); | 347 | spin_unlock_irqrestore(&priv->rxfidx_lock, flags); |
347 | } else { | 348 | } else { |
348 | mpt_lan_post_receive_buckets(dev); | 349 | mpt_lan_post_receive_buckets(priv); |
349 | netif_wake_queue(dev); | 350 | netif_wake_queue(dev); |
350 | } | 351 | } |
351 | 352 | ||
@@ -441,7 +442,7 @@ mpt_lan_open(struct net_device *dev) | |||
441 | 442 | ||
442 | dlprintk((KERN_INFO MYNAM "/lo: Finished initializing RcvCtl\n")); | 443 | dlprintk((KERN_INFO MYNAM "/lo: Finished initializing RcvCtl\n")); |
443 | 444 | ||
444 | mpt_lan_post_receive_buckets(dev); | 445 | mpt_lan_post_receive_buckets(priv); |
445 | printk(KERN_INFO MYNAM ": %s/%s: interface up & active\n", | 446 | printk(KERN_INFO MYNAM ": %s/%s: interface up & active\n", |
446 | IOC_AND_NETDEV_NAMES_s_s(dev)); | 447 | IOC_AND_NETDEV_NAMES_s_s(dev)); |
447 | 448 | ||
@@ -854,7 +855,7 @@ mpt_lan_wake_post_buckets_task(struct net_device *dev, int priority) | |||
854 | 855 | ||
855 | if (test_and_set_bit(0, &priv->post_buckets_active) == 0) { | 856 | if (test_and_set_bit(0, &priv->post_buckets_active) == 0) { |
856 | if (priority) { | 857 | if (priority) { |
857 | schedule_work(&priv->post_buckets_task); | 858 | schedule_delayed_work(&priv->post_buckets_task, 0); |
858 | } else { | 859 | } else { |
859 | schedule_delayed_work(&priv->post_buckets_task, 1); | 860 | schedule_delayed_work(&priv->post_buckets_task, 1); |
860 | dioprintk((KERN_INFO MYNAM ": post_buckets queued on " | 861 | dioprintk((KERN_INFO MYNAM ": post_buckets queued on " |
@@ -1188,10 +1189,9 @@ mpt_lan_receive_post_reply(struct net_device *dev, | |||
1188 | /* Simple SGE's only at the moment */ | 1189 | /* Simple SGE's only at the moment */ |
1189 | 1190 | ||
1190 | static void | 1191 | static void |
1191 | mpt_lan_post_receive_buckets(void *dev_id) | 1192 | mpt_lan_post_receive_buckets(struct mpt_lan_priv *priv) |
1192 | { | 1193 | { |
1193 | struct net_device *dev = dev_id; | 1194 | struct net_device *dev = priv->dev; |
1194 | struct mpt_lan_priv *priv = dev->priv; | ||
1195 | MPT_ADAPTER *mpt_dev = priv->mpt_dev; | 1195 | MPT_ADAPTER *mpt_dev = priv->mpt_dev; |
1196 | MPT_FRAME_HDR *mf; | 1196 | MPT_FRAME_HDR *mf; |
1197 | LANReceivePostRequest_t *pRecvReq; | 1197 | LANReceivePostRequest_t *pRecvReq; |
@@ -1335,6 +1335,13 @@ out: | |||
1335 | clear_bit(0, &priv->post_buckets_active); | 1335 | clear_bit(0, &priv->post_buckets_active); |
1336 | } | 1336 | } |
1337 | 1337 | ||
1338 | static void | ||
1339 | mpt_lan_post_receive_buckets_work(struct work_struct *work) | ||
1340 | { | ||
1341 | mpt_lan_post_receive_buckets(container_of(work, struct mpt_lan_priv, | ||
1342 | post_buckets_task.work)); | ||
1343 | } | ||
1344 | |||
1338 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 1345 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
1339 | static struct net_device * | 1346 | static struct net_device * |
1340 | mpt_register_lan_device (MPT_ADAPTER *mpt_dev, int pnum) | 1347 | mpt_register_lan_device (MPT_ADAPTER *mpt_dev, int pnum) |
@@ -1350,11 +1357,13 @@ mpt_register_lan_device (MPT_ADAPTER *mpt_dev, int pnum) | |||
1350 | 1357 | ||
1351 | priv = netdev_priv(dev); | 1358 | priv = netdev_priv(dev); |
1352 | 1359 | ||
1360 | priv->dev = dev; | ||
1353 | priv->mpt_dev = mpt_dev; | 1361 | priv->mpt_dev = mpt_dev; |
1354 | priv->pnum = pnum; | 1362 | priv->pnum = pnum; |
1355 | 1363 | ||
1356 | memset(&priv->post_buckets_task, 0, sizeof(struct work_struct)); | 1364 | memset(&priv->post_buckets_task, 0, sizeof(priv->post_buckets_task)); |
1357 | INIT_WORK(&priv->post_buckets_task, mpt_lan_post_receive_buckets, dev); | 1365 | INIT_DELAYED_WORK(&priv->post_buckets_task, |
1366 | mpt_lan_post_receive_buckets_work); | ||
1358 | priv->post_buckets_active = 0; | 1367 | priv->post_buckets_active = 0; |
1359 | 1368 | ||
1360 | dlprintk((KERN_INFO MYNAM "@%d: bucketlen = %d\n", | 1369 | dlprintk((KERN_INFO MYNAM "@%d: bucketlen = %d\n", |
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index b752a479f6db..4f0c530e47b0 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c | |||
@@ -2006,9 +2006,10 @@ __mptsas_discovery_work(MPT_ADAPTER *ioc) | |||
2006 | *(Mutex LOCKED) | 2006 | *(Mutex LOCKED) |
2007 | */ | 2007 | */ |
2008 | static void | 2008 | static void |
2009 | mptsas_discovery_work(void * arg) | 2009 | mptsas_discovery_work(struct work_struct *work) |
2010 | { | 2010 | { |
2011 | struct mptsas_discovery_event *ev = arg; | 2011 | struct mptsas_discovery_event *ev = |
2012 | container_of(work, struct mptsas_discovery_event, work); | ||
2012 | MPT_ADAPTER *ioc = ev->ioc; | 2013 | MPT_ADAPTER *ioc = ev->ioc; |
2013 | 2014 | ||
2014 | mutex_lock(&ioc->sas_discovery_mutex); | 2015 | mutex_lock(&ioc->sas_discovery_mutex); |
@@ -2068,9 +2069,9 @@ mptsas_find_phyinfo_by_target(MPT_ADAPTER *ioc, u32 id) | |||
2068 | * Work queue thread to clear the persitency table | 2069 | * Work queue thread to clear the persitency table |
2069 | */ | 2070 | */ |
2070 | static void | 2071 | static void |
2071 | mptsas_persist_clear_table(void * arg) | 2072 | mptsas_persist_clear_table(struct work_struct *work) |
2072 | { | 2073 | { |
2073 | MPT_ADAPTER *ioc = (MPT_ADAPTER *)arg; | 2074 | MPT_ADAPTER *ioc = container_of(work, MPT_ADAPTER, sas_persist_task); |
2074 | 2075 | ||
2075 | mptbase_sas_persist_operation(ioc, MPI_SAS_OP_CLEAR_NOT_PRESENT); | 2076 | mptbase_sas_persist_operation(ioc, MPI_SAS_OP_CLEAR_NOT_PRESENT); |
2076 | } | 2077 | } |
@@ -2093,9 +2094,10 @@ mptsas_reprobe_target(struct scsi_target *starget, int uld_attach) | |||
2093 | * Work queue thread to handle SAS hotplug events | 2094 | * Work queue thread to handle SAS hotplug events |
2094 | */ | 2095 | */ |
2095 | static void | 2096 | static void |
2096 | mptsas_hotplug_work(void *arg) | 2097 | mptsas_hotplug_work(struct work_struct *work) |
2097 | { | 2098 | { |
2098 | struct mptsas_hotplug_event *ev = arg; | 2099 | struct mptsas_hotplug_event *ev = |
2100 | container_of(work, struct mptsas_hotplug_event, work); | ||
2099 | MPT_ADAPTER *ioc = ev->ioc; | 2101 | MPT_ADAPTER *ioc = ev->ioc; |
2100 | struct mptsas_phyinfo *phy_info; | 2102 | struct mptsas_phyinfo *phy_info; |
2101 | struct sas_rphy *rphy; | 2103 | struct sas_rphy *rphy; |
@@ -2341,7 +2343,7 @@ mptsas_send_sas_event(MPT_ADAPTER *ioc, | |||
2341 | break; | 2343 | break; |
2342 | } | 2344 | } |
2343 | 2345 | ||
2344 | INIT_WORK(&ev->work, mptsas_hotplug_work, ev); | 2346 | INIT_WORK(&ev->work, mptsas_hotplug_work); |
2345 | ev->ioc = ioc; | 2347 | ev->ioc = ioc; |
2346 | ev->handle = le16_to_cpu(sas_event_data->DevHandle); | 2348 | ev->handle = le16_to_cpu(sas_event_data->DevHandle); |
2347 | ev->parent_handle = | 2349 | ev->parent_handle = |
@@ -2366,7 +2368,7 @@ mptsas_send_sas_event(MPT_ADAPTER *ioc, | |||
2366 | * Persistent table is full. | 2368 | * Persistent table is full. |
2367 | */ | 2369 | */ |
2368 | INIT_WORK(&ioc->sas_persist_task, | 2370 | INIT_WORK(&ioc->sas_persist_task, |
2369 | mptsas_persist_clear_table, (void *)ioc); | 2371 | mptsas_persist_clear_table); |
2370 | schedule_work(&ioc->sas_persist_task); | 2372 | schedule_work(&ioc->sas_persist_task); |
2371 | break; | 2373 | break; |
2372 | case MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA: | 2374 | case MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA: |
@@ -2395,7 +2397,7 @@ mptsas_send_raid_event(MPT_ADAPTER *ioc, | |||
2395 | return; | 2397 | return; |
2396 | } | 2398 | } |
2397 | 2399 | ||
2398 | INIT_WORK(&ev->work, mptsas_hotplug_work, ev); | 2400 | INIT_WORK(&ev->work, mptsas_hotplug_work); |
2399 | ev->ioc = ioc; | 2401 | ev->ioc = ioc; |
2400 | ev->id = raid_event_data->VolumeID; | 2402 | ev->id = raid_event_data->VolumeID; |
2401 | ev->event_type = MPTSAS_IGNORE_EVENT; | 2403 | ev->event_type = MPTSAS_IGNORE_EVENT; |
@@ -2474,7 +2476,7 @@ mptsas_send_discovery_event(MPT_ADAPTER *ioc, | |||
2474 | ev = kzalloc(sizeof(*ev), GFP_ATOMIC); | 2476 | ev = kzalloc(sizeof(*ev), GFP_ATOMIC); |
2475 | if (!ev) | 2477 | if (!ev) |
2476 | return; | 2478 | return; |
2477 | INIT_WORK(&ev->work, mptsas_discovery_work, ev); | 2479 | INIT_WORK(&ev->work, mptsas_discovery_work); |
2478 | ev->ioc = ioc; | 2480 | ev->ioc = ioc; |
2479 | schedule_work(&ev->work); | 2481 | schedule_work(&ev->work); |
2480 | }; | 2482 | }; |
@@ -2511,8 +2513,7 @@ mptsas_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *reply) | |||
2511 | break; | 2513 | break; |
2512 | case MPI_EVENT_PERSISTENT_TABLE_FULL: | 2514 | case MPI_EVENT_PERSISTENT_TABLE_FULL: |
2513 | INIT_WORK(&ioc->sas_persist_task, | 2515 | INIT_WORK(&ioc->sas_persist_task, |
2514 | mptsas_persist_clear_table, | 2516 | mptsas_persist_clear_table); |
2515 | (void *)ioc); | ||
2516 | schedule_work(&ioc->sas_persist_task); | 2517 | schedule_work(&ioc->sas_persist_task); |
2517 | break; | 2518 | break; |
2518 | case MPI_EVENT_SAS_DISCOVERY: | 2519 | case MPI_EVENT_SAS_DISCOVERY: |
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index e4cc3dd5fc9f..f422c0d0621c 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c | |||
@@ -646,9 +646,10 @@ struct work_queue_wrapper { | |||
646 | int disk; | 646 | int disk; |
647 | }; | 647 | }; |
648 | 648 | ||
649 | static void mpt_work_wrapper(void *data) | 649 | static void mpt_work_wrapper(struct work_struct *work) |
650 | { | 650 | { |
651 | struct work_queue_wrapper *wqw = (struct work_queue_wrapper *)data; | 651 | struct work_queue_wrapper *wqw = |
652 | container_of(work, struct work_queue_wrapper, work); | ||
652 | struct _MPT_SCSI_HOST *hd = wqw->hd; | 653 | struct _MPT_SCSI_HOST *hd = wqw->hd; |
653 | struct Scsi_Host *shost = hd->ioc->sh; | 654 | struct Scsi_Host *shost = hd->ioc->sh; |
654 | struct scsi_device *sdev; | 655 | struct scsi_device *sdev; |
@@ -695,7 +696,7 @@ static void mpt_dv_raid(struct _MPT_SCSI_HOST *hd, int disk) | |||
695 | disk); | 696 | disk); |
696 | return; | 697 | return; |
697 | } | 698 | } |
698 | INIT_WORK(&wqw->work, mpt_work_wrapper, wqw); | 699 | INIT_WORK(&wqw->work, mpt_work_wrapper); |
699 | wqw->hd = hd; | 700 | wqw->hd = hd; |
700 | wqw->disk = disk; | 701 | wqw->disk = disk; |
701 | 702 | ||
@@ -784,9 +785,10 @@ MODULE_DEVICE_TABLE(pci, mptspi_pci_table); | |||
784 | * renegotiate for a given target | 785 | * renegotiate for a given target |
785 | */ | 786 | */ |
786 | static void | 787 | static void |
787 | mptspi_dv_renegotiate_work(void *data) | 788 | mptspi_dv_renegotiate_work(struct work_struct *work) |
788 | { | 789 | { |
789 | struct work_queue_wrapper *wqw = (struct work_queue_wrapper *)data; | 790 | struct work_queue_wrapper *wqw = |
791 | container_of(work, struct work_queue_wrapper, work); | ||
790 | struct _MPT_SCSI_HOST *hd = wqw->hd; | 792 | struct _MPT_SCSI_HOST *hd = wqw->hd; |
791 | struct scsi_device *sdev; | 793 | struct scsi_device *sdev; |
792 | 794 | ||
@@ -804,7 +806,7 @@ mptspi_dv_renegotiate(struct _MPT_SCSI_HOST *hd) | |||
804 | if (!wqw) | 806 | if (!wqw) |
805 | return; | 807 | return; |
806 | 808 | ||
807 | INIT_WORK(&wqw->work, mptspi_dv_renegotiate_work, wqw); | 809 | INIT_WORK(&wqw->work, mptspi_dv_renegotiate_work); |
808 | wqw->hd = hd; | 810 | wqw->hd = hd; |
809 | 811 | ||
810 | schedule_work(&wqw->work); | 812 | schedule_work(&wqw->work); |
diff --git a/drivers/message/i2o/driver.c b/drivers/message/i2o/driver.c index 64130227574f..7fc7399bd2ec 100644 --- a/drivers/message/i2o/driver.c +++ b/drivers/message/i2o/driver.c | |||
@@ -232,7 +232,7 @@ int i2o_driver_dispatch(struct i2o_controller *c, u32 m) | |||
232 | break; | 232 | break; |
233 | } | 233 | } |
234 | 234 | ||
235 | INIT_WORK(&evt->work, (void (*)(void *))drv->event, evt); | 235 | INIT_WORK(&evt->work, drv->event); |
236 | queue_work(drv->event_queue, &evt->work); | 236 | queue_work(drv->event_queue, &evt->work); |
237 | return 1; | 237 | return 1; |
238 | } | 238 | } |
diff --git a/drivers/message/i2o/exec-osm.c b/drivers/message/i2o/exec-osm.c index a2350640384b..9e529d8dd5cb 100644 --- a/drivers/message/i2o/exec-osm.c +++ b/drivers/message/i2o/exec-osm.c | |||
@@ -371,8 +371,10 @@ static int i2o_exec_remove(struct device *dev) | |||
371 | * new LCT and if the buffer for the LCT was to small sends a LCT NOTIFY | 371 | * new LCT and if the buffer for the LCT was to small sends a LCT NOTIFY |
372 | * again, otherwise send LCT NOTIFY to get informed on next LCT change. | 372 | * again, otherwise send LCT NOTIFY to get informed on next LCT change. |
373 | */ | 373 | */ |
374 | static void i2o_exec_lct_modified(struct i2o_exec_lct_notify_work *work) | 374 | static void i2o_exec_lct_modified(struct work_struct *_work) |
375 | { | 375 | { |
376 | struct i2o_exec_lct_notify_work *work = | ||
377 | container_of(_work, struct i2o_exec_lct_notify_work, work); | ||
376 | u32 change_ind = 0; | 378 | u32 change_ind = 0; |
377 | struct i2o_controller *c = work->c; | 379 | struct i2o_controller *c = work->c; |
378 | 380 | ||
@@ -439,8 +441,7 @@ static int i2o_exec_reply(struct i2o_controller *c, u32 m, | |||
439 | 441 | ||
440 | work->c = c; | 442 | work->c = c; |
441 | 443 | ||
442 | INIT_WORK(&work->work, (void (*)(void *))i2o_exec_lct_modified, | 444 | INIT_WORK(&work->work, i2o_exec_lct_modified); |
443 | work); | ||
444 | queue_work(i2o_exec_driver.event_queue, &work->work); | 445 | queue_work(i2o_exec_driver.event_queue, &work->work); |
445 | return 1; | 446 | return 1; |
446 | } | 447 | } |
@@ -460,13 +461,15 @@ static int i2o_exec_reply(struct i2o_controller *c, u32 m, | |||
460 | 461 | ||
461 | /** | 462 | /** |
462 | * i2o_exec_event - Event handling function | 463 | * i2o_exec_event - Event handling function |
463 | * @evt: Event which occurs | 464 | * @work: Work item in occurring event |
464 | * | 465 | * |
465 | * Handles events send by the Executive device. At the moment does not do | 466 | * Handles events send by the Executive device. At the moment does not do |
466 | * anything useful. | 467 | * anything useful. |
467 | */ | 468 | */ |
468 | static void i2o_exec_event(struct i2o_event *evt) | 469 | static void i2o_exec_event(struct work_struct *work) |
469 | { | 470 | { |
471 | struct i2o_event *evt = container_of(work, struct i2o_event, work); | ||
472 | |||
470 | if (likely(evt->i2o_dev)) | 473 | if (likely(evt->i2o_dev)) |
471 | osm_debug("Event received from device: %d\n", | 474 | osm_debug("Event received from device: %d\n", |
472 | evt->i2o_dev->lct_data.tid); | 475 | evt->i2o_dev->lct_data.tid); |
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c index eaba81bf2eca..70ae00253321 100644 --- a/drivers/message/i2o/i2o_block.c +++ b/drivers/message/i2o/i2o_block.c | |||
@@ -419,16 +419,18 @@ static int i2o_block_prep_req_fn(struct request_queue *q, struct request *req) | |||
419 | 419 | ||
420 | /** | 420 | /** |
421 | * i2o_block_delayed_request_fn - delayed request queue function | 421 | * i2o_block_delayed_request_fn - delayed request queue function |
422 | * delayed_request: the delayed request with the queue to start | 422 | * @work: the delayed request with the queue to start |
423 | * | 423 | * |
424 | * If the request queue is stopped for a disk, and there is no open | 424 | * If the request queue is stopped for a disk, and there is no open |
425 | * request, a new event is created, which calls this function to start | 425 | * request, a new event is created, which calls this function to start |
426 | * the queue after I2O_BLOCK_REQUEST_TIME. Otherwise the queue will never | 426 | * the queue after I2O_BLOCK_REQUEST_TIME. Otherwise the queue will never |
427 | * be started again. | 427 | * be started again. |
428 | */ | 428 | */ |
429 | static void i2o_block_delayed_request_fn(void *delayed_request) | 429 | static void i2o_block_delayed_request_fn(struct work_struct *work) |
430 | { | 430 | { |
431 | struct i2o_block_delayed_request *dreq = delayed_request; | 431 | struct i2o_block_delayed_request *dreq = |
432 | container_of(work, struct i2o_block_delayed_request, | ||
433 | work.work); | ||
432 | struct request_queue *q = dreq->queue; | 434 | struct request_queue *q = dreq->queue; |
433 | unsigned long flags; | 435 | unsigned long flags; |
434 | 436 | ||
@@ -538,8 +540,9 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m, | |||
538 | return 1; | 540 | return 1; |
539 | }; | 541 | }; |
540 | 542 | ||
541 | static void i2o_block_event(struct i2o_event *evt) | 543 | static void i2o_block_event(struct work_struct *work) |
542 | { | 544 | { |
545 | struct i2o_event *evt = container_of(work, struct i2o_event, work); | ||
543 | osm_debug("event received\n"); | 546 | osm_debug("event received\n"); |
544 | kfree(evt); | 547 | kfree(evt); |
545 | }; | 548 | }; |
@@ -938,8 +941,8 @@ static void i2o_block_request_fn(struct request_queue *q) | |||
938 | continue; | 941 | continue; |
939 | 942 | ||
940 | dreq->queue = q; | 943 | dreq->queue = q; |
941 | INIT_WORK(&dreq->work, i2o_block_delayed_request_fn, | 944 | INIT_DELAYED_WORK(&dreq->work, |
942 | dreq); | 945 | i2o_block_delayed_request_fn); |
943 | 946 | ||
944 | if (!queue_delayed_work(i2o_block_driver.event_queue, | 947 | if (!queue_delayed_work(i2o_block_driver.event_queue, |
945 | &dreq->work, | 948 | &dreq->work, |
diff --git a/drivers/message/i2o/i2o_block.h b/drivers/message/i2o/i2o_block.h index 4fdaa5bda412..d9fdc95b440d 100644 --- a/drivers/message/i2o/i2o_block.h +++ b/drivers/message/i2o/i2o_block.h | |||
@@ -96,7 +96,7 @@ struct i2o_block_request { | |||
96 | 96 | ||
97 | /* I2O Block device delayed request */ | 97 | /* I2O Block device delayed request */ |
98 | struct i2o_block_delayed_request { | 98 | struct i2o_block_delayed_request { |
99 | struct work_struct work; | 99 | struct delayed_work work; |
100 | struct request_queue *queue; | 100 | struct request_queue *queue; |
101 | }; | 101 | }; |
102 | 102 | ||
diff --git a/drivers/misc/tifm_7xx1.c b/drivers/misc/tifm_7xx1.c index 1ba8754e9383..2ab7add78f94 100644 --- a/drivers/misc/tifm_7xx1.c +++ b/drivers/misc/tifm_7xx1.c | |||
@@ -33,9 +33,10 @@ static void tifm_7xx1_eject(struct tifm_adapter *fm, struct tifm_dev *sock) | |||
33 | spin_unlock_irqrestore(&fm->lock, flags); | 33 | spin_unlock_irqrestore(&fm->lock, flags); |
34 | } | 34 | } |
35 | 35 | ||
36 | static void tifm_7xx1_remove_media(void *adapter) | 36 | static void tifm_7xx1_remove_media(struct work_struct *work) |
37 | { | 37 | { |
38 | struct tifm_adapter *fm = adapter; | 38 | struct tifm_adapter *fm = |
39 | container_of(work, struct tifm_adapter, media_remover); | ||
39 | unsigned long flags; | 40 | unsigned long flags; |
40 | int cnt; | 41 | int cnt; |
41 | struct tifm_dev *sock; | 42 | struct tifm_dev *sock; |
@@ -169,9 +170,10 @@ tifm_7xx1_sock_addr(char __iomem *base_addr, unsigned int sock_num) | |||
169 | return base_addr + ((sock_num + 1) << 10); | 170 | return base_addr + ((sock_num + 1) << 10); |
170 | } | 171 | } |
171 | 172 | ||
172 | static void tifm_7xx1_insert_media(void *adapter) | 173 | static void tifm_7xx1_insert_media(struct work_struct *work) |
173 | { | 174 | { |
174 | struct tifm_adapter *fm = adapter; | 175 | struct tifm_adapter *fm = |
176 | container_of(work, struct tifm_adapter, media_inserter); | ||
175 | unsigned long flags; | 177 | unsigned long flags; |
176 | tifm_media_id media_id; | 178 | tifm_media_id media_id; |
177 | char *card_name = "xx"; | 179 | char *card_name = "xx"; |
@@ -261,7 +263,7 @@ static int tifm_7xx1_suspend(struct pci_dev *dev, pm_message_t state) | |||
261 | spin_unlock_irqrestore(&fm->lock, flags); | 263 | spin_unlock_irqrestore(&fm->lock, flags); |
262 | flush_workqueue(fm->wq); | 264 | flush_workqueue(fm->wq); |
263 | 265 | ||
264 | tifm_7xx1_remove_media(fm); | 266 | tifm_7xx1_remove_media(&fm->media_remover); |
265 | 267 | ||
266 | pci_set_power_state(dev, PCI_D3hot); | 268 | pci_set_power_state(dev, PCI_D3hot); |
267 | pci_disable_device(dev); | 269 | pci_disable_device(dev); |
@@ -328,8 +330,8 @@ static int tifm_7xx1_probe(struct pci_dev *dev, | |||
328 | if (!fm->sockets) | 330 | if (!fm->sockets) |
329 | goto err_out_free; | 331 | goto err_out_free; |
330 | 332 | ||
331 | INIT_WORK(&fm->media_inserter, tifm_7xx1_insert_media, fm); | 333 | INIT_WORK(&fm->media_inserter, tifm_7xx1_insert_media); |
332 | INIT_WORK(&fm->media_remover, tifm_7xx1_remove_media, fm); | 334 | INIT_WORK(&fm->media_remover, tifm_7xx1_remove_media); |
333 | fm->eject = tifm_7xx1_eject; | 335 | fm->eject = tifm_7xx1_eject; |
334 | pci_set_drvdata(dev, fm); | 336 | pci_set_drvdata(dev, fm); |
335 | 337 | ||
@@ -384,7 +386,7 @@ static void tifm_7xx1_remove(struct pci_dev *dev) | |||
384 | 386 | ||
385 | flush_workqueue(fm->wq); | 387 | flush_workqueue(fm->wq); |
386 | 388 | ||
387 | tifm_7xx1_remove_media(fm); | 389 | tifm_7xx1_remove_media(&fm->media_remover); |
388 | 390 | ||
389 | writel(TIFM_IRQ_SETALL, fm->addr + FM_CLEAR_INTERRUPT_ENABLE); | 391 | writel(TIFM_IRQ_SETALL, fm->addr + FM_CLEAR_INTERRUPT_ENABLE); |
390 | free_irq(dev->irq, fm); | 392 | free_irq(dev->irq, fm); |
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 9d190022a490..6f2a282e2b97 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c | |||
@@ -1419,18 +1419,16 @@ static void mmc_setup(struct mmc_host *host) | |||
1419 | */ | 1419 | */ |
1420 | void mmc_detect_change(struct mmc_host *host, unsigned long delay) | 1420 | void mmc_detect_change(struct mmc_host *host, unsigned long delay) |
1421 | { | 1421 | { |
1422 | if (delay) | 1422 | mmc_schedule_delayed_work(&host->detect, delay); |
1423 | mmc_schedule_delayed_work(&host->detect, delay); | ||
1424 | else | ||
1425 | mmc_schedule_work(&host->detect); | ||
1426 | } | 1423 | } |
1427 | 1424 | ||
1428 | EXPORT_SYMBOL(mmc_detect_change); | 1425 | EXPORT_SYMBOL(mmc_detect_change); |
1429 | 1426 | ||
1430 | 1427 | ||
1431 | static void mmc_rescan(void *data) | 1428 | static void mmc_rescan(struct work_struct *work) |
1432 | { | 1429 | { |
1433 | struct mmc_host *host = data; | 1430 | struct mmc_host *host = |
1431 | container_of(work, struct mmc_host, detect.work); | ||
1434 | struct list_head *l, *n; | 1432 | struct list_head *l, *n; |
1435 | unsigned char power_mode; | 1433 | unsigned char power_mode; |
1436 | 1434 | ||
@@ -1513,7 +1511,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev) | |||
1513 | spin_lock_init(&host->lock); | 1511 | spin_lock_init(&host->lock); |
1514 | init_waitqueue_head(&host->wq); | 1512 | init_waitqueue_head(&host->wq); |
1515 | INIT_LIST_HEAD(&host->cards); | 1513 | INIT_LIST_HEAD(&host->cards); |
1516 | INIT_WORK(&host->detect, mmc_rescan, host); | 1514 | INIT_DELAYED_WORK(&host->detect, mmc_rescan); |
1517 | 1515 | ||
1518 | /* | 1516 | /* |
1519 | * By default, hosts do not support SGIO or large requests. | 1517 | * By default, hosts do not support SGIO or large requests. |
@@ -1611,7 +1609,7 @@ EXPORT_SYMBOL(mmc_suspend_host); | |||
1611 | */ | 1609 | */ |
1612 | int mmc_resume_host(struct mmc_host *host) | 1610 | int mmc_resume_host(struct mmc_host *host) |
1613 | { | 1611 | { |
1614 | mmc_rescan(host); | 1612 | mmc_rescan(&host->detect.work); |
1615 | 1613 | ||
1616 | return 0; | 1614 | return 0; |
1617 | } | 1615 | } |
diff --git a/drivers/mmc/mmc.h b/drivers/mmc/mmc.h index cd5e0ab3d84b..149affe0b686 100644 --- a/drivers/mmc/mmc.h +++ b/drivers/mmc/mmc.h | |||
@@ -20,6 +20,6 @@ void mmc_remove_host_sysfs(struct mmc_host *host); | |||
20 | void mmc_free_host_sysfs(struct mmc_host *host); | 20 | void mmc_free_host_sysfs(struct mmc_host *host); |
21 | 21 | ||
22 | int mmc_schedule_work(struct work_struct *work); | 22 | int mmc_schedule_work(struct work_struct *work); |
23 | int mmc_schedule_delayed_work(struct work_struct *work, unsigned long delay); | 23 | int mmc_schedule_delayed_work(struct delayed_work *work, unsigned long delay); |
24 | void mmc_flush_scheduled_work(void); | 24 | void mmc_flush_scheduled_work(void); |
25 | #endif | 25 | #endif |
diff --git a/drivers/mmc/mmc_sysfs.c b/drivers/mmc/mmc_sysfs.c index ac5329636045..e334acd045bc 100644 --- a/drivers/mmc/mmc_sysfs.c +++ b/drivers/mmc/mmc_sysfs.c | |||
@@ -321,17 +321,9 @@ void mmc_free_host_sysfs(struct mmc_host *host) | |||
321 | static struct workqueue_struct *workqueue; | 321 | static struct workqueue_struct *workqueue; |
322 | 322 | ||
323 | /* | 323 | /* |
324 | * Internal function. Schedule work in the MMC work queue. | ||
325 | */ | ||
326 | int mmc_schedule_work(struct work_struct *work) | ||
327 | { | ||
328 | return queue_work(workqueue, work); | ||
329 | } | ||
330 | |||
331 | /* | ||
332 | * Internal function. Schedule delayed work in the MMC work queue. | 324 | * Internal function. Schedule delayed work in the MMC work queue. |
333 | */ | 325 | */ |
334 | int mmc_schedule_delayed_work(struct work_struct *work, unsigned long delay) | 326 | int mmc_schedule_delayed_work(struct delayed_work *work, unsigned long delay) |
335 | { | 327 | { |
336 | return queue_delayed_work(workqueue, work, delay); | 328 | return queue_delayed_work(workqueue, work, delay); |
337 | } | 329 | } |
diff --git a/drivers/mmc/tifm_sd.c b/drivers/mmc/tifm_sd.c index 0fdc55b08a6d..e846499a004c 100644 --- a/drivers/mmc/tifm_sd.c +++ b/drivers/mmc/tifm_sd.c | |||
@@ -99,7 +99,7 @@ struct tifm_sd { | |||
99 | 99 | ||
100 | struct mmc_request *req; | 100 | struct mmc_request *req; |
101 | struct work_struct cmd_handler; | 101 | struct work_struct cmd_handler; |
102 | struct work_struct abort_handler; | 102 | struct delayed_work abort_handler; |
103 | wait_queue_head_t can_eject; | 103 | wait_queue_head_t can_eject; |
104 | 104 | ||
105 | size_t written_blocks; | 105 | size_t written_blocks; |
@@ -496,9 +496,9 @@ err_out: | |||
496 | mmc_request_done(mmc, mrq); | 496 | mmc_request_done(mmc, mrq); |
497 | } | 497 | } |
498 | 498 | ||
499 | static void tifm_sd_end_cmd(void *data) | 499 | static void tifm_sd_end_cmd(struct work_struct *work) |
500 | { | 500 | { |
501 | struct tifm_sd *host = data; | 501 | struct tifm_sd *host = container_of(work, struct tifm_sd, cmd_handler); |
502 | struct tifm_dev *sock = host->dev; | 502 | struct tifm_dev *sock = host->dev; |
503 | struct mmc_host *mmc = tifm_get_drvdata(sock); | 503 | struct mmc_host *mmc = tifm_get_drvdata(sock); |
504 | struct mmc_request *mrq; | 504 | struct mmc_request *mrq; |
@@ -608,9 +608,9 @@ err_out: | |||
608 | mmc_request_done(mmc, mrq); | 608 | mmc_request_done(mmc, mrq); |
609 | } | 609 | } |
610 | 610 | ||
611 | static void tifm_sd_end_cmd_nodma(void *data) | 611 | static void tifm_sd_end_cmd_nodma(struct work_struct *work) |
612 | { | 612 | { |
613 | struct tifm_sd *host = (struct tifm_sd*)data; | 613 | struct tifm_sd *host = container_of(work, struct tifm_sd, cmd_handler); |
614 | struct tifm_dev *sock = host->dev; | 614 | struct tifm_dev *sock = host->dev; |
615 | struct mmc_host *mmc = tifm_get_drvdata(sock); | 615 | struct mmc_host *mmc = tifm_get_drvdata(sock); |
616 | struct mmc_request *mrq; | 616 | struct mmc_request *mrq; |
@@ -661,11 +661,14 @@ static void tifm_sd_end_cmd_nodma(void *data) | |||
661 | mmc_request_done(mmc, mrq); | 661 | mmc_request_done(mmc, mrq); |
662 | } | 662 | } |
663 | 663 | ||
664 | static void tifm_sd_abort(void *data) | 664 | static void tifm_sd_abort(struct work_struct *work) |
665 | { | 665 | { |
666 | struct tifm_sd *host = | ||
667 | container_of(work, struct tifm_sd, abort_handler.work); | ||
668 | |||
666 | printk(KERN_ERR DRIVER_NAME | 669 | printk(KERN_ERR DRIVER_NAME |
667 | ": card failed to respond for a long period of time"); | 670 | ": card failed to respond for a long period of time"); |
668 | tifm_eject(((struct tifm_sd*)data)->dev); | 671 | tifm_eject(host->dev); |
669 | } | 672 | } |
670 | 673 | ||
671 | static void tifm_sd_ios(struct mmc_host *mmc, struct mmc_ios *ios) | 674 | static void tifm_sd_ios(struct mmc_host *mmc, struct mmc_ios *ios) |
@@ -762,9 +765,9 @@ static struct mmc_host_ops tifm_sd_ops = { | |||
762 | .get_ro = tifm_sd_ro | 765 | .get_ro = tifm_sd_ro |
763 | }; | 766 | }; |
764 | 767 | ||
765 | static void tifm_sd_register_host(void *data) | 768 | static void tifm_sd_register_host(struct work_struct *work) |
766 | { | 769 | { |
767 | struct tifm_sd *host = (struct tifm_sd*)data; | 770 | struct tifm_sd *host = container_of(work, struct tifm_sd, cmd_handler); |
768 | struct tifm_dev *sock = host->dev; | 771 | struct tifm_dev *sock = host->dev; |
769 | struct mmc_host *mmc = tifm_get_drvdata(sock); | 772 | struct mmc_host *mmc = tifm_get_drvdata(sock); |
770 | unsigned long flags; | 773 | unsigned long flags; |
@@ -772,8 +775,7 @@ static void tifm_sd_register_host(void *data) | |||
772 | spin_lock_irqsave(&sock->lock, flags); | 775 | spin_lock_irqsave(&sock->lock, flags); |
773 | host->flags |= HOST_REG; | 776 | host->flags |= HOST_REG; |
774 | PREPARE_WORK(&host->cmd_handler, | 777 | PREPARE_WORK(&host->cmd_handler, |
775 | no_dma ? tifm_sd_end_cmd_nodma : tifm_sd_end_cmd, | 778 | no_dma ? tifm_sd_end_cmd_nodma : tifm_sd_end_cmd); |
776 | data); | ||
777 | spin_unlock_irqrestore(&sock->lock, flags); | 779 | spin_unlock_irqrestore(&sock->lock, flags); |
778 | dev_dbg(&sock->dev, "adding host\n"); | 780 | dev_dbg(&sock->dev, "adding host\n"); |
779 | mmc_add_host(mmc); | 781 | mmc_add_host(mmc); |
@@ -799,8 +801,8 @@ static int tifm_sd_probe(struct tifm_dev *sock) | |||
799 | host->dev = sock; | 801 | host->dev = sock; |
800 | host->clk_div = 61; | 802 | host->clk_div = 61; |
801 | init_waitqueue_head(&host->can_eject); | 803 | init_waitqueue_head(&host->can_eject); |
802 | INIT_WORK(&host->cmd_handler, tifm_sd_register_host, host); | 804 | INIT_WORK(&host->cmd_handler, tifm_sd_register_host); |
803 | INIT_WORK(&host->abort_handler, tifm_sd_abort, host); | 805 | INIT_DELAYED_WORK(&host->abort_handler, tifm_sd_abort); |
804 | 806 | ||
805 | tifm_set_drvdata(sock, mmc); | 807 | tifm_set_drvdata(sock, mmc); |
806 | sock->signal_irq = tifm_sd_signal_irq; | 808 | sock->signal_irq = tifm_sd_signal_irq; |
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index d02ed51abfcc..931028f672de 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c | |||
@@ -594,7 +594,7 @@ struct rtl8139_private { | |||
594 | u32 rx_config; | 594 | u32 rx_config; |
595 | struct rtl_extra_stats xstats; | 595 | struct rtl_extra_stats xstats; |
596 | 596 | ||
597 | struct work_struct thread; | 597 | struct delayed_work thread; |
598 | 598 | ||
599 | struct mii_if_info mii; | 599 | struct mii_if_info mii; |
600 | unsigned int regs_len; | 600 | unsigned int regs_len; |
@@ -636,8 +636,8 @@ static struct net_device_stats *rtl8139_get_stats (struct net_device *dev); | |||
636 | static void rtl8139_set_rx_mode (struct net_device *dev); | 636 | static void rtl8139_set_rx_mode (struct net_device *dev); |
637 | static void __set_rx_mode (struct net_device *dev); | 637 | static void __set_rx_mode (struct net_device *dev); |
638 | static void rtl8139_hw_start (struct net_device *dev); | 638 | static void rtl8139_hw_start (struct net_device *dev); |
639 | static void rtl8139_thread (void *_data); | 639 | static void rtl8139_thread (struct work_struct *work); |
640 | static void rtl8139_tx_timeout_task(void *_data); | 640 | static void rtl8139_tx_timeout_task(struct work_struct *work); |
641 | static const struct ethtool_ops rtl8139_ethtool_ops; | 641 | static const struct ethtool_ops rtl8139_ethtool_ops; |
642 | 642 | ||
643 | /* write MMIO register, with flush */ | 643 | /* write MMIO register, with flush */ |
@@ -1010,7 +1010,7 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, | |||
1010 | (debug < 0 ? RTL8139_DEF_MSG_ENABLE : ((1 << debug) - 1)); | 1010 | (debug < 0 ? RTL8139_DEF_MSG_ENABLE : ((1 << debug) - 1)); |
1011 | spin_lock_init (&tp->lock); | 1011 | spin_lock_init (&tp->lock); |
1012 | spin_lock_init (&tp->rx_lock); | 1012 | spin_lock_init (&tp->rx_lock); |
1013 | INIT_WORK(&tp->thread, rtl8139_thread, dev); | 1013 | INIT_DELAYED_WORK(&tp->thread, rtl8139_thread); |
1014 | tp->mii.dev = dev; | 1014 | tp->mii.dev = dev; |
1015 | tp->mii.mdio_read = mdio_read; | 1015 | tp->mii.mdio_read = mdio_read; |
1016 | tp->mii.mdio_write = mdio_write; | 1016 | tp->mii.mdio_write = mdio_write; |
@@ -1596,15 +1596,16 @@ static inline void rtl8139_thread_iter (struct net_device *dev, | |||
1596 | RTL_R8 (Config1)); | 1596 | RTL_R8 (Config1)); |
1597 | } | 1597 | } |
1598 | 1598 | ||
1599 | static void rtl8139_thread (void *_data) | 1599 | static void rtl8139_thread (struct work_struct *work) |
1600 | { | 1600 | { |
1601 | struct net_device *dev = _data; | 1601 | struct rtl8139_private *tp = |
1602 | struct rtl8139_private *tp = netdev_priv(dev); | 1602 | container_of(work, struct rtl8139_private, thread.work); |
1603 | struct net_device *dev = tp->mii.dev; | ||
1603 | unsigned long thr_delay = next_tick; | 1604 | unsigned long thr_delay = next_tick; |
1604 | 1605 | ||
1605 | if (tp->watchdog_fired) { | 1606 | if (tp->watchdog_fired) { |
1606 | tp->watchdog_fired = 0; | 1607 | tp->watchdog_fired = 0; |
1607 | rtl8139_tx_timeout_task(_data); | 1608 | rtl8139_tx_timeout_task(work); |
1608 | } else if (rtnl_trylock()) { | 1609 | } else if (rtnl_trylock()) { |
1609 | rtl8139_thread_iter (dev, tp, tp->mmio_addr); | 1610 | rtl8139_thread_iter (dev, tp, tp->mmio_addr); |
1610 | rtnl_unlock (); | 1611 | rtnl_unlock (); |
@@ -1646,10 +1647,11 @@ static inline void rtl8139_tx_clear (struct rtl8139_private *tp) | |||
1646 | /* XXX account for unsent Tx packets in tp->stats.tx_dropped */ | 1647 | /* XXX account for unsent Tx packets in tp->stats.tx_dropped */ |
1647 | } | 1648 | } |
1648 | 1649 | ||
1649 | static void rtl8139_tx_timeout_task (void *_data) | 1650 | static void rtl8139_tx_timeout_task (struct work_struct *work) |
1650 | { | 1651 | { |
1651 | struct net_device *dev = _data; | 1652 | struct rtl8139_private *tp = |
1652 | struct rtl8139_private *tp = netdev_priv(dev); | 1653 | container_of(work, struct rtl8139_private, thread.work); |
1654 | struct net_device *dev = tp->mii.dev; | ||
1653 | void __iomem *ioaddr = tp->mmio_addr; | 1655 | void __iomem *ioaddr = tp->mmio_addr; |
1654 | int i; | 1656 | int i; |
1655 | u8 tmp8; | 1657 | u8 tmp8; |
@@ -1695,7 +1697,7 @@ static void rtl8139_tx_timeout (struct net_device *dev) | |||
1695 | struct rtl8139_private *tp = netdev_priv(dev); | 1697 | struct rtl8139_private *tp = netdev_priv(dev); |
1696 | 1698 | ||
1697 | if (!tp->have_thread) { | 1699 | if (!tp->have_thread) { |
1698 | INIT_WORK(&tp->thread, rtl8139_tx_timeout_task, dev); | 1700 | INIT_DELAYED_WORK(&tp->thread, rtl8139_tx_timeout_task); |
1699 | schedule_delayed_work(&tp->thread, next_tick); | 1701 | schedule_delayed_work(&tp->thread, next_tick); |
1700 | } else | 1702 | } else |
1701 | tp->watchdog_fired = 1; | 1703 | tp->watchdog_fired = 1; |
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index fc2f1d1c7ead..5bacb7587df4 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -4411,9 +4411,9 @@ bnx2_open(struct net_device *dev) | |||
4411 | } | 4411 | } |
4412 | 4412 | ||
4413 | static void | 4413 | static void |
4414 | bnx2_reset_task(void *data) | 4414 | bnx2_reset_task(struct work_struct *work) |
4415 | { | 4415 | { |
4416 | struct bnx2 *bp = data; | 4416 | struct bnx2 *bp = container_of(work, struct bnx2, reset_task); |
4417 | 4417 | ||
4418 | if (!netif_running(bp->dev)) | 4418 | if (!netif_running(bp->dev)) |
4419 | return; | 4419 | return; |
@@ -5702,7 +5702,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
5702 | bp->pdev = pdev; | 5702 | bp->pdev = pdev; |
5703 | 5703 | ||
5704 | spin_lock_init(&bp->phy_lock); | 5704 | spin_lock_init(&bp->phy_lock); |
5705 | INIT_WORK(&bp->reset_task, bnx2_reset_task, bp); | 5705 | INIT_WORK(&bp->reset_task, bnx2_reset_task); |
5706 | 5706 | ||
5707 | dev->base_addr = dev->mem_start = pci_resource_start(pdev, 0); | 5707 | dev->base_addr = dev->mem_start = pci_resource_start(pdev, 0); |
5708 | mem_len = MB_GET_CID_ADDR(TX_TSS_CID + 1); | 5708 | mem_len = MB_GET_CID_ADDR(TX_TSS_CID + 1); |
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c index fd2cc13f7d97..c8126484c2be 100644 --- a/drivers/net/cassini.c +++ b/drivers/net/cassini.c | |||
@@ -4066,9 +4066,9 @@ static int cas_alloc_rxds(struct cas *cp) | |||
4066 | return 0; | 4066 | return 0; |
4067 | } | 4067 | } |
4068 | 4068 | ||
4069 | static void cas_reset_task(void *data) | 4069 | static void cas_reset_task(struct work_struct *work) |
4070 | { | 4070 | { |
4071 | struct cas *cp = (struct cas *) data; | 4071 | struct cas *cp = container_of(work, struct cas, reset_task); |
4072 | #if 0 | 4072 | #if 0 |
4073 | int pending = atomic_read(&cp->reset_task_pending); | 4073 | int pending = atomic_read(&cp->reset_task_pending); |
4074 | #else | 4074 | #else |
@@ -5006,7 +5006,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev, | |||
5006 | atomic_set(&cp->reset_task_pending_spare, 0); | 5006 | atomic_set(&cp->reset_task_pending_spare, 0); |
5007 | atomic_set(&cp->reset_task_pending_mtu, 0); | 5007 | atomic_set(&cp->reset_task_pending_mtu, 0); |
5008 | #endif | 5008 | #endif |
5009 | INIT_WORK(&cp->reset_task, cas_reset_task, cp); | 5009 | INIT_WORK(&cp->reset_task, cas_reset_task); |
5010 | 5010 | ||
5011 | /* Default link parameters */ | 5011 | /* Default link parameters */ |
5012 | if (link_mode >= 0 && link_mode <= 6) | 5012 | if (link_mode >= 0 && link_mode <= 6) |
diff --git a/drivers/net/chelsio/common.h b/drivers/net/chelsio/common.h index b265941e1372..74758d2c7af8 100644 --- a/drivers/net/chelsio/common.h +++ b/drivers/net/chelsio/common.h | |||
@@ -279,7 +279,7 @@ struct adapter { | |||
279 | struct petp *tp; | 279 | struct petp *tp; |
280 | 280 | ||
281 | struct port_info port[MAX_NPORTS]; | 281 | struct port_info port[MAX_NPORTS]; |
282 | struct work_struct stats_update_task; | 282 | struct delayed_work stats_update_task; |
283 | struct timer_list stats_update_timer; | 283 | struct timer_list stats_update_timer; |
284 | 284 | ||
285 | spinlock_t tpi_lock; | 285 | spinlock_t tpi_lock; |
diff --git a/drivers/net/chelsio/cphy.h b/drivers/net/chelsio/cphy.h index 60901f25014e..cf9143499882 100644 --- a/drivers/net/chelsio/cphy.h +++ b/drivers/net/chelsio/cphy.h | |||
@@ -91,7 +91,7 @@ struct cphy { | |||
91 | int state; /* Link status state machine */ | 91 | int state; /* Link status state machine */ |
92 | adapter_t *adapter; /* associated adapter */ | 92 | adapter_t *adapter; /* associated adapter */ |
93 | 93 | ||
94 | struct work_struct phy_update; | 94 | struct delayed_work phy_update; |
95 | 95 | ||
96 | u16 bmsr; | 96 | u16 bmsr; |
97 | int count; | 97 | int count; |
diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c index 53bec6739812..de48eadddbc4 100644 --- a/drivers/net/chelsio/cxgb2.c +++ b/drivers/net/chelsio/cxgb2.c | |||
@@ -953,10 +953,11 @@ static void t1_netpoll(struct net_device *dev) | |||
953 | * Periodic accumulation of MAC statistics. This is used only if the MAC | 953 | * Periodic accumulation of MAC statistics. This is used only if the MAC |
954 | * does not have any other way to prevent stats counter overflow. | 954 | * does not have any other way to prevent stats counter overflow. |
955 | */ | 955 | */ |
956 | static void mac_stats_task(void *data) | 956 | static void mac_stats_task(struct work_struct *work) |
957 | { | 957 | { |
958 | int i; | 958 | int i; |
959 | struct adapter *adapter = data; | 959 | struct adapter *adapter = |
960 | container_of(work, struct adapter, stats_update_task.work); | ||
960 | 961 | ||
961 | for_each_port(adapter, i) { | 962 | for_each_port(adapter, i) { |
962 | struct port_info *p = &adapter->port[i]; | 963 | struct port_info *p = &adapter->port[i]; |
@@ -977,9 +978,10 @@ static void mac_stats_task(void *data) | |||
977 | /* | 978 | /* |
978 | * Processes elmer0 external interrupts in process context. | 979 | * Processes elmer0 external interrupts in process context. |
979 | */ | 980 | */ |
980 | static void ext_intr_task(void *data) | 981 | static void ext_intr_task(struct work_struct *work) |
981 | { | 982 | { |
982 | struct adapter *adapter = data; | 983 | struct adapter *adapter = |
984 | container_of(work, struct adapter, ext_intr_handler_task); | ||
983 | 985 | ||
984 | t1_elmer0_ext_intr_handler(adapter); | 986 | t1_elmer0_ext_intr_handler(adapter); |
985 | 987 | ||
@@ -1113,9 +1115,9 @@ static int __devinit init_one(struct pci_dev *pdev, | |||
1113 | spin_lock_init(&adapter->mac_lock); | 1115 | spin_lock_init(&adapter->mac_lock); |
1114 | 1116 | ||
1115 | INIT_WORK(&adapter->ext_intr_handler_task, | 1117 | INIT_WORK(&adapter->ext_intr_handler_task, |
1116 | ext_intr_task, adapter); | 1118 | ext_intr_task); |
1117 | INIT_WORK(&adapter->stats_update_task, mac_stats_task, | 1119 | INIT_DELAYED_WORK(&adapter->stats_update_task, |
1118 | adapter); | 1120 | mac_stats_task); |
1119 | 1121 | ||
1120 | pci_set_drvdata(pdev, netdev); | 1122 | pci_set_drvdata(pdev, netdev); |
1121 | } | 1123 | } |
diff --git a/drivers/net/chelsio/my3126.c b/drivers/net/chelsio/my3126.c index 0b90014d5b3e..c7731b6f9de3 100644 --- a/drivers/net/chelsio/my3126.c +++ b/drivers/net/chelsio/my3126.c | |||
@@ -93,9 +93,11 @@ static int my3126_interrupt_handler(struct cphy *cphy) | |||
93 | return cphy_cause_link_change; | 93 | return cphy_cause_link_change; |
94 | } | 94 | } |
95 | 95 | ||
96 | static void my3216_poll(void *arg) | 96 | static void my3216_poll(struct work_struct *work) |
97 | { | 97 | { |
98 | my3126_interrupt_handler(arg); | 98 | struct cphy *cphy = container_of(work, struct cphy, phy_update.work); |
99 | |||
100 | my3126_interrupt_handler(cphy); | ||
99 | } | 101 | } |
100 | 102 | ||
101 | static int my3126_set_loopback(struct cphy *cphy, int on) | 103 | static int my3126_set_loopback(struct cphy *cphy, int on) |
@@ -171,7 +173,7 @@ static struct cphy *my3126_phy_create(adapter_t *adapter, | |||
171 | if (cphy) | 173 | if (cphy) |
172 | cphy_init(cphy, adapter, phy_addr, &my3126_ops, mdio_ops); | 174 | cphy_init(cphy, adapter, phy_addr, &my3126_ops, mdio_ops); |
173 | 175 | ||
174 | INIT_WORK(&cphy->phy_update, my3216_poll, cphy); | 176 | INIT_DELAYED_WORK(&cphy->phy_update, my3216_poll); |
175 | cphy->bmsr = 0; | 177 | cphy->bmsr = 0; |
176 | 178 | ||
177 | return (cphy); | 179 | return (cphy); |
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 3a8df479cbda..03bf164f9e8d 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
@@ -2102,9 +2102,10 @@ static void e100_tx_timeout(struct net_device *netdev) | |||
2102 | schedule_work(&nic->tx_timeout_task); | 2102 | schedule_work(&nic->tx_timeout_task); |
2103 | } | 2103 | } |
2104 | 2104 | ||
2105 | static void e100_tx_timeout_task(struct net_device *netdev) | 2105 | static void e100_tx_timeout_task(struct work_struct *work) |
2106 | { | 2106 | { |
2107 | struct nic *nic = netdev_priv(netdev); | 2107 | struct nic *nic = container_of(work, struct nic, tx_timeout_task); |
2108 | struct net_device *netdev = nic->netdev; | ||
2108 | 2109 | ||
2109 | DPRINTK(TX_ERR, DEBUG, "scb.status=0x%02X\n", | 2110 | DPRINTK(TX_ERR, DEBUG, "scb.status=0x%02X\n", |
2110 | readb(&nic->csr->scb.status)); | 2111 | readb(&nic->csr->scb.status)); |
@@ -2637,8 +2638,7 @@ static int __devinit e100_probe(struct pci_dev *pdev, | |||
2637 | nic->blink_timer.function = e100_blink_led; | 2638 | nic->blink_timer.function = e100_blink_led; |
2638 | nic->blink_timer.data = (unsigned long)nic; | 2639 | nic->blink_timer.data = (unsigned long)nic; |
2639 | 2640 | ||
2640 | INIT_WORK(&nic->tx_timeout_task, | 2641 | INIT_WORK(&nic->tx_timeout_task, e100_tx_timeout_task); |
2641 | (void (*)(void *))e100_tx_timeout_task, netdev); | ||
2642 | 2642 | ||
2643 | if((err = e100_alloc(nic))) { | 2643 | if((err = e100_alloc(nic))) { |
2644 | DPRINTK(PROBE, ERR, "Cannot alloc driver memory, aborting.\n"); | 2644 | DPRINTK(PROBE, ERR, "Cannot alloc driver memory, aborting.\n"); |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 32dde0adb683..73f3a85fd238 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -190,7 +190,7 @@ void e1000_set_ethtool_ops(struct net_device *netdev); | |||
190 | static void e1000_enter_82542_rst(struct e1000_adapter *adapter); | 190 | static void e1000_enter_82542_rst(struct e1000_adapter *adapter); |
191 | static void e1000_leave_82542_rst(struct e1000_adapter *adapter); | 191 | static void e1000_leave_82542_rst(struct e1000_adapter *adapter); |
192 | static void e1000_tx_timeout(struct net_device *dev); | 192 | static void e1000_tx_timeout(struct net_device *dev); |
193 | static void e1000_reset_task(struct net_device *dev); | 193 | static void e1000_reset_task(struct work_struct *work); |
194 | static void e1000_smartspeed(struct e1000_adapter *adapter); | 194 | static void e1000_smartspeed(struct e1000_adapter *adapter); |
195 | static int e1000_82547_fifo_workaround(struct e1000_adapter *adapter, | 195 | static int e1000_82547_fifo_workaround(struct e1000_adapter *adapter, |
196 | struct sk_buff *skb); | 196 | struct sk_buff *skb); |
@@ -914,8 +914,7 @@ e1000_probe(struct pci_dev *pdev, | |||
914 | adapter->phy_info_timer.function = &e1000_update_phy_info; | 914 | adapter->phy_info_timer.function = &e1000_update_phy_info; |
915 | adapter->phy_info_timer.data = (unsigned long) adapter; | 915 | adapter->phy_info_timer.data = (unsigned long) adapter; |
916 | 916 | ||
917 | INIT_WORK(&adapter->reset_task, | 917 | INIT_WORK(&adapter->reset_task, e1000_reset_task); |
918 | (void (*)(void *))e1000_reset_task, netdev); | ||
919 | 918 | ||
920 | e1000_check_options(adapter); | 919 | e1000_check_options(adapter); |
921 | 920 | ||
@@ -3306,9 +3305,10 @@ e1000_tx_timeout(struct net_device *netdev) | |||
3306 | } | 3305 | } |
3307 | 3306 | ||
3308 | static void | 3307 | static void |
3309 | e1000_reset_task(struct net_device *netdev) | 3308 | e1000_reset_task(struct work_struct *work) |
3310 | { | 3309 | { |
3311 | struct e1000_adapter *adapter = netdev_priv(netdev); | 3310 | struct e1000_adapter *adapter = |
3311 | container_of(work, struct e1000_adapter, reset_task); | ||
3312 | 3312 | ||
3313 | e1000_reinit_locked(adapter); | 3313 | e1000_reinit_locked(adapter); |
3314 | } | 3314 | } |
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 6ad696101418..83fa32f72398 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -2224,11 +2224,12 @@ static int ehea_stop(struct net_device *dev) | |||
2224 | return ret; | 2224 | return ret; |
2225 | } | 2225 | } |
2226 | 2226 | ||
2227 | static void ehea_reset_port(void *data) | 2227 | static void ehea_reset_port(struct work_struct *work) |
2228 | { | 2228 | { |
2229 | int ret; | 2229 | int ret; |
2230 | struct net_device *dev = data; | 2230 | struct ehea_port *port = |
2231 | struct ehea_port *port = netdev_priv(dev); | 2231 | container_of(work, struct ehea_port, reset_task); |
2232 | struct net_device *dev = port->netdev; | ||
2232 | 2233 | ||
2233 | port->resets++; | 2234 | port->resets++; |
2234 | down(&port->port_lock); | 2235 | down(&port->port_lock); |
@@ -2379,7 +2380,7 @@ static int ehea_setup_single_port(struct ehea_port *port, | |||
2379 | dev->tx_timeout = &ehea_tx_watchdog; | 2380 | dev->tx_timeout = &ehea_tx_watchdog; |
2380 | dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT; | 2381 | dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT; |
2381 | 2382 | ||
2382 | INIT_WORK(&port->reset_task, ehea_reset_port, dev); | 2383 | INIT_WORK(&port->reset_task, ehea_reset_port); |
2383 | 2384 | ||
2384 | ehea_set_ethtool_ops(dev); | 2385 | ehea_set_ethtool_ops(dev); |
2385 | 2386 | ||
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c index 1ed9cccd3c11..3c33d6f6a6a6 100644 --- a/drivers/net/hamradio/baycom_epp.c +++ b/drivers/net/hamradio/baycom_epp.c | |||
@@ -168,8 +168,9 @@ struct baycom_state { | |||
168 | int magic; | 168 | int magic; |
169 | 169 | ||
170 | struct pardevice *pdev; | 170 | struct pardevice *pdev; |
171 | struct net_device *dev; | ||
171 | unsigned int work_running; | 172 | unsigned int work_running; |
172 | struct work_struct run_work; | 173 | struct delayed_work run_work; |
173 | unsigned int modem; | 174 | unsigned int modem; |
174 | unsigned int bitrate; | 175 | unsigned int bitrate; |
175 | unsigned char stat; | 176 | unsigned char stat; |
@@ -659,16 +660,18 @@ static int receive(struct net_device *dev, int cnt) | |||
659 | #define GETTICK(x) | 660 | #define GETTICK(x) |
660 | #endif /* __i386__ */ | 661 | #endif /* __i386__ */ |
661 | 662 | ||
662 | static void epp_bh(struct net_device *dev) | 663 | static void epp_bh(struct work_struct *work) |
663 | { | 664 | { |
665 | struct net_device *dev; | ||
664 | struct baycom_state *bc; | 666 | struct baycom_state *bc; |
665 | struct parport *pp; | 667 | struct parport *pp; |
666 | unsigned char stat; | 668 | unsigned char stat; |
667 | unsigned char tmp[2]; | 669 | unsigned char tmp[2]; |
668 | unsigned int time1 = 0, time2 = 0, time3 = 0; | 670 | unsigned int time1 = 0, time2 = 0, time3 = 0; |
669 | int cnt, cnt2; | 671 | int cnt, cnt2; |
670 | 672 | ||
671 | bc = netdev_priv(dev); | 673 | bc = container_of(work, struct baycom_state, run_work.work); |
674 | dev = bc->dev; | ||
672 | if (!bc->work_running) | 675 | if (!bc->work_running) |
673 | return; | 676 | return; |
674 | baycom_int_freq(bc); | 677 | baycom_int_freq(bc); |
@@ -889,7 +892,7 @@ static int epp_open(struct net_device *dev) | |||
889 | return -EBUSY; | 892 | return -EBUSY; |
890 | } | 893 | } |
891 | dev->irq = /*pp->irq*/ 0; | 894 | dev->irq = /*pp->irq*/ 0; |
892 | INIT_WORK(&bc->run_work, (void *)(void *)epp_bh, dev); | 895 | INIT_DELAYED_WORK(&bc->run_work, epp_bh); |
893 | bc->work_running = 1; | 896 | bc->work_running = 1; |
894 | bc->modem = EPP_CONVENTIONAL; | 897 | bc->modem = EPP_CONVENTIONAL; |
895 | if (eppconfig(bc)) | 898 | if (eppconfig(bc)) |
@@ -1213,6 +1216,7 @@ static void __init baycom_epp_dev_setup(struct net_device *dev) | |||
1213 | /* | 1216 | /* |
1214 | * initialize part of the baycom_state struct | 1217 | * initialize part of the baycom_state struct |
1215 | */ | 1218 | */ |
1219 | bc->dev = dev; | ||
1216 | bc->magic = BAYCOM_MAGIC; | 1220 | bc->magic = BAYCOM_MAGIC; |
1217 | bc->cfg.fclk = 19666600; | 1221 | bc->cfg.fclk = 19666600; |
1218 | bc->cfg.bps = 9600; | 1222 | bc->cfg.bps = 9600; |
diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c index b32c52ed19d7..f0c61f3b2a82 100644 --- a/drivers/net/irda/mcs7780.c +++ b/drivers/net/irda/mcs7780.c | |||
@@ -560,9 +560,9 @@ static inline int mcs_find_endpoints(struct mcs_cb *mcs, | |||
560 | return ret; | 560 | return ret; |
561 | } | 561 | } |
562 | 562 | ||
563 | static void mcs_speed_work(void *arg) | 563 | static void mcs_speed_work(struct work_struct *work) |
564 | { | 564 | { |
565 | struct mcs_cb *mcs = arg; | 565 | struct mcs_cb *mcs = container_of(work, struct mcs_cb, work); |
566 | struct net_device *netdev = mcs->netdev; | 566 | struct net_device *netdev = mcs->netdev; |
567 | 567 | ||
568 | mcs_speed_change(mcs); | 568 | mcs_speed_change(mcs); |
@@ -927,7 +927,7 @@ static int mcs_probe(struct usb_interface *intf, | |||
927 | irda_qos_bits_to_value(&mcs->qos); | 927 | irda_qos_bits_to_value(&mcs->qos); |
928 | 928 | ||
929 | /* Speed change work initialisation*/ | 929 | /* Speed change work initialisation*/ |
930 | INIT_WORK(&mcs->work, mcs_speed_work, mcs); | 930 | INIT_WORK(&mcs->work, mcs_speed_work); |
931 | 931 | ||
932 | /* Override the network functions we need to use */ | 932 | /* Override the network functions we need to use */ |
933 | ndev->hard_start_xmit = mcs_hard_xmit; | 933 | ndev->hard_start_xmit = mcs_hard_xmit; |
diff --git a/drivers/net/irda/sir-dev.h b/drivers/net/irda/sir-dev.h index 9fa294a546d6..2a57bc67ce35 100644 --- a/drivers/net/irda/sir-dev.h +++ b/drivers/net/irda/sir-dev.h | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | struct sir_fsm { | 23 | struct sir_fsm { |
24 | struct semaphore sem; | 24 | struct semaphore sem; |
25 | struct work_struct work; | 25 | struct delayed_work work; |
26 | unsigned state, substate; | 26 | unsigned state, substate; |
27 | int param; | 27 | int param; |
28 | int result; | 28 | int result; |
diff --git a/drivers/net/irda/sir_dev.c b/drivers/net/irda/sir_dev.c index 3b5854d10c17..17b0c3ab6201 100644 --- a/drivers/net/irda/sir_dev.c +++ b/drivers/net/irda/sir_dev.c | |||
@@ -100,9 +100,9 @@ static int sirdev_tx_complete_fsm(struct sir_dev *dev) | |||
100 | * Both must be unlocked/restarted on completion - but only on final exit. | 100 | * Both must be unlocked/restarted on completion - but only on final exit. |
101 | */ | 101 | */ |
102 | 102 | ||
103 | static void sirdev_config_fsm(void *data) | 103 | static void sirdev_config_fsm(struct work_struct *work) |
104 | { | 104 | { |
105 | struct sir_dev *dev = data; | 105 | struct sir_dev *dev = container_of(work, struct sir_dev, fsm.work.work); |
106 | struct sir_fsm *fsm = &dev->fsm; | 106 | struct sir_fsm *fsm = &dev->fsm; |
107 | int next_state; | 107 | int next_state; |
108 | int ret = -1; | 108 | int ret = -1; |
@@ -309,8 +309,8 @@ int sirdev_schedule_request(struct sir_dev *dev, int initial_state, unsigned par | |||
309 | fsm->param = param; | 309 | fsm->param = param; |
310 | fsm->result = 0; | 310 | fsm->result = 0; |
311 | 311 | ||
312 | INIT_WORK(&fsm->work, sirdev_config_fsm, dev); | 312 | INIT_DELAYED_WORK(&fsm->work, sirdev_config_fsm); |
313 | queue_work(irda_sir_wq, &fsm->work); | 313 | queue_delayed_work(irda_sir_wq, &fsm->work, 0); |
314 | return 0; | 314 | return 0; |
315 | } | 315 | } |
316 | 316 | ||
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c index 2284e2ce1692..d6f4f185bf37 100644 --- a/drivers/net/iseries_veth.c +++ b/drivers/net/iseries_veth.c | |||
@@ -166,7 +166,7 @@ struct veth_msg { | |||
166 | 166 | ||
167 | struct veth_lpar_connection { | 167 | struct veth_lpar_connection { |
168 | HvLpIndex remote_lp; | 168 | HvLpIndex remote_lp; |
169 | struct work_struct statemachine_wq; | 169 | struct delayed_work statemachine_wq; |
170 | struct veth_msg *msgs; | 170 | struct veth_msg *msgs; |
171 | int num_events; | 171 | int num_events; |
172 | struct veth_cap_data local_caps; | 172 | struct veth_cap_data local_caps; |
@@ -456,7 +456,7 @@ static struct kobj_type veth_port_ktype = { | |||
456 | 456 | ||
457 | static inline void veth_kick_statemachine(struct veth_lpar_connection *cnx) | 457 | static inline void veth_kick_statemachine(struct veth_lpar_connection *cnx) |
458 | { | 458 | { |
459 | schedule_work(&cnx->statemachine_wq); | 459 | schedule_delayed_work(&cnx->statemachine_wq, 0); |
460 | } | 460 | } |
461 | 461 | ||
462 | static void veth_take_cap(struct veth_lpar_connection *cnx, | 462 | static void veth_take_cap(struct veth_lpar_connection *cnx, |
@@ -638,9 +638,11 @@ static int veth_process_caps(struct veth_lpar_connection *cnx) | |||
638 | } | 638 | } |
639 | 639 | ||
640 | /* FIXME: The gotos here are a bit dubious */ | 640 | /* FIXME: The gotos here are a bit dubious */ |
641 | static void veth_statemachine(void *p) | 641 | static void veth_statemachine(struct work_struct *work) |
642 | { | 642 | { |
643 | struct veth_lpar_connection *cnx = (struct veth_lpar_connection *)p; | 643 | struct veth_lpar_connection *cnx = |
644 | container_of(work, struct veth_lpar_connection, | ||
645 | statemachine_wq.work); | ||
644 | int rlp = cnx->remote_lp; | 646 | int rlp = cnx->remote_lp; |
645 | int rc; | 647 | int rc; |
646 | 648 | ||
@@ -827,7 +829,7 @@ static int veth_init_connection(u8 rlp) | |||
827 | 829 | ||
828 | cnx->remote_lp = rlp; | 830 | cnx->remote_lp = rlp; |
829 | spin_lock_init(&cnx->lock); | 831 | spin_lock_init(&cnx->lock); |
830 | INIT_WORK(&cnx->statemachine_wq, veth_statemachine, cnx); | 832 | INIT_DELAYED_WORK(&cnx->statemachine_wq, veth_statemachine); |
831 | 833 | ||
832 | init_timer(&cnx->ack_timer); | 834 | init_timer(&cnx->ack_timer); |
833 | cnx->ack_timer.function = veth_timed_ack; | 835 | cnx->ack_timer.function = veth_timed_ack; |
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index 7b127212e62b..e628126c9c49 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c | |||
@@ -106,7 +106,7 @@ static boolean_t ixgb_clean_rx_irq(struct ixgb_adapter *adapter); | |||
106 | static void ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter); | 106 | static void ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter); |
107 | void ixgb_set_ethtool_ops(struct net_device *netdev); | 107 | void ixgb_set_ethtool_ops(struct net_device *netdev); |
108 | static void ixgb_tx_timeout(struct net_device *dev); | 108 | static void ixgb_tx_timeout(struct net_device *dev); |
109 | static void ixgb_tx_timeout_task(struct net_device *dev); | 109 | static void ixgb_tx_timeout_task(struct work_struct *work); |
110 | static void ixgb_vlan_rx_register(struct net_device *netdev, | 110 | static void ixgb_vlan_rx_register(struct net_device *netdev, |
111 | struct vlan_group *grp); | 111 | struct vlan_group *grp); |
112 | static void ixgb_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid); | 112 | static void ixgb_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid); |
@@ -489,8 +489,7 @@ ixgb_probe(struct pci_dev *pdev, | |||
489 | adapter->watchdog_timer.function = &ixgb_watchdog; | 489 | adapter->watchdog_timer.function = &ixgb_watchdog; |
490 | adapter->watchdog_timer.data = (unsigned long)adapter; | 490 | adapter->watchdog_timer.data = (unsigned long)adapter; |
491 | 491 | ||
492 | INIT_WORK(&adapter->tx_timeout_task, | 492 | INIT_WORK(&adapter->tx_timeout_task, ixgb_tx_timeout_task); |
493 | (void (*)(void *))ixgb_tx_timeout_task, netdev); | ||
494 | 493 | ||
495 | strcpy(netdev->name, "eth%d"); | 494 | strcpy(netdev->name, "eth%d"); |
496 | if((err = register_netdev(netdev))) | 495 | if((err = register_netdev(netdev))) |
@@ -1493,9 +1492,10 @@ ixgb_tx_timeout(struct net_device *netdev) | |||
1493 | } | 1492 | } |
1494 | 1493 | ||
1495 | static void | 1494 | static void |
1496 | ixgb_tx_timeout_task(struct net_device *netdev) | 1495 | ixgb_tx_timeout_task(struct work_struct *work) |
1497 | { | 1496 | { |
1498 | struct ixgb_adapter *adapter = netdev_priv(netdev); | 1497 | struct ixgb_adapter *adapter = |
1498 | container_of(work, struct ixgb_adapter, tx_timeout_task); | ||
1499 | 1499 | ||
1500 | adapter->tx_timeout_count++; | 1500 | adapter->tx_timeout_count++; |
1501 | ixgb_down(adapter, TRUE); | 1501 | ixgb_down(adapter, TRUE); |
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 36350e6db1c1..38df42802386 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -2615,9 +2615,10 @@ static u32 myri10ge_read_reboot(struct myri10ge_priv *mgp) | |||
2615 | * This watchdog is used to check whether the board has suffered | 2615 | * This watchdog is used to check whether the board has suffered |
2616 | * from a parity error and needs to be recovered. | 2616 | * from a parity error and needs to be recovered. |
2617 | */ | 2617 | */ |
2618 | static void myri10ge_watchdog(void *arg) | 2618 | static void myri10ge_watchdog(struct work_struct *work) |
2619 | { | 2619 | { |
2620 | struct myri10ge_priv *mgp = arg; | 2620 | struct myri10ge_priv *mgp = |
2621 | container_of(work, struct myri10ge_priv, watchdog_work); | ||
2621 | u32 reboot; | 2622 | u32 reboot; |
2622 | int status; | 2623 | int status; |
2623 | u16 cmd, vendor; | 2624 | u16 cmd, vendor; |
@@ -2887,7 +2888,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2887 | (unsigned long)mgp); | 2888 | (unsigned long)mgp); |
2888 | 2889 | ||
2889 | SET_ETHTOOL_OPS(netdev, &myri10ge_ethtool_ops); | 2890 | SET_ETHTOOL_OPS(netdev, &myri10ge_ethtool_ops); |
2890 | INIT_WORK(&mgp->watchdog_work, myri10ge_watchdog, mgp); | 2891 | INIT_WORK(&mgp->watchdog_work, myri10ge_watchdog); |
2891 | status = register_netdev(netdev); | 2892 | status = register_netdev(netdev); |
2892 | if (status != 0) { | 2893 | if (status != 0) { |
2893 | dev_err(&pdev->dev, "register_netdev failed: %d\n", status); | 2894 | dev_err(&pdev->dev, "register_netdev failed: %d\n", status); |
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index d925053fe597..9c588af8ab74 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -714,6 +714,7 @@ struct netxen_adapter { | |||
714 | spinlock_t lock; | 714 | spinlock_t lock; |
715 | struct work_struct watchdog_task; | 715 | struct work_struct watchdog_task; |
716 | struct work_struct tx_timeout_task; | 716 | struct work_struct tx_timeout_task; |
717 | struct net_device *netdev; | ||
717 | struct timer_list watchdog_timer; | 718 | struct timer_list watchdog_timer; |
718 | 719 | ||
719 | u32 curr_window; | 720 | u32 curr_window; |
@@ -921,7 +922,7 @@ netxen_nic_do_ioctl(struct netxen_adapter *adapter, void *u_data, | |||
921 | struct netxen_port *port); | 922 | struct netxen_port *port); |
922 | int netxen_nic_rx_has_work(struct netxen_adapter *adapter); | 923 | int netxen_nic_rx_has_work(struct netxen_adapter *adapter); |
923 | int netxen_nic_tx_has_work(struct netxen_adapter *adapter); | 924 | int netxen_nic_tx_has_work(struct netxen_adapter *adapter); |
924 | void netxen_watchdog_task(unsigned long v); | 925 | void netxen_watchdog_task(struct work_struct *work); |
925 | void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, | 926 | void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, |
926 | u32 ringid); | 927 | u32 ringid); |
927 | void netxen_process_cmd_ring(unsigned long data); | 928 | void netxen_process_cmd_ring(unsigned long data); |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 0dca029bc3e5..eae18236aefa 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -710,12 +710,13 @@ static inline int netxen_nic_check_temp(struct netxen_adapter *adapter) | |||
710 | return rv; | 710 | return rv; |
711 | } | 711 | } |
712 | 712 | ||
713 | void netxen_watchdog_task(unsigned long v) | 713 | void netxen_watchdog_task(struct work_struct *work) |
714 | { | 714 | { |
715 | int port_num; | 715 | int port_num; |
716 | struct netxen_port *port; | 716 | struct netxen_port *port; |
717 | struct net_device *netdev; | 717 | struct net_device *netdev; |
718 | struct netxen_adapter *adapter = (struct netxen_adapter *)v; | 718 | struct netxen_adapter *adapter = |
719 | container_of(work, struct netxen_adapter, watchdog_task); | ||
719 | 720 | ||
720 | if (netxen_nic_check_temp(adapter)) | 721 | if (netxen_nic_check_temp(adapter)) |
721 | return; | 722 | return; |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 1cb662d5bd76..df0bb36a1cfb 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -64,7 +64,7 @@ static int netxen_nic_open(struct net_device *netdev); | |||
64 | static int netxen_nic_close(struct net_device *netdev); | 64 | static int netxen_nic_close(struct net_device *netdev); |
65 | static int netxen_nic_xmit_frame(struct sk_buff *, struct net_device *); | 65 | static int netxen_nic_xmit_frame(struct sk_buff *, struct net_device *); |
66 | static void netxen_tx_timeout(struct net_device *netdev); | 66 | static void netxen_tx_timeout(struct net_device *netdev); |
67 | static void netxen_tx_timeout_task(struct net_device *netdev); | 67 | static void netxen_tx_timeout_task(struct work_struct *work); |
68 | static void netxen_watchdog(unsigned long); | 68 | static void netxen_watchdog(unsigned long); |
69 | static int netxen_handle_int(struct netxen_adapter *, struct net_device *); | 69 | static int netxen_handle_int(struct netxen_adapter *, struct net_device *); |
70 | static int netxen_nic_ioctl(struct net_device *netdev, | 70 | static int netxen_nic_ioctl(struct net_device *netdev, |
@@ -274,8 +274,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
274 | adapter->ahw.xg_linkup = 0; | 274 | adapter->ahw.xg_linkup = 0; |
275 | adapter->watchdog_timer.function = &netxen_watchdog; | 275 | adapter->watchdog_timer.function = &netxen_watchdog; |
276 | adapter->watchdog_timer.data = (unsigned long)adapter; | 276 | adapter->watchdog_timer.data = (unsigned long)adapter; |
277 | INIT_WORK(&adapter->watchdog_task, | 277 | INIT_WORK(&adapter->watchdog_task, netxen_watchdog_task); |
278 | (void (*)(void *))netxen_watchdog_task, adapter); | ||
279 | adapter->ahw.pdev = pdev; | 278 | adapter->ahw.pdev = pdev; |
280 | adapter->proc_cmd_buf_counter = 0; | 279 | adapter->proc_cmd_buf_counter = 0; |
281 | pci_read_config_byte(pdev, PCI_REVISION_ID, &adapter->ahw.revision_id); | 280 | pci_read_config_byte(pdev, PCI_REVISION_ID, &adapter->ahw.revision_id); |
@@ -379,8 +378,8 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
379 | dev_addr); | 378 | dev_addr); |
380 | } | 379 | } |
381 | } | 380 | } |
382 | INIT_WORK(&adapter->tx_timeout_task, | 381 | adapter->netdev = netdev; |
383 | (void (*)(void *))netxen_tx_timeout_task, netdev); | 382 | INIT_WORK(&adapter->tx_timeout_task, netxen_tx_timeout_task); |
384 | netif_carrier_off(netdev); | 383 | netif_carrier_off(netdev); |
385 | netif_stop_queue(netdev); | 384 | netif_stop_queue(netdev); |
386 | 385 | ||
@@ -938,18 +937,20 @@ static void netxen_tx_timeout(struct net_device *netdev) | |||
938 | schedule_work(&adapter->tx_timeout_task); | 937 | schedule_work(&adapter->tx_timeout_task); |
939 | } | 938 | } |
940 | 939 | ||
941 | static void netxen_tx_timeout_task(struct net_device *netdev) | 940 | static void netxen_tx_timeout_task(struct work_struct *work) |
942 | { | 941 | { |
943 | struct netxen_port *port = (struct netxen_port *)netdev_priv(netdev); | 942 | struct netxen_adapter *adapter = |
943 | container_of(work, struct netxen_adapter, tx_timeout_task); | ||
944 | struct net_device *netdev = adapter->netdev; | ||
944 | unsigned long flags; | 945 | unsigned long flags; |
945 | 946 | ||
946 | printk(KERN_ERR "%s %s: transmit timeout, resetting.\n", | 947 | printk(KERN_ERR "%s %s: transmit timeout, resetting.\n", |
947 | netxen_nic_driver_name, netdev->name); | 948 | netxen_nic_driver_name, netdev->name); |
948 | 949 | ||
949 | spin_lock_irqsave(&port->adapter->lock, flags); | 950 | spin_lock_irqsave(&adapter->lock, flags); |
950 | netxen_nic_close(netdev); | 951 | netxen_nic_close(netdev); |
951 | netxen_nic_open(netdev); | 952 | netxen_nic_open(netdev); |
952 | spin_unlock_irqrestore(&port->adapter->lock, flags); | 953 | spin_unlock_irqrestore(&adapter->lock, flags); |
953 | netdev->trans_start = jiffies; | 954 | netdev->trans_start = jiffies; |
954 | netif_wake_queue(netdev); | 955 | netif_wake_queue(netdev); |
955 | } | 956 | } |
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c index b0127c71a5b6..312e0e331712 100644 --- a/drivers/net/ns83820.c +++ b/drivers/net/ns83820.c | |||
@@ -427,6 +427,7 @@ struct ns83820 { | |||
427 | u8 __iomem *base; | 427 | u8 __iomem *base; |
428 | 428 | ||
429 | struct pci_dev *pci_dev; | 429 | struct pci_dev *pci_dev; |
430 | struct net_device *ndev; | ||
430 | 431 | ||
431 | #ifdef NS83820_VLAN_ACCEL_SUPPORT | 432 | #ifdef NS83820_VLAN_ACCEL_SUPPORT |
432 | struct vlan_group *vlgrp; | 433 | struct vlan_group *vlgrp; |
@@ -631,10 +632,10 @@ static void fastcall rx_refill_atomic(struct net_device *ndev) | |||
631 | } | 632 | } |
632 | 633 | ||
633 | /* REFILL */ | 634 | /* REFILL */ |
634 | static inline void queue_refill(void *_dev) | 635 | static inline void queue_refill(struct work_struct *work) |
635 | { | 636 | { |
636 | struct net_device *ndev = _dev; | 637 | struct ns83820 *dev = container_of(work, struct ns83820, tq_refill); |
637 | struct ns83820 *dev = PRIV(ndev); | 638 | struct net_device *ndev = dev->ndev; |
638 | 639 | ||
639 | rx_refill(ndev, GFP_KERNEL); | 640 | rx_refill(ndev, GFP_KERNEL); |
640 | if (dev->rx_info.up) | 641 | if (dev->rx_info.up) |
@@ -1841,6 +1842,7 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_ | |||
1841 | 1842 | ||
1842 | ndev = alloc_etherdev(sizeof(struct ns83820)); | 1843 | ndev = alloc_etherdev(sizeof(struct ns83820)); |
1843 | dev = PRIV(ndev); | 1844 | dev = PRIV(ndev); |
1845 | dev->ndev = ndev; | ||
1844 | err = -ENOMEM; | 1846 | err = -ENOMEM; |
1845 | if (!dev) | 1847 | if (!dev) |
1846 | goto out; | 1848 | goto out; |
@@ -1853,7 +1855,7 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_ | |||
1853 | SET_MODULE_OWNER(ndev); | 1855 | SET_MODULE_OWNER(ndev); |
1854 | SET_NETDEV_DEV(ndev, &pci_dev->dev); | 1856 | SET_NETDEV_DEV(ndev, &pci_dev->dev); |
1855 | 1857 | ||
1856 | INIT_WORK(&dev->tq_refill, queue_refill, ndev); | 1858 | INIT_WORK(&dev->tq_refill, queue_refill); |
1857 | tasklet_init(&dev->rx_tasklet, rx_action, (unsigned long)ndev); | 1859 | tasklet_init(&dev->rx_tasklet, rx_action, (unsigned long)ndev); |
1858 | 1860 | ||
1859 | err = pci_enable_device(pci_dev); | 1861 | err = pci_enable_device(pci_dev); |
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c index 69813406782d..8478dca3d8d1 100644 --- a/drivers/net/pcmcia/xirc2ps_cs.c +++ b/drivers/net/pcmcia/xirc2ps_cs.c | |||
@@ -332,6 +332,7 @@ static irqreturn_t xirc2ps_interrupt(int irq, void *dev_id); | |||
332 | */ | 332 | */ |
333 | 333 | ||
334 | typedef struct local_info_t { | 334 | typedef struct local_info_t { |
335 | struct net_device *dev; | ||
335 | struct pcmcia_device *p_dev; | 336 | struct pcmcia_device *p_dev; |
336 | dev_node_t node; | 337 | dev_node_t node; |
337 | struct net_device_stats stats; | 338 | struct net_device_stats stats; |
@@ -353,7 +354,7 @@ typedef struct local_info_t { | |||
353 | */ | 354 | */ |
354 | static int do_start_xmit(struct sk_buff *skb, struct net_device *dev); | 355 | static int do_start_xmit(struct sk_buff *skb, struct net_device *dev); |
355 | static void do_tx_timeout(struct net_device *dev); | 356 | static void do_tx_timeout(struct net_device *dev); |
356 | static void xirc2ps_tx_timeout_task(void *data); | 357 | static void xirc2ps_tx_timeout_task(struct work_struct *work); |
357 | static struct net_device_stats *do_get_stats(struct net_device *dev); | 358 | static struct net_device_stats *do_get_stats(struct net_device *dev); |
358 | static void set_addresses(struct net_device *dev); | 359 | static void set_addresses(struct net_device *dev); |
359 | static void set_multicast_list(struct net_device *dev); | 360 | static void set_multicast_list(struct net_device *dev); |
@@ -567,6 +568,7 @@ xirc2ps_probe(struct pcmcia_device *link) | |||
567 | if (!dev) | 568 | if (!dev) |
568 | return -ENOMEM; | 569 | return -ENOMEM; |
569 | local = netdev_priv(dev); | 570 | local = netdev_priv(dev); |
571 | local->dev = dev; | ||
570 | local->p_dev = link; | 572 | local->p_dev = link; |
571 | link->priv = dev; | 573 | link->priv = dev; |
572 | 574 | ||
@@ -591,7 +593,7 @@ xirc2ps_probe(struct pcmcia_device *link) | |||
591 | #ifdef HAVE_TX_TIMEOUT | 593 | #ifdef HAVE_TX_TIMEOUT |
592 | dev->tx_timeout = do_tx_timeout; | 594 | dev->tx_timeout = do_tx_timeout; |
593 | dev->watchdog_timeo = TX_TIMEOUT; | 595 | dev->watchdog_timeo = TX_TIMEOUT; |
594 | INIT_WORK(&local->tx_timeout_task, xirc2ps_tx_timeout_task, dev); | 596 | INIT_WORK(&local->tx_timeout_task, xirc2ps_tx_timeout_task); |
595 | #endif | 597 | #endif |
596 | 598 | ||
597 | return xirc2ps_config(link); | 599 | return xirc2ps_config(link); |
@@ -1324,9 +1326,11 @@ xirc2ps_interrupt(int irq, void *dev_id) | |||
1324 | /*====================================================================*/ | 1326 | /*====================================================================*/ |
1325 | 1327 | ||
1326 | static void | 1328 | static void |
1327 | xirc2ps_tx_timeout_task(void *data) | 1329 | xirc2ps_tx_timeout_task(struct work_struct *work) |
1328 | { | 1330 | { |
1329 | struct net_device *dev = data; | 1331 | local_info_t *local = |
1332 | container_of(work, local_info_t, tx_timeout_task); | ||
1333 | struct net_device *dev = local->dev; | ||
1330 | /* reset the card */ | 1334 | /* reset the card */ |
1331 | do_reset(dev,1); | 1335 | do_reset(dev,1); |
1332 | dev->trans_start = jiffies; | 1336 | dev->trans_start = jiffies; |
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 88237bdb5255..4044bb1ada86 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c | |||
@@ -397,7 +397,7 @@ out_unlock: | |||
397 | EXPORT_SYMBOL(phy_start_aneg); | 397 | EXPORT_SYMBOL(phy_start_aneg); |
398 | 398 | ||
399 | 399 | ||
400 | static void phy_change(void *data); | 400 | static void phy_change(struct work_struct *work); |
401 | static void phy_timer(unsigned long data); | 401 | static void phy_timer(unsigned long data); |
402 | 402 | ||
403 | /* phy_start_machine: | 403 | /* phy_start_machine: |
@@ -555,7 +555,7 @@ int phy_start_interrupts(struct phy_device *phydev) | |||
555 | { | 555 | { |
556 | int err = 0; | 556 | int err = 0; |
557 | 557 | ||
558 | INIT_WORK(&phydev->phy_queue, phy_change, phydev); | 558 | INIT_WORK(&phydev->phy_queue, phy_change); |
559 | 559 | ||
560 | if (request_irq(phydev->irq, phy_interrupt, | 560 | if (request_irq(phydev->irq, phy_interrupt, |
561 | IRQF_SHARED, | 561 | IRQF_SHARED, |
@@ -598,10 +598,11 @@ EXPORT_SYMBOL(phy_stop_interrupts); | |||
598 | 598 | ||
599 | 599 | ||
600 | /* Scheduled by the phy_interrupt/timer to handle PHY changes */ | 600 | /* Scheduled by the phy_interrupt/timer to handle PHY changes */ |
601 | static void phy_change(void *data) | 601 | static void phy_change(struct work_struct *work) |
602 | { | 602 | { |
603 | int err; | 603 | int err; |
604 | struct phy_device *phydev = data; | 604 | struct phy_device *phydev = |
605 | container_of(work, struct phy_device, phy_queue); | ||
605 | 606 | ||
606 | err = phy_disable_interrupts(phydev); | 607 | err = phy_disable_interrupts(phydev); |
607 | 608 | ||
diff --git a/drivers/net/plip.c b/drivers/net/plip.c index 71afb274498f..6bb085f54437 100644 --- a/drivers/net/plip.c +++ b/drivers/net/plip.c | |||
@@ -138,9 +138,9 @@ static const unsigned int net_debug = NET_DEBUG; | |||
138 | #define PLIP_NIBBLE_WAIT 3000 | 138 | #define PLIP_NIBBLE_WAIT 3000 |
139 | 139 | ||
140 | /* Bottom halves */ | 140 | /* Bottom halves */ |
141 | static void plip_kick_bh(struct net_device *dev); | 141 | static void plip_kick_bh(struct work_struct *work); |
142 | static void plip_bh(struct net_device *dev); | 142 | static void plip_bh(struct work_struct *work); |
143 | static void plip_timer_bh(struct net_device *dev); | 143 | static void plip_timer_bh(struct work_struct *work); |
144 | 144 | ||
145 | /* Interrupt handler */ | 145 | /* Interrupt handler */ |
146 | static void plip_interrupt(int irq, void *dev_id); | 146 | static void plip_interrupt(int irq, void *dev_id); |
@@ -207,9 +207,10 @@ struct plip_local { | |||
207 | 207 | ||
208 | struct net_local { | 208 | struct net_local { |
209 | struct net_device_stats enet_stats; | 209 | struct net_device_stats enet_stats; |
210 | struct net_device *dev; | ||
210 | struct work_struct immediate; | 211 | struct work_struct immediate; |
211 | struct work_struct deferred; | 212 | struct delayed_work deferred; |
212 | struct work_struct timer; | 213 | struct delayed_work timer; |
213 | struct plip_local snd_data; | 214 | struct plip_local snd_data; |
214 | struct plip_local rcv_data; | 215 | struct plip_local rcv_data; |
215 | struct pardevice *pardev; | 216 | struct pardevice *pardev; |
@@ -306,11 +307,11 @@ plip_init_netdev(struct net_device *dev) | |||
306 | nl->nibble = PLIP_NIBBLE_WAIT; | 307 | nl->nibble = PLIP_NIBBLE_WAIT; |
307 | 308 | ||
308 | /* Initialize task queue structures */ | 309 | /* Initialize task queue structures */ |
309 | INIT_WORK(&nl->immediate, (void (*)(void *))plip_bh, dev); | 310 | INIT_WORK(&nl->immediate, plip_bh); |
310 | INIT_WORK(&nl->deferred, (void (*)(void *))plip_kick_bh, dev); | 311 | INIT_DELAYED_WORK(&nl->deferred, plip_kick_bh); |
311 | 312 | ||
312 | if (dev->irq == -1) | 313 | if (dev->irq == -1) |
313 | INIT_WORK(&nl->timer, (void (*)(void *))plip_timer_bh, dev); | 314 | INIT_DELAYED_WORK(&nl->timer, plip_timer_bh); |
314 | 315 | ||
315 | spin_lock_init(&nl->lock); | 316 | spin_lock_init(&nl->lock); |
316 | } | 317 | } |
@@ -319,9 +320,10 @@ plip_init_netdev(struct net_device *dev) | |||
319 | This routine is kicked by do_timer(). | 320 | This routine is kicked by do_timer(). |
320 | Request `plip_bh' to be invoked. */ | 321 | Request `plip_bh' to be invoked. */ |
321 | static void | 322 | static void |
322 | plip_kick_bh(struct net_device *dev) | 323 | plip_kick_bh(struct work_struct *work) |
323 | { | 324 | { |
324 | struct net_local *nl = netdev_priv(dev); | 325 | struct net_local *nl = |
326 | container_of(work, struct net_local, deferred.work); | ||
325 | 327 | ||
326 | if (nl->is_deferred) | 328 | if (nl->is_deferred) |
327 | schedule_work(&nl->immediate); | 329 | schedule_work(&nl->immediate); |
@@ -362,9 +364,9 @@ static const plip_func connection_state_table[] = | |||
362 | 364 | ||
363 | /* Bottom half handler of PLIP. */ | 365 | /* Bottom half handler of PLIP. */ |
364 | static void | 366 | static void |
365 | plip_bh(struct net_device *dev) | 367 | plip_bh(struct work_struct *work) |
366 | { | 368 | { |
367 | struct net_local *nl = netdev_priv(dev); | 369 | struct net_local *nl = container_of(work, struct net_local, immediate); |
368 | struct plip_local *snd = &nl->snd_data; | 370 | struct plip_local *snd = &nl->snd_data; |
369 | struct plip_local *rcv = &nl->rcv_data; | 371 | struct plip_local *rcv = &nl->rcv_data; |
370 | plip_func f; | 372 | plip_func f; |
@@ -372,20 +374,21 @@ plip_bh(struct net_device *dev) | |||
372 | 374 | ||
373 | nl->is_deferred = 0; | 375 | nl->is_deferred = 0; |
374 | f = connection_state_table[nl->connection]; | 376 | f = connection_state_table[nl->connection]; |
375 | if ((r = (*f)(dev, nl, snd, rcv)) != OK | 377 | if ((r = (*f)(nl->dev, nl, snd, rcv)) != OK |
376 | && (r = plip_bh_timeout_error(dev, nl, snd, rcv, r)) != OK) { | 378 | && (r = plip_bh_timeout_error(nl->dev, nl, snd, rcv, r)) != OK) { |
377 | nl->is_deferred = 1; | 379 | nl->is_deferred = 1; |
378 | schedule_delayed_work(&nl->deferred, 1); | 380 | schedule_delayed_work(&nl->deferred, 1); |
379 | } | 381 | } |
380 | } | 382 | } |
381 | 383 | ||
382 | static void | 384 | static void |
383 | plip_timer_bh(struct net_device *dev) | 385 | plip_timer_bh(struct work_struct *work) |
384 | { | 386 | { |
385 | struct net_local *nl = netdev_priv(dev); | 387 | struct net_local *nl = |
388 | container_of(work, struct net_local, timer.work); | ||
386 | 389 | ||
387 | if (!(atomic_read (&nl->kill_timer))) { | 390 | if (!(atomic_read (&nl->kill_timer))) { |
388 | plip_interrupt (-1, dev); | 391 | plip_interrupt (-1, nl->dev); |
389 | 392 | ||
390 | schedule_delayed_work(&nl->timer, 1); | 393 | schedule_delayed_work(&nl->timer, 1); |
391 | } | 394 | } |
@@ -1284,6 +1287,7 @@ static void plip_attach (struct parport *port) | |||
1284 | } | 1287 | } |
1285 | 1288 | ||
1286 | nl = netdev_priv(dev); | 1289 | nl = netdev_priv(dev); |
1290 | nl->dev = dev; | ||
1287 | nl->pardev = parport_register_device(port, name, plip_preempt, | 1291 | nl->pardev = parport_register_device(port, name, plip_preempt, |
1288 | plip_wakeup, plip_interrupt, | 1292 | plip_wakeup, plip_interrupt, |
1289 | 0, dev); | 1293 | 0, dev); |
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index ec640f6229ae..d79d141a601d 100644 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c | |||
@@ -2008,7 +2008,7 @@ static irqreturn_t ql3xxx_isr(int irq, void *dev_id) | |||
2008 | "%s: Another function issued a reset to the " | 2008 | "%s: Another function issued a reset to the " |
2009 | "chip. ISR value = %x.\n", ndev->name, value); | 2009 | "chip. ISR value = %x.\n", ndev->name, value); |
2010 | } | 2010 | } |
2011 | queue_work(qdev->workqueue, &qdev->reset_work); | 2011 | queue_delayed_work(qdev->workqueue, &qdev->reset_work, 0); |
2012 | spin_unlock(&qdev->adapter_lock); | 2012 | spin_unlock(&qdev->adapter_lock); |
2013 | } else if (value & ISP_IMR_DISABLE_CMPL_INT) { | 2013 | } else if (value & ISP_IMR_DISABLE_CMPL_INT) { |
2014 | ql_disable_interrupts(qdev); | 2014 | ql_disable_interrupts(qdev); |
@@ -3182,11 +3182,13 @@ static void ql3xxx_tx_timeout(struct net_device *ndev) | |||
3182 | /* | 3182 | /* |
3183 | * Wake up the worker to process this event. | 3183 | * Wake up the worker to process this event. |
3184 | */ | 3184 | */ |
3185 | queue_work(qdev->workqueue, &qdev->tx_timeout_work); | 3185 | queue_delayed_work(qdev->workqueue, &qdev->tx_timeout_work, 0); |
3186 | } | 3186 | } |
3187 | 3187 | ||
3188 | static void ql_reset_work(struct ql3_adapter *qdev) | 3188 | static void ql_reset_work(struct work_struct *work) |
3189 | { | 3189 | { |
3190 | struct ql3_adapter *qdev = | ||
3191 | container_of(work, struct ql3_adapter, reset_work.work); | ||
3190 | struct net_device *ndev = qdev->ndev; | 3192 | struct net_device *ndev = qdev->ndev; |
3191 | u32 value; | 3193 | u32 value; |
3192 | struct ql_tx_buf_cb *tx_cb; | 3194 | struct ql_tx_buf_cb *tx_cb; |
@@ -3278,9 +3280,12 @@ static void ql_reset_work(struct ql3_adapter *qdev) | |||
3278 | } | 3280 | } |
3279 | } | 3281 | } |
3280 | 3282 | ||
3281 | static void ql_tx_timeout_work(struct ql3_adapter *qdev) | 3283 | static void ql_tx_timeout_work(struct work_struct *work) |
3282 | { | 3284 | { |
3283 | ql_cycle_adapter(qdev,QL_DO_RESET); | 3285 | struct ql3_adapter *qdev = |
3286 | container_of(work, struct ql3_adapter, tx_timeout_work.work); | ||
3287 | |||
3288 | ql_cycle_adapter(qdev, QL_DO_RESET); | ||
3284 | } | 3289 | } |
3285 | 3290 | ||
3286 | static void ql_get_board_info(struct ql3_adapter *qdev) | 3291 | static void ql_get_board_info(struct ql3_adapter *qdev) |
@@ -3459,9 +3464,8 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev, | |||
3459 | netif_stop_queue(ndev); | 3464 | netif_stop_queue(ndev); |
3460 | 3465 | ||
3461 | qdev->workqueue = create_singlethread_workqueue(ndev->name); | 3466 | qdev->workqueue = create_singlethread_workqueue(ndev->name); |
3462 | INIT_WORK(&qdev->reset_work, (void (*)(void *))ql_reset_work, qdev); | 3467 | INIT_DELAYED_WORK(&qdev->reset_work, ql_reset_work); |
3463 | INIT_WORK(&qdev->tx_timeout_work, | 3468 | INIT_DELAYED_WORK(&qdev->tx_timeout_work, ql_tx_timeout_work); |
3464 | (void (*)(void *))ql_tx_timeout_work, qdev); | ||
3465 | 3469 | ||
3466 | init_timer(&qdev->adapter_timer); | 3470 | init_timer(&qdev->adapter_timer); |
3467 | qdev->adapter_timer.function = ql3xxx_timer; | 3471 | qdev->adapter_timer.function = ql3xxx_timer; |
diff --git a/drivers/net/qla3xxx.h b/drivers/net/qla3xxx.h index 65da2c0bfda6..ea94de7fd071 100644 --- a/drivers/net/qla3xxx.h +++ b/drivers/net/qla3xxx.h | |||
@@ -1186,8 +1186,8 @@ struct ql3_adapter { | |||
1186 | u32 numPorts; | 1186 | u32 numPorts; |
1187 | struct net_device_stats stats; | 1187 | struct net_device_stats stats; |
1188 | struct workqueue_struct *workqueue; | 1188 | struct workqueue_struct *workqueue; |
1189 | struct work_struct reset_work; | 1189 | struct delayed_work reset_work; |
1190 | struct work_struct tx_timeout_work; | 1190 | struct delayed_work tx_timeout_work; |
1191 | u32 max_frame_size; | 1191 | u32 max_frame_size; |
1192 | }; | 1192 | }; |
1193 | 1193 | ||
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 45d3ca431957..85a392fab5cc 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -424,6 +424,7 @@ struct ring_info { | |||
424 | struct rtl8169_private { | 424 | struct rtl8169_private { |
425 | void __iomem *mmio_addr; /* memory map physical address */ | 425 | void __iomem *mmio_addr; /* memory map physical address */ |
426 | struct pci_dev *pci_dev; /* Index of PCI device */ | 426 | struct pci_dev *pci_dev; /* Index of PCI device */ |
427 | struct net_device *dev; | ||
427 | struct net_device_stats stats; /* statistics of net device */ | 428 | struct net_device_stats stats; /* statistics of net device */ |
428 | spinlock_t lock; /* spin lock flag */ | 429 | spinlock_t lock; /* spin lock flag */ |
429 | u32 msg_enable; | 430 | u32 msg_enable; |
@@ -455,7 +456,7 @@ struct rtl8169_private { | |||
455 | void (*phy_reset_enable)(void __iomem *); | 456 | void (*phy_reset_enable)(void __iomem *); |
456 | unsigned int (*phy_reset_pending)(void __iomem *); | 457 | unsigned int (*phy_reset_pending)(void __iomem *); |
457 | unsigned int (*link_ok)(void __iomem *); | 458 | unsigned int (*link_ok)(void __iomem *); |
458 | struct work_struct task; | 459 | struct delayed_work task; |
459 | unsigned wol_enabled : 1; | 460 | unsigned wol_enabled : 1; |
460 | }; | 461 | }; |
461 | 462 | ||
@@ -1510,6 +1511,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1510 | SET_MODULE_OWNER(dev); | 1511 | SET_MODULE_OWNER(dev); |
1511 | SET_NETDEV_DEV(dev, &pdev->dev); | 1512 | SET_NETDEV_DEV(dev, &pdev->dev); |
1512 | tp = netdev_priv(dev); | 1513 | tp = netdev_priv(dev); |
1514 | tp->dev = dev; | ||
1513 | tp->msg_enable = netif_msg_init(debug.msg_enable, R8169_MSG_DEFAULT); | 1515 | tp->msg_enable = netif_msg_init(debug.msg_enable, R8169_MSG_DEFAULT); |
1514 | 1516 | ||
1515 | /* enable device (incl. PCI PM wakeup and hotplug setup) */ | 1517 | /* enable device (incl. PCI PM wakeup and hotplug setup) */ |
@@ -1782,7 +1784,7 @@ static int rtl8169_open(struct net_device *dev) | |||
1782 | if (retval < 0) | 1784 | if (retval < 0) |
1783 | goto err_free_rx; | 1785 | goto err_free_rx; |
1784 | 1786 | ||
1785 | INIT_WORK(&tp->task, NULL, dev); | 1787 | INIT_DELAYED_WORK(&tp->task, NULL); |
1786 | 1788 | ||
1787 | rtl8169_hw_start(dev); | 1789 | rtl8169_hw_start(dev); |
1788 | 1790 | ||
@@ -2105,11 +2107,11 @@ static void rtl8169_tx_clear(struct rtl8169_private *tp) | |||
2105 | tp->cur_tx = tp->dirty_tx = 0; | 2107 | tp->cur_tx = tp->dirty_tx = 0; |
2106 | } | 2108 | } |
2107 | 2109 | ||
2108 | static void rtl8169_schedule_work(struct net_device *dev, void (*task)(void *)) | 2110 | static void rtl8169_schedule_work(struct net_device *dev, work_func_t task) |
2109 | { | 2111 | { |
2110 | struct rtl8169_private *tp = netdev_priv(dev); | 2112 | struct rtl8169_private *tp = netdev_priv(dev); |
2111 | 2113 | ||
2112 | PREPARE_WORK(&tp->task, task, dev); | 2114 | PREPARE_DELAYED_WORK(&tp->task, task); |
2113 | schedule_delayed_work(&tp->task, 4); | 2115 | schedule_delayed_work(&tp->task, 4); |
2114 | } | 2116 | } |
2115 | 2117 | ||
@@ -2128,9 +2130,11 @@ static void rtl8169_wait_for_quiescence(struct net_device *dev) | |||
2128 | netif_poll_enable(dev); | 2130 | netif_poll_enable(dev); |
2129 | } | 2131 | } |
2130 | 2132 | ||
2131 | static void rtl8169_reinit_task(void *_data) | 2133 | static void rtl8169_reinit_task(struct work_struct *work) |
2132 | { | 2134 | { |
2133 | struct net_device *dev = _data; | 2135 | struct rtl8169_private *tp = |
2136 | container_of(work, struct rtl8169_private, task.work); | ||
2137 | struct net_device *dev = tp->dev; | ||
2134 | int ret; | 2138 | int ret; |
2135 | 2139 | ||
2136 | if (netif_running(dev)) { | 2140 | if (netif_running(dev)) { |
@@ -2153,10 +2157,11 @@ static void rtl8169_reinit_task(void *_data) | |||
2153 | } | 2157 | } |
2154 | } | 2158 | } |
2155 | 2159 | ||
2156 | static void rtl8169_reset_task(void *_data) | 2160 | static void rtl8169_reset_task(struct work_struct *work) |
2157 | { | 2161 | { |
2158 | struct net_device *dev = _data; | 2162 | struct rtl8169_private *tp = |
2159 | struct rtl8169_private *tp = netdev_priv(dev); | 2163 | container_of(work, struct rtl8169_private, task.work); |
2164 | struct net_device *dev = tp->dev; | ||
2160 | 2165 | ||
2161 | if (!netif_running(dev)) | 2166 | if (!netif_running(dev)) |
2162 | return; | 2167 | return; |
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 33569ec9dbfc..250cdbeefdfd 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -5872,9 +5872,9 @@ static void s2io_tasklet(unsigned long dev_addr) | |||
5872 | * Description: Sets the link status for the adapter | 5872 | * Description: Sets the link status for the adapter |
5873 | */ | 5873 | */ |
5874 | 5874 | ||
5875 | static void s2io_set_link(unsigned long data) | 5875 | static void s2io_set_link(struct work_struct *work) |
5876 | { | 5876 | { |
5877 | nic_t *nic = (nic_t *) data; | 5877 | nic_t *nic = container_of(work, nic_t, set_link_task); |
5878 | struct net_device *dev = nic->dev; | 5878 | struct net_device *dev = nic->dev; |
5879 | XENA_dev_config_t __iomem *bar0 = nic->bar0; | 5879 | XENA_dev_config_t __iomem *bar0 = nic->bar0; |
5880 | register u64 val64; | 5880 | register u64 val64; |
@@ -6379,10 +6379,10 @@ static int s2io_card_up(nic_t * sp) | |||
6379 | * spin lock. | 6379 | * spin lock. |
6380 | */ | 6380 | */ |
6381 | 6381 | ||
6382 | static void s2io_restart_nic(unsigned long data) | 6382 | static void s2io_restart_nic(struct work_struct *work) |
6383 | { | 6383 | { |
6384 | struct net_device *dev = (struct net_device *) data; | 6384 | nic_t *sp = container_of(work, nic_t, rst_timer_task); |
6385 | nic_t *sp = dev->priv; | 6385 | struct net_device *dev = sp->dev; |
6386 | 6386 | ||
6387 | s2io_card_down(sp); | 6387 | s2io_card_down(sp); |
6388 | if (s2io_card_up(sp)) { | 6388 | if (s2io_card_up(sp)) { |
@@ -6992,10 +6992,8 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
6992 | 6992 | ||
6993 | dev->tx_timeout = &s2io_tx_watchdog; | 6993 | dev->tx_timeout = &s2io_tx_watchdog; |
6994 | dev->watchdog_timeo = WATCH_DOG_TIMEOUT; | 6994 | dev->watchdog_timeo = WATCH_DOG_TIMEOUT; |
6995 | INIT_WORK(&sp->rst_timer_task, | 6995 | INIT_WORK(&sp->rst_timer_task, s2io_restart_nic); |
6996 | (void (*)(void *)) s2io_restart_nic, dev); | 6996 | INIT_WORK(&sp->set_link_task, s2io_set_link); |
6997 | INIT_WORK(&sp->set_link_task, | ||
6998 | (void (*)(void *)) s2io_set_link, sp); | ||
6999 | 6997 | ||
7000 | pci_save_state(sp->pdev); | 6998 | pci_save_state(sp->pdev); |
7001 | 6999 | ||
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index 12b719f4d00f..3b0bafd273c8 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h | |||
@@ -1000,7 +1000,7 @@ s2io_msix_fifo_handle(int irq, void *dev_id); | |||
1000 | static irqreturn_t s2io_isr(int irq, void *dev_id); | 1000 | static irqreturn_t s2io_isr(int irq, void *dev_id); |
1001 | static int verify_xena_quiescence(nic_t *sp, u64 val64, int flag); | 1001 | static int verify_xena_quiescence(nic_t *sp, u64 val64, int flag); |
1002 | static const struct ethtool_ops netdev_ethtool_ops; | 1002 | static const struct ethtool_ops netdev_ethtool_ops; |
1003 | static void s2io_set_link(unsigned long data); | 1003 | static void s2io_set_link(struct work_struct *work); |
1004 | static int s2io_set_swapper(nic_t * sp); | 1004 | static int s2io_set_swapper(nic_t * sp); |
1005 | static void s2io_card_down(nic_t *nic); | 1005 | static void s2io_card_down(nic_t *nic); |
1006 | static int s2io_card_up(nic_t *nic); | 1006 | static int s2io_card_up(nic_t *nic); |
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c index aaba458584fb..b70ed79d4121 100644 --- a/drivers/net/sis190.c +++ b/drivers/net/sis190.c | |||
@@ -280,6 +280,7 @@ enum sis190_feature { | |||
280 | struct sis190_private { | 280 | struct sis190_private { |
281 | void __iomem *mmio_addr; | 281 | void __iomem *mmio_addr; |
282 | struct pci_dev *pci_dev; | 282 | struct pci_dev *pci_dev; |
283 | struct net_device *dev; | ||
283 | struct net_device_stats stats; | 284 | struct net_device_stats stats; |
284 | spinlock_t lock; | 285 | spinlock_t lock; |
285 | u32 rx_buf_sz; | 286 | u32 rx_buf_sz; |
@@ -897,10 +898,11 @@ static void sis190_hw_start(struct net_device *dev) | |||
897 | netif_start_queue(dev); | 898 | netif_start_queue(dev); |
898 | } | 899 | } |
899 | 900 | ||
900 | static void sis190_phy_task(void * data) | 901 | static void sis190_phy_task(struct work_struct *work) |
901 | { | 902 | { |
902 | struct net_device *dev = data; | 903 | struct sis190_private *tp = |
903 | struct sis190_private *tp = netdev_priv(dev); | 904 | container_of(work, struct sis190_private, phy_task); |
905 | struct net_device *dev = tp->dev; | ||
904 | void __iomem *ioaddr = tp->mmio_addr; | 906 | void __iomem *ioaddr = tp->mmio_addr; |
905 | int phy_id = tp->mii_if.phy_id; | 907 | int phy_id = tp->mii_if.phy_id; |
906 | u16 val; | 908 | u16 val; |
@@ -1047,7 +1049,7 @@ static int sis190_open(struct net_device *dev) | |||
1047 | if (rc < 0) | 1049 | if (rc < 0) |
1048 | goto err_free_rx_1; | 1050 | goto err_free_rx_1; |
1049 | 1051 | ||
1050 | INIT_WORK(&tp->phy_task, sis190_phy_task, dev); | 1052 | INIT_WORK(&tp->phy_task, sis190_phy_task); |
1051 | 1053 | ||
1052 | sis190_request_timer(dev); | 1054 | sis190_request_timer(dev); |
1053 | 1055 | ||
@@ -1436,6 +1438,7 @@ static struct net_device * __devinit sis190_init_board(struct pci_dev *pdev) | |||
1436 | SET_NETDEV_DEV(dev, &pdev->dev); | 1438 | SET_NETDEV_DEV(dev, &pdev->dev); |
1437 | 1439 | ||
1438 | tp = netdev_priv(dev); | 1440 | tp = netdev_priv(dev); |
1441 | tp->dev = dev; | ||
1439 | tp->msg_enable = netif_msg_init(debug.msg_enable, SIS190_MSG_DEFAULT); | 1442 | tp->msg_enable = netif_msg_init(debug.msg_enable, SIS190_MSG_DEFAULT); |
1440 | 1443 | ||
1441 | rc = pci_enable_device(pdev); | 1444 | rc = pci_enable_device(pdev); |
@@ -1798,7 +1801,7 @@ static int __devinit sis190_init_one(struct pci_dev *pdev, | |||
1798 | 1801 | ||
1799 | sis190_init_rxfilter(dev); | 1802 | sis190_init_rxfilter(dev); |
1800 | 1803 | ||
1801 | INIT_WORK(&tp->phy_task, sis190_phy_task, dev); | 1804 | INIT_WORK(&tp->phy_task, sis190_phy_task); |
1802 | 1805 | ||
1803 | dev->open = sis190_open; | 1806 | dev->open = sis190_open; |
1804 | dev->stop = sis190_close; | 1807 | dev->stop = sis190_close; |
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 5513907e8393..b60f0451f6cd 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -1327,10 +1327,11 @@ static void xm_check_link(struct net_device *dev) | |||
1327 | * Since internal PHY is wired to a level triggered pin, can't | 1327 | * Since internal PHY is wired to a level triggered pin, can't |
1328 | * get an interrupt when carrier is detected. | 1328 | * get an interrupt when carrier is detected. |
1329 | */ | 1329 | */ |
1330 | static void xm_link_timer(void *arg) | 1330 | static void xm_link_timer(struct work_struct *work) |
1331 | { | 1331 | { |
1332 | struct net_device *dev = arg; | 1332 | struct skge_port *skge = |
1333 | struct skge_port *skge = netdev_priv(arg); | 1333 | container_of(work, struct skge_port, link_thread.work); |
1334 | struct net_device *dev = skge->netdev; | ||
1334 | struct skge_hw *hw = skge->hw; | 1335 | struct skge_hw *hw = skge->hw; |
1335 | int port = skge->port; | 1336 | int port = skge->port; |
1336 | 1337 | ||
@@ -3072,9 +3073,9 @@ static void skge_error_irq(struct skge_hw *hw) | |||
3072 | * because accessing phy registers requires spin wait which might | 3073 | * because accessing phy registers requires spin wait which might |
3073 | * cause excess interrupt latency. | 3074 | * cause excess interrupt latency. |
3074 | */ | 3075 | */ |
3075 | static void skge_extirq(void *arg) | 3076 | static void skge_extirq(struct work_struct *work) |
3076 | { | 3077 | { |
3077 | struct skge_hw *hw = arg; | 3078 | struct skge_hw *hw = container_of(work, struct skge_hw, phy_work); |
3078 | int port; | 3079 | int port; |
3079 | 3080 | ||
3080 | mutex_lock(&hw->phy_mutex); | 3081 | mutex_lock(&hw->phy_mutex); |
@@ -3456,7 +3457,7 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port, | |||
3456 | skge->port = port; | 3457 | skge->port = port; |
3457 | 3458 | ||
3458 | /* Only used for Genesis XMAC */ | 3459 | /* Only used for Genesis XMAC */ |
3459 | INIT_WORK(&skge->link_thread, xm_link_timer, dev); | 3460 | INIT_DELAYED_WORK(&skge->link_thread, xm_link_timer); |
3460 | 3461 | ||
3461 | if (hw->chip_id != CHIP_ID_GENESIS) { | 3462 | if (hw->chip_id != CHIP_ID_GENESIS) { |
3462 | dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; | 3463 | dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; |
@@ -3543,7 +3544,7 @@ static int __devinit skge_probe(struct pci_dev *pdev, | |||
3543 | 3544 | ||
3544 | hw->pdev = pdev; | 3545 | hw->pdev = pdev; |
3545 | mutex_init(&hw->phy_mutex); | 3546 | mutex_init(&hw->phy_mutex); |
3546 | INIT_WORK(&hw->phy_work, skge_extirq, hw); | 3547 | INIT_WORK(&hw->phy_work, skge_extirq); |
3547 | spin_lock_init(&hw->hw_lock); | 3548 | spin_lock_init(&hw->hw_lock); |
3548 | 3549 | ||
3549 | hw->regs = ioremap_nocache(pci_resource_start(pdev, 0), 0x4000); | 3550 | hw->regs = ioremap_nocache(pci_resource_start(pdev, 0), 0x4000); |
diff --git a/drivers/net/skge.h b/drivers/net/skge.h index 537c0aaa1db8..23e5275d920c 100644 --- a/drivers/net/skge.h +++ b/drivers/net/skge.h | |||
@@ -2456,7 +2456,7 @@ struct skge_port { | |||
2456 | 2456 | ||
2457 | struct net_device_stats net_stats; | 2457 | struct net_device_stats net_stats; |
2458 | 2458 | ||
2459 | struct work_struct link_thread; | 2459 | struct delayed_work link_thread; |
2460 | enum pause_control flow_control; | 2460 | enum pause_control flow_control; |
2461 | enum pause_status flow_status; | 2461 | enum pause_status flow_status; |
2462 | u8 rx_csum; | 2462 | u8 rx_csum; |
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index 95b6478f55c6..e62a9586fb95 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c | |||
@@ -210,6 +210,7 @@ struct smc_local { | |||
210 | 210 | ||
211 | /* work queue */ | 211 | /* work queue */ |
212 | struct work_struct phy_configure; | 212 | struct work_struct phy_configure; |
213 | struct net_device *dev; | ||
213 | int work_pending; | 214 | int work_pending; |
214 | 215 | ||
215 | spinlock_t lock; | 216 | spinlock_t lock; |
@@ -1114,10 +1115,11 @@ static void smc_phy_check_media(struct net_device *dev, int init) | |||
1114 | * of autonegotiation.) If the RPC ANEG bit is cleared, the selection | 1115 | * of autonegotiation.) If the RPC ANEG bit is cleared, the selection |
1115 | * is controlled by the RPC SPEED and RPC DPLX bits. | 1116 | * is controlled by the RPC SPEED and RPC DPLX bits. |
1116 | */ | 1117 | */ |
1117 | static void smc_phy_configure(void *data) | 1118 | static void smc_phy_configure(struct work_struct *work) |
1118 | { | 1119 | { |
1119 | struct net_device *dev = data; | 1120 | struct smc_local *lp = |
1120 | struct smc_local *lp = netdev_priv(dev); | 1121 | container_of(work, struct smc_local, phy_configure); |
1122 | struct net_device *dev = lp->dev; | ||
1121 | void __iomem *ioaddr = lp->base; | 1123 | void __iomem *ioaddr = lp->base; |
1122 | int phyaddr = lp->mii.phy_id; | 1124 | int phyaddr = lp->mii.phy_id; |
1123 | int my_phy_caps; /* My PHY capabilities */ | 1125 | int my_phy_caps; /* My PHY capabilities */ |
@@ -1592,7 +1594,7 @@ smc_open(struct net_device *dev) | |||
1592 | 1594 | ||
1593 | /* Configure the PHY, initialize the link state */ | 1595 | /* Configure the PHY, initialize the link state */ |
1594 | if (lp->phy_type != 0) | 1596 | if (lp->phy_type != 0) |
1595 | smc_phy_configure(dev); | 1597 | smc_phy_configure(&lp->phy_configure); |
1596 | else { | 1598 | else { |
1597 | spin_lock_irq(&lp->lock); | 1599 | spin_lock_irq(&lp->lock); |
1598 | smc_10bt_check_media(dev, 1); | 1600 | smc_10bt_check_media(dev, 1); |
@@ -1972,7 +1974,8 @@ static int __init smc_probe(struct net_device *dev, void __iomem *ioaddr) | |||
1972 | #endif | 1974 | #endif |
1973 | 1975 | ||
1974 | tasklet_init(&lp->tx_task, smc_hardware_send_pkt, (unsigned long)dev); | 1976 | tasklet_init(&lp->tx_task, smc_hardware_send_pkt, (unsigned long)dev); |
1975 | INIT_WORK(&lp->phy_configure, smc_phy_configure, dev); | 1977 | INIT_WORK(&lp->phy_configure, smc_phy_configure); |
1978 | lp->dev = dev; | ||
1976 | lp->mii.phy_id_mask = 0x1f; | 1979 | lp->mii.phy_id_mask = 0x1f; |
1977 | lp->mii.reg_num_mask = 0x1f; | 1980 | lp->mii.reg_num_mask = 0x1f; |
1978 | lp->mii.force_media = 0; | 1981 | lp->mii.force_media = 0; |
@@ -2322,7 +2325,7 @@ static int smc_drv_resume(struct platform_device *dev) | |||
2322 | smc_reset(ndev); | 2325 | smc_reset(ndev); |
2323 | smc_enable(ndev); | 2326 | smc_enable(ndev); |
2324 | if (lp->phy_type != 0) | 2327 | if (lp->phy_type != 0) |
2325 | smc_phy_configure(ndev); | 2328 | smc_phy_configure(&lp->phy_configure); |
2326 | netif_device_attach(ndev); | 2329 | netif_device_attach(ndev); |
2327 | } | 2330 | } |
2328 | } | 2331 | } |
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c index 13e0a43e423b..ebb6aa39f9c7 100644 --- a/drivers/net/spider_net.c +++ b/drivers/net/spider_net.c | |||
@@ -1939,10 +1939,11 @@ spider_net_stop(struct net_device *netdev) | |||
1939 | * called as task when tx hangs, resets interface (if interface is up) | 1939 | * called as task when tx hangs, resets interface (if interface is up) |
1940 | */ | 1940 | */ |
1941 | static void | 1941 | static void |
1942 | spider_net_tx_timeout_task(void *data) | 1942 | spider_net_tx_timeout_task(struct work_struct *work) |
1943 | { | 1943 | { |
1944 | struct net_device *netdev = data; | 1944 | struct spider_net_card *card = |
1945 | struct spider_net_card *card = netdev_priv(netdev); | 1945 | container_of(work, struct spider_net_card, tx_timeout_task); |
1946 | struct net_device *netdev = card->netdev; | ||
1946 | 1947 | ||
1947 | if (!(netdev->flags & IFF_UP)) | 1948 | if (!(netdev->flags & IFF_UP)) |
1948 | goto out; | 1949 | goto out; |
@@ -2116,7 +2117,7 @@ spider_net_alloc_card(void) | |||
2116 | card = netdev_priv(netdev); | 2117 | card = netdev_priv(netdev); |
2117 | card->netdev = netdev; | 2118 | card->netdev = netdev; |
2118 | card->msg_enable = SPIDER_NET_DEFAULT_MSG; | 2119 | card->msg_enable = SPIDER_NET_DEFAULT_MSG; |
2119 | INIT_WORK(&card->tx_timeout_task, spider_net_tx_timeout_task, netdev); | 2120 | INIT_WORK(&card->tx_timeout_task, spider_net_tx_timeout_task); |
2120 | init_waitqueue_head(&card->waitq); | 2121 | init_waitqueue_head(&card->waitq); |
2121 | atomic_set(&card->tx_timeout_task_counter, 0); | 2122 | atomic_set(&card->tx_timeout_task_counter, 0); |
2122 | 2123 | ||
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c index cf44e72399b9..785e4a535f9e 100644 --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c | |||
@@ -2282,9 +2282,9 @@ static void gem_do_stop(struct net_device *dev, int wol) | |||
2282 | } | 2282 | } |
2283 | } | 2283 | } |
2284 | 2284 | ||
2285 | static void gem_reset_task(void *data) | 2285 | static void gem_reset_task(struct work_struct *work) |
2286 | { | 2286 | { |
2287 | struct gem *gp = (struct gem *) data; | 2287 | struct gem *gp = container_of(work, struct gem, reset_task); |
2288 | 2288 | ||
2289 | mutex_lock(&gp->pm_mutex); | 2289 | mutex_lock(&gp->pm_mutex); |
2290 | 2290 | ||
@@ -3044,7 +3044,7 @@ static int __devinit gem_init_one(struct pci_dev *pdev, | |||
3044 | gp->link_timer.function = gem_link_timer; | 3044 | gp->link_timer.function = gem_link_timer; |
3045 | gp->link_timer.data = (unsigned long) gp; | 3045 | gp->link_timer.data = (unsigned long) gp; |
3046 | 3046 | ||
3047 | INIT_WORK(&gp->reset_task, gem_reset_task, gp); | 3047 | INIT_WORK(&gp->reset_task, gem_reset_task); |
3048 | 3048 | ||
3049 | gp->lstate = link_down; | 3049 | gp->lstate = link_down; |
3050 | gp->timer_ticks = 0; | 3050 | gp->timer_ticks = 0; |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index c20bb998e0e5..d9123c9adc1e 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -3654,9 +3654,9 @@ static void tg3_poll_controller(struct net_device *dev) | |||
3654 | } | 3654 | } |
3655 | #endif | 3655 | #endif |
3656 | 3656 | ||
3657 | static void tg3_reset_task(void *_data) | 3657 | static void tg3_reset_task(struct work_struct *work) |
3658 | { | 3658 | { |
3659 | struct tg3 *tp = _data; | 3659 | struct tg3 *tp = container_of(work, struct tg3, reset_task); |
3660 | unsigned int restart_timer; | 3660 | unsigned int restart_timer; |
3661 | 3661 | ||
3662 | tg3_full_lock(tp, 0); | 3662 | tg3_full_lock(tp, 0); |
@@ -11734,7 +11734,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
11734 | #endif | 11734 | #endif |
11735 | spin_lock_init(&tp->lock); | 11735 | spin_lock_init(&tp->lock); |
11736 | spin_lock_init(&tp->indirect_lock); | 11736 | spin_lock_init(&tp->indirect_lock); |
11737 | INIT_WORK(&tp->reset_task, tg3_reset_task, tp); | 11737 | INIT_WORK(&tp->reset_task, tg3_reset_task); |
11738 | 11738 | ||
11739 | tp->regs = ioremap_nocache(tg3reg_base, tg3reg_len); | 11739 | tp->regs = ioremap_nocache(tg3reg_base, tg3reg_len); |
11740 | if (tp->regs == 0UL) { | 11740 | if (tp->regs == 0UL) { |
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c index e14f5a00f65a..f85f00251123 100644 --- a/drivers/net/tlan.c +++ b/drivers/net/tlan.c | |||
@@ -296,6 +296,7 @@ static void TLan_SetMulticastList( struct net_device *); | |||
296 | static int TLan_ioctl( struct net_device *dev, struct ifreq *rq, int cmd); | 296 | static int TLan_ioctl( struct net_device *dev, struct ifreq *rq, int cmd); |
297 | static int TLan_probe1( struct pci_dev *pdev, long ioaddr, int irq, int rev, const struct pci_device_id *ent); | 297 | static int TLan_probe1( struct pci_dev *pdev, long ioaddr, int irq, int rev, const struct pci_device_id *ent); |
298 | static void TLan_tx_timeout( struct net_device *dev); | 298 | static void TLan_tx_timeout( struct net_device *dev); |
299 | static void TLan_tx_timeout_work(struct work_struct *work); | ||
299 | static int tlan_init_one( struct pci_dev *pdev, const struct pci_device_id *ent); | 300 | static int tlan_init_one( struct pci_dev *pdev, const struct pci_device_id *ent); |
300 | 301 | ||
301 | static u32 TLan_HandleInvalid( struct net_device *, u16 ); | 302 | static u32 TLan_HandleInvalid( struct net_device *, u16 ); |
@@ -562,6 +563,7 @@ static int __devinit TLan_probe1(struct pci_dev *pdev, | |||
562 | priv = netdev_priv(dev); | 563 | priv = netdev_priv(dev); |
563 | 564 | ||
564 | priv->pciDev = pdev; | 565 | priv->pciDev = pdev; |
566 | priv->dev = dev; | ||
565 | 567 | ||
566 | /* Is this a PCI device? */ | 568 | /* Is this a PCI device? */ |
567 | if (pdev) { | 569 | if (pdev) { |
@@ -634,7 +636,7 @@ static int __devinit TLan_probe1(struct pci_dev *pdev, | |||
634 | 636 | ||
635 | /* This will be used when we get an adapter error from | 637 | /* This will be used when we get an adapter error from |
636 | * within our irq handler */ | 638 | * within our irq handler */ |
637 | INIT_WORK(&priv->tlan_tqueue, (void *)(void*)TLan_tx_timeout, dev); | 639 | INIT_WORK(&priv->tlan_tqueue, TLan_tx_timeout_work); |
638 | 640 | ||
639 | spin_lock_init(&priv->lock); | 641 | spin_lock_init(&priv->lock); |
640 | 642 | ||
@@ -1040,6 +1042,25 @@ static void TLan_tx_timeout(struct net_device *dev) | |||
1040 | } | 1042 | } |
1041 | 1043 | ||
1042 | 1044 | ||
1045 | /*************************************************************** | ||
1046 | * TLan_tx_timeout_work | ||
1047 | * | ||
1048 | * Returns: nothing | ||
1049 | * | ||
1050 | * Params: | ||
1051 | * work work item of device which timed out | ||
1052 | * | ||
1053 | **************************************************************/ | ||
1054 | |||
1055 | static void TLan_tx_timeout_work(struct work_struct *work) | ||
1056 | { | ||
1057 | TLanPrivateInfo *priv = | ||
1058 | container_of(work, TLanPrivateInfo, tlan_tqueue); | ||
1059 | |||
1060 | TLan_tx_timeout(priv->dev); | ||
1061 | } | ||
1062 | |||
1063 | |||
1043 | 1064 | ||
1044 | /*************************************************************** | 1065 | /*************************************************************** |
1045 | * TLan_StartTx | 1066 | * TLan_StartTx |
diff --git a/drivers/net/tlan.h b/drivers/net/tlan.h index a44e2f2ef62a..41ce0b665937 100644 --- a/drivers/net/tlan.h +++ b/drivers/net/tlan.h | |||
@@ -170,6 +170,7 @@ typedef u8 TLanBuffer[TLAN_MAX_FRAME_SIZE]; | |||
170 | typedef struct tlan_private_tag { | 170 | typedef struct tlan_private_tag { |
171 | struct net_device *nextDevice; | 171 | struct net_device *nextDevice; |
172 | struct pci_dev *pciDev; | 172 | struct pci_dev *pciDev; |
173 | struct net_device *dev; | ||
173 | void *dmaStorage; | 174 | void *dmaStorage; |
174 | dma_addr_t dmaStorageDMA; | 175 | dma_addr_t dmaStorageDMA; |
175 | unsigned int dmaSize; | 176 | unsigned int dmaSize; |
diff --git a/drivers/net/tulip/21142.c b/drivers/net/tulip/21142.c index fa3a2bb105ad..942b839ccc5b 100644 --- a/drivers/net/tulip/21142.c +++ b/drivers/net/tulip/21142.c | |||
@@ -26,10 +26,11 @@ static u16 t21142_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, }; | |||
26 | 26 | ||
27 | /* Handle the 21143 uniquely: do autoselect with NWay, not the EEPROM list | 27 | /* Handle the 21143 uniquely: do autoselect with NWay, not the EEPROM list |
28 | of available transceivers. */ | 28 | of available transceivers. */ |
29 | void t21142_media_task(void *data) | 29 | void t21142_media_task(struct work_struct *work) |
30 | { | 30 | { |
31 | struct net_device *dev = data; | 31 | struct tulip_private *tp = |
32 | struct tulip_private *tp = netdev_priv(dev); | 32 | container_of(work, struct tulip_private, media_work); |
33 | struct net_device *dev = tp->dev; | ||
33 | void __iomem *ioaddr = tp->base_addr; | 34 | void __iomem *ioaddr = tp->base_addr; |
34 | int csr12 = ioread32(ioaddr + CSR12); | 35 | int csr12 = ioread32(ioaddr + CSR12); |
35 | int next_tick = 60*HZ; | 36 | int next_tick = 60*HZ; |
diff --git a/drivers/net/tulip/timer.c b/drivers/net/tulip/timer.c index 066e5d6bcbd8..df326fe1cc8f 100644 --- a/drivers/net/tulip/timer.c +++ b/drivers/net/tulip/timer.c | |||
@@ -18,10 +18,11 @@ | |||
18 | #include "tulip.h" | 18 | #include "tulip.h" |
19 | 19 | ||
20 | 20 | ||
21 | void tulip_media_task(void *data) | 21 | void tulip_media_task(struct work_struct *work) |
22 | { | 22 | { |
23 | struct net_device *dev = data; | 23 | struct tulip_private *tp = |
24 | struct tulip_private *tp = netdev_priv(dev); | 24 | container_of(work, struct tulip_private, media_work); |
25 | struct net_device *dev = tp->dev; | ||
25 | void __iomem *ioaddr = tp->base_addr; | 26 | void __iomem *ioaddr = tp->base_addr; |
26 | u32 csr12 = ioread32(ioaddr + CSR12); | 27 | u32 csr12 = ioread32(ioaddr + CSR12); |
27 | int next_tick = 2*HZ; | 28 | int next_tick = 2*HZ; |
diff --git a/drivers/net/tulip/tulip.h b/drivers/net/tulip/tulip.h index ad107f45c7b1..25f25da76917 100644 --- a/drivers/net/tulip/tulip.h +++ b/drivers/net/tulip/tulip.h | |||
@@ -44,7 +44,7 @@ struct tulip_chip_table { | |||
44 | int valid_intrs; /* CSR7 interrupt enable settings */ | 44 | int valid_intrs; /* CSR7 interrupt enable settings */ |
45 | int flags; | 45 | int flags; |
46 | void (*media_timer) (unsigned long); | 46 | void (*media_timer) (unsigned long); |
47 | void (*media_task) (void *); | 47 | work_func_t media_task; |
48 | }; | 48 | }; |
49 | 49 | ||
50 | 50 | ||
@@ -392,6 +392,7 @@ struct tulip_private { | |||
392 | int csr12_shadow; | 392 | int csr12_shadow; |
393 | int pad0; /* Used for 8-byte alignment */ | 393 | int pad0; /* Used for 8-byte alignment */ |
394 | struct work_struct media_work; | 394 | struct work_struct media_work; |
395 | struct net_device *dev; | ||
395 | }; | 396 | }; |
396 | 397 | ||
397 | 398 | ||
@@ -406,7 +407,7 @@ struct eeprom_fixup { | |||
406 | 407 | ||
407 | /* 21142.c */ | 408 | /* 21142.c */ |
408 | extern u16 t21142_csr14[]; | 409 | extern u16 t21142_csr14[]; |
409 | void t21142_media_task(void *data); | 410 | void t21142_media_task(struct work_struct *work); |
410 | void t21142_start_nway(struct net_device *dev); | 411 | void t21142_start_nway(struct net_device *dev); |
411 | void t21142_lnk_change(struct net_device *dev, int csr5); | 412 | void t21142_lnk_change(struct net_device *dev, int csr5); |
412 | 413 | ||
@@ -444,7 +445,7 @@ void pnic_lnk_change(struct net_device *dev, int csr5); | |||
444 | void pnic_timer(unsigned long data); | 445 | void pnic_timer(unsigned long data); |
445 | 446 | ||
446 | /* timer.c */ | 447 | /* timer.c */ |
447 | void tulip_media_task(void *data); | 448 | void tulip_media_task(struct work_struct *work); |
448 | void mxic_timer(unsigned long data); | 449 | void mxic_timer(unsigned long data); |
449 | void comet_timer(unsigned long data); | 450 | void comet_timer(unsigned long data); |
450 | 451 | ||
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index 0aee618f883c..5a35354aa523 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c | |||
@@ -1367,6 +1367,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1367 | * it is zeroed and aligned in alloc_etherdev | 1367 | * it is zeroed and aligned in alloc_etherdev |
1368 | */ | 1368 | */ |
1369 | tp = netdev_priv(dev); | 1369 | tp = netdev_priv(dev); |
1370 | tp->dev = dev; | ||
1370 | 1371 | ||
1371 | tp->rx_ring = pci_alloc_consistent(pdev, | 1372 | tp->rx_ring = pci_alloc_consistent(pdev, |
1372 | sizeof(struct tulip_rx_desc) * RX_RING_SIZE + | 1373 | sizeof(struct tulip_rx_desc) * RX_RING_SIZE + |
@@ -1389,7 +1390,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1389 | tp->timer.data = (unsigned long)dev; | 1390 | tp->timer.data = (unsigned long)dev; |
1390 | tp->timer.function = tulip_tbl[tp->chip_id].media_timer; | 1391 | tp->timer.function = tulip_tbl[tp->chip_id].media_timer; |
1391 | 1392 | ||
1392 | INIT_WORK(&tp->media_work, tulip_tbl[tp->chip_id].media_task, dev); | 1393 | INIT_WORK(&tp->media_work, tulip_tbl[tp->chip_id].media_task); |
1393 | 1394 | ||
1394 | dev->base_addr = (unsigned long)ioaddr; | 1395 | dev->base_addr = (unsigned long)ioaddr; |
1395 | 1396 | ||
diff --git a/drivers/net/wan/pc300_tty.c b/drivers/net/wan/pc300_tty.c index 931cbdf6d791..b2a23aed4428 100644 --- a/drivers/net/wan/pc300_tty.c +++ b/drivers/net/wan/pc300_tty.c | |||
@@ -125,8 +125,8 @@ static int cpc_tty_write_room(struct tty_struct *tty); | |||
125 | static int cpc_tty_chars_in_buffer(struct tty_struct *tty); | 125 | static int cpc_tty_chars_in_buffer(struct tty_struct *tty); |
126 | static void cpc_tty_flush_buffer(struct tty_struct *tty); | 126 | static void cpc_tty_flush_buffer(struct tty_struct *tty); |
127 | static void cpc_tty_hangup(struct tty_struct *tty); | 127 | static void cpc_tty_hangup(struct tty_struct *tty); |
128 | static void cpc_tty_rx_work(void *data); | 128 | static void cpc_tty_rx_work(struct work_struct *work); |
129 | static void cpc_tty_tx_work(void *data); | 129 | static void cpc_tty_tx_work(struct work_struct *work); |
130 | static int cpc_tty_send_to_card(pc300dev_t *dev,void *buf, int len); | 130 | static int cpc_tty_send_to_card(pc300dev_t *dev,void *buf, int len); |
131 | static void cpc_tty_trace(pc300dev_t *dev, char* buf, int len, char rxtx); | 131 | static void cpc_tty_trace(pc300dev_t *dev, char* buf, int len, char rxtx); |
132 | static void cpc_tty_signal_off(pc300dev_t *pc300dev, unsigned char); | 132 | static void cpc_tty_signal_off(pc300dev_t *pc300dev, unsigned char); |
@@ -261,8 +261,8 @@ void cpc_tty_init(pc300dev_t *pc300dev) | |||
261 | cpc_tty->tty_minor = port + CPC_TTY_MINOR_START; | 261 | cpc_tty->tty_minor = port + CPC_TTY_MINOR_START; |
262 | cpc_tty->pc300dev = pc300dev; | 262 | cpc_tty->pc300dev = pc300dev; |
263 | 263 | ||
264 | INIT_WORK(&cpc_tty->tty_tx_work, cpc_tty_tx_work, (void *)cpc_tty); | 264 | INIT_WORK(&cpc_tty->tty_tx_work, cpc_tty_tx_work); |
265 | INIT_WORK(&cpc_tty->tty_rx_work, cpc_tty_rx_work, (void *)port); | 265 | INIT_WORK(&cpc_tty->tty_rx_work, cpc_tty_rx_work); |
266 | 266 | ||
267 | cpc_tty->buf_rx.first = cpc_tty->buf_rx.last = NULL; | 267 | cpc_tty->buf_rx.first = cpc_tty->buf_rx.last = NULL; |
268 | 268 | ||
@@ -659,21 +659,23 @@ static void cpc_tty_hangup(struct tty_struct *tty) | |||
659 | * o call the line disc. read | 659 | * o call the line disc. read |
660 | * o free memory | 660 | * o free memory |
661 | */ | 661 | */ |
662 | static void cpc_tty_rx_work(void * data) | 662 | static void cpc_tty_rx_work(struct work_struct *work) |
663 | { | 663 | { |
664 | st_cpc_tty_area *cpc_tty; | ||
664 | unsigned long port; | 665 | unsigned long port; |
665 | int i, j; | 666 | int i, j; |
666 | st_cpc_tty_area *cpc_tty; | ||
667 | volatile st_cpc_rx_buf *buf; | 667 | volatile st_cpc_rx_buf *buf; |
668 | char flags=0,flg_rx=1; | 668 | char flags=0,flg_rx=1; |
669 | struct tty_ldisc *ld; | 669 | struct tty_ldisc *ld; |
670 | 670 | ||
671 | if (cpc_tty_cnt == 0) return; | 671 | if (cpc_tty_cnt == 0) return; |
672 | |||
673 | 672 | ||
674 | for (i=0; (i < 4) && flg_rx ; i++) { | 673 | for (i=0; (i < 4) && flg_rx ; i++) { |
675 | flg_rx = 0; | 674 | flg_rx = 0; |
676 | port = (unsigned long)data; | 675 | |
676 | cpc_tty = container_of(work, st_cpc_tty_area, tty_rx_work); | ||
677 | port = cpc_tty - cpc_tty_area; | ||
678 | |||
677 | for (j=0; j < CPC_TTY_NPORTS; j++) { | 679 | for (j=0; j < CPC_TTY_NPORTS; j++) { |
678 | cpc_tty = &cpc_tty_area[port]; | 680 | cpc_tty = &cpc_tty_area[port]; |
679 | 681 | ||
@@ -882,9 +884,10 @@ void cpc_tty_receive(pc300dev_t *pc300dev) | |||
882 | * o if need call line discipline wakeup | 884 | * o if need call line discipline wakeup |
883 | * o call wake_up_interruptible | 885 | * o call wake_up_interruptible |
884 | */ | 886 | */ |
885 | static void cpc_tty_tx_work(void *data) | 887 | static void cpc_tty_tx_work(struct work_struct *work) |
886 | { | 888 | { |
887 | st_cpc_tty_area *cpc_tty = (st_cpc_tty_area *) data; | 889 | st_cpc_tty_area *cpc_tty = |
890 | container_of(work, st_cpc_tty_area, tty_tx_work); | ||
888 | struct tty_struct *tty; | 891 | struct tty_struct *tty; |
889 | 892 | ||
890 | CPC_TTY_DBG("%s: cpc_tty_tx_work init\n",cpc_tty->name); | 893 | CPC_TTY_DBG("%s: cpc_tty_tx_work init\n",cpc_tty->name); |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx.h b/drivers/net/wireless/bcm43xx/bcm43xx.h index 94dfb92fab5c..8286678513b9 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx.h +++ b/drivers/net/wireless/bcm43xx/bcm43xx.h | |||
@@ -819,7 +819,7 @@ struct bcm43xx_private { | |||
819 | struct tasklet_struct isr_tasklet; | 819 | struct tasklet_struct isr_tasklet; |
820 | 820 | ||
821 | /* Periodic tasks */ | 821 | /* Periodic tasks */ |
822 | struct work_struct periodic_work; | 822 | struct delayed_work periodic_work; |
823 | unsigned int periodic_state; | 823 | unsigned int periodic_state; |
824 | 824 | ||
825 | struct work_struct restart_work; | 825 | struct work_struct restart_work; |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c index 5b3c27359a18..2ec2e5afce67 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c | |||
@@ -3215,9 +3215,10 @@ static void do_periodic_work(struct bcm43xx_private *bcm) | |||
3215 | schedule_delayed_work(&bcm->periodic_work, HZ * 15); | 3215 | schedule_delayed_work(&bcm->periodic_work, HZ * 15); |
3216 | } | 3216 | } |
3217 | 3217 | ||
3218 | static void bcm43xx_periodic_work_handler(void *d) | 3218 | static void bcm43xx_periodic_work_handler(struct work_struct *work) |
3219 | { | 3219 | { |
3220 | struct bcm43xx_private *bcm = d; | 3220 | struct bcm43xx_private *bcm = |
3221 | container_of(work, struct bcm43xx_private, periodic_work.work); | ||
3221 | struct net_device *net_dev = bcm->net_dev; | 3222 | struct net_device *net_dev = bcm->net_dev; |
3222 | unsigned long flags; | 3223 | unsigned long flags; |
3223 | u32 savedirqs = 0; | 3224 | u32 savedirqs = 0; |
@@ -3279,11 +3280,11 @@ void bcm43xx_periodic_tasks_delete(struct bcm43xx_private *bcm) | |||
3279 | 3280 | ||
3280 | void bcm43xx_periodic_tasks_setup(struct bcm43xx_private *bcm) | 3281 | void bcm43xx_periodic_tasks_setup(struct bcm43xx_private *bcm) |
3281 | { | 3282 | { |
3282 | struct work_struct *work = &(bcm->periodic_work); | 3283 | struct delayed_work *work = &bcm->periodic_work; |
3283 | 3284 | ||
3284 | assert(bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED); | 3285 | assert(bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED); |
3285 | INIT_WORK(work, bcm43xx_periodic_work_handler, bcm); | 3286 | INIT_DELAYED_WORK(work, bcm43xx_periodic_work_handler); |
3286 | schedule_work(work); | 3287 | schedule_delayed_work(work, 0); |
3287 | } | 3288 | } |
3288 | 3289 | ||
3289 | static void bcm43xx_security_init(struct bcm43xx_private *bcm) | 3290 | static void bcm43xx_security_init(struct bcm43xx_private *bcm) |
@@ -3635,7 +3636,7 @@ static int bcm43xx_init_board(struct bcm43xx_private *bcm) | |||
3635 | bcm43xx_periodic_tasks_setup(bcm); | 3636 | bcm43xx_periodic_tasks_setup(bcm); |
3636 | 3637 | ||
3637 | /*FIXME: This should be handled by softmac instead. */ | 3638 | /*FIXME: This should be handled by softmac instead. */ |
3638 | schedule_work(&bcm->softmac->associnfo.work); | 3639 | schedule_delayed_work(&bcm->softmac->associnfo.work, 0); |
3639 | 3640 | ||
3640 | out: | 3641 | out: |
3641 | mutex_unlock(&(bcm)->mutex); | 3642 | mutex_unlock(&(bcm)->mutex); |
@@ -4182,9 +4183,10 @@ static void __devexit bcm43xx_remove_one(struct pci_dev *pdev) | |||
4182 | /* Hard-reset the chip. Do not call this directly. | 4183 | /* Hard-reset the chip. Do not call this directly. |
4183 | * Use bcm43xx_controller_restart() | 4184 | * Use bcm43xx_controller_restart() |
4184 | */ | 4185 | */ |
4185 | static void bcm43xx_chip_reset(void *_bcm) | 4186 | static void bcm43xx_chip_reset(struct work_struct *work) |
4186 | { | 4187 | { |
4187 | struct bcm43xx_private *bcm = _bcm; | 4188 | struct bcm43xx_private *bcm = |
4189 | container_of(work, struct bcm43xx_private, restart_work); | ||
4188 | struct bcm43xx_phyinfo *phy; | 4190 | struct bcm43xx_phyinfo *phy; |
4189 | int err = -ENODEV; | 4191 | int err = -ENODEV; |
4190 | 4192 | ||
@@ -4211,7 +4213,7 @@ void bcm43xx_controller_restart(struct bcm43xx_private *bcm, const char *reason) | |||
4211 | if (bcm43xx_status(bcm) != BCM43xx_STAT_INITIALIZED) | 4213 | if (bcm43xx_status(bcm) != BCM43xx_STAT_INITIALIZED) |
4212 | return; | 4214 | return; |
4213 | printk(KERN_ERR PFX "Controller RESET (%s) ...\n", reason); | 4215 | printk(KERN_ERR PFX "Controller RESET (%s) ...\n", reason); |
4214 | INIT_WORK(&bcm->restart_work, bcm43xx_chip_reset, bcm); | 4216 | INIT_WORK(&bcm->restart_work, bcm43xx_chip_reset); |
4215 | schedule_work(&bcm->restart_work); | 4217 | schedule_work(&bcm->restart_work); |
4216 | } | 4218 | } |
4217 | 4219 | ||
diff --git a/drivers/net/wireless/hostap/hostap.h b/drivers/net/wireless/hostap/hostap.h index e663518bd570..e89c890d16fd 100644 --- a/drivers/net/wireless/hostap/hostap.h +++ b/drivers/net/wireless/hostap/hostap.h | |||
@@ -35,7 +35,7 @@ int hostap_80211_get_hdrlen(u16 fc); | |||
35 | struct net_device_stats *hostap_get_stats(struct net_device *dev); | 35 | struct net_device_stats *hostap_get_stats(struct net_device *dev); |
36 | void hostap_setup_dev(struct net_device *dev, local_info_t *local, | 36 | void hostap_setup_dev(struct net_device *dev, local_info_t *local, |
37 | int main_dev); | 37 | int main_dev); |
38 | void hostap_set_multicast_list_queue(void *data); | 38 | void hostap_set_multicast_list_queue(struct work_struct *work); |
39 | int hostap_set_hostapd(local_info_t *local, int val, int rtnl_locked); | 39 | int hostap_set_hostapd(local_info_t *local, int val, int rtnl_locked); |
40 | int hostap_set_hostapd_sta(local_info_t *local, int val, int rtnl_locked); | 40 | int hostap_set_hostapd_sta(local_info_t *local, int val, int rtnl_locked); |
41 | void hostap_cleanup(local_info_t *local); | 41 | void hostap_cleanup(local_info_t *local); |
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c index ba13125024cb..08bc57a4b895 100644 --- a/drivers/net/wireless/hostap/hostap_ap.c +++ b/drivers/net/wireless/hostap/hostap_ap.c | |||
@@ -49,10 +49,10 @@ MODULE_PARM_DESC(autom_ap_wds, "Add WDS connections to other APs " | |||
49 | static struct sta_info* ap_get_sta(struct ap_data *ap, u8 *sta); | 49 | static struct sta_info* ap_get_sta(struct ap_data *ap, u8 *sta); |
50 | static void hostap_event_expired_sta(struct net_device *dev, | 50 | static void hostap_event_expired_sta(struct net_device *dev, |
51 | struct sta_info *sta); | 51 | struct sta_info *sta); |
52 | static void handle_add_proc_queue(void *data); | 52 | static void handle_add_proc_queue(struct work_struct *work); |
53 | 53 | ||
54 | #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT | 54 | #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT |
55 | static void handle_wds_oper_queue(void *data); | 55 | static void handle_wds_oper_queue(struct work_struct *work); |
56 | static void prism2_send_mgmt(struct net_device *dev, | 56 | static void prism2_send_mgmt(struct net_device *dev, |
57 | u16 type_subtype, char *body, | 57 | u16 type_subtype, char *body, |
58 | int body_len, u8 *addr, u16 tx_cb_idx); | 58 | int body_len, u8 *addr, u16 tx_cb_idx); |
@@ -807,7 +807,7 @@ void hostap_init_data(local_info_t *local) | |||
807 | INIT_LIST_HEAD(&ap->sta_list); | 807 | INIT_LIST_HEAD(&ap->sta_list); |
808 | 808 | ||
809 | /* Initialize task queue structure for AP management */ | 809 | /* Initialize task queue structure for AP management */ |
810 | INIT_WORK(&local->ap->add_sta_proc_queue, handle_add_proc_queue, ap); | 810 | INIT_WORK(&local->ap->add_sta_proc_queue, handle_add_proc_queue); |
811 | 811 | ||
812 | ap->tx_callback_idx = | 812 | ap->tx_callback_idx = |
813 | hostap_tx_callback_register(local, hostap_ap_tx_cb, ap); | 813 | hostap_tx_callback_register(local, hostap_ap_tx_cb, ap); |
@@ -815,7 +815,7 @@ void hostap_init_data(local_info_t *local) | |||
815 | printk(KERN_WARNING "%s: failed to register TX callback for " | 815 | printk(KERN_WARNING "%s: failed to register TX callback for " |
816 | "AP\n", local->dev->name); | 816 | "AP\n", local->dev->name); |
817 | #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT | 817 | #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT |
818 | INIT_WORK(&local->ap->wds_oper_queue, handle_wds_oper_queue, local); | 818 | INIT_WORK(&local->ap->wds_oper_queue, handle_wds_oper_queue); |
819 | 819 | ||
820 | ap->tx_callback_auth = | 820 | ap->tx_callback_auth = |
821 | hostap_tx_callback_register(local, hostap_ap_tx_cb_auth, ap); | 821 | hostap_tx_callback_register(local, hostap_ap_tx_cb_auth, ap); |
@@ -1062,9 +1062,10 @@ static int prism2_sta_proc_read(char *page, char **start, off_t off, | |||
1062 | } | 1062 | } |
1063 | 1063 | ||
1064 | 1064 | ||
1065 | static void handle_add_proc_queue(void *data) | 1065 | static void handle_add_proc_queue(struct work_struct *work) |
1066 | { | 1066 | { |
1067 | struct ap_data *ap = (struct ap_data *) data; | 1067 | struct ap_data *ap = container_of(work, struct ap_data, |
1068 | add_sta_proc_queue); | ||
1068 | struct sta_info *sta; | 1069 | struct sta_info *sta; |
1069 | char name[20]; | 1070 | char name[20]; |
1070 | struct add_sta_proc_data *entry, *prev; | 1071 | struct add_sta_proc_data *entry, *prev; |
@@ -1952,9 +1953,11 @@ static void handle_pspoll(local_info_t *local, | |||
1952 | 1953 | ||
1953 | #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT | 1954 | #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT |
1954 | 1955 | ||
1955 | static void handle_wds_oper_queue(void *data) | 1956 | static void handle_wds_oper_queue(struct work_struct *work) |
1956 | { | 1957 | { |
1957 | local_info_t *local = data; | 1958 | struct ap_data *ap = container_of(work, struct ap_data, |
1959 | wds_oper_queue); | ||
1960 | local_info_t *local = ap->local; | ||
1958 | struct wds_oper_data *entry, *prev; | 1961 | struct wds_oper_data *entry, *prev; |
1959 | 1962 | ||
1960 | spin_lock_bh(&local->lock); | 1963 | spin_lock_bh(&local->lock); |
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c index ed00ebb6e7f4..c19e68636a1c 100644 --- a/drivers/net/wireless/hostap/hostap_hw.c +++ b/drivers/net/wireless/hostap/hostap_hw.c | |||
@@ -1645,9 +1645,9 @@ static void prism2_schedule_reset(local_info_t *local) | |||
1645 | 1645 | ||
1646 | /* Called only as scheduled task after noticing card timeout in interrupt | 1646 | /* Called only as scheduled task after noticing card timeout in interrupt |
1647 | * context */ | 1647 | * context */ |
1648 | static void handle_reset_queue(void *data) | 1648 | static void handle_reset_queue(struct work_struct *work) |
1649 | { | 1649 | { |
1650 | local_info_t *local = (local_info_t *) data; | 1650 | local_info_t *local = container_of(work, local_info_t, reset_queue); |
1651 | 1651 | ||
1652 | printk(KERN_DEBUG "%s: scheduled card reset\n", local->dev->name); | 1652 | printk(KERN_DEBUG "%s: scheduled card reset\n", local->dev->name); |
1653 | prism2_hw_reset(local->dev); | 1653 | prism2_hw_reset(local->dev); |
@@ -2896,9 +2896,10 @@ static void hostap_passive_scan(unsigned long data) | |||
2896 | 2896 | ||
2897 | /* Called only as a scheduled task when communications quality values should | 2897 | /* Called only as a scheduled task when communications quality values should |
2898 | * be updated. */ | 2898 | * be updated. */ |
2899 | static void handle_comms_qual_update(void *data) | 2899 | static void handle_comms_qual_update(struct work_struct *work) |
2900 | { | 2900 | { |
2901 | local_info_t *local = data; | 2901 | local_info_t *local = |
2902 | container_of(work, local_info_t, comms_qual_update); | ||
2902 | prism2_update_comms_qual(local->dev); | 2903 | prism2_update_comms_qual(local->dev); |
2903 | } | 2904 | } |
2904 | 2905 | ||
@@ -3050,9 +3051,9 @@ static int prism2_set_tim(struct net_device *dev, int aid, int set) | |||
3050 | } | 3051 | } |
3051 | 3052 | ||
3052 | 3053 | ||
3053 | static void handle_set_tim_queue(void *data) | 3054 | static void handle_set_tim_queue(struct work_struct *work) |
3054 | { | 3055 | { |
3055 | local_info_t *local = (local_info_t *) data; | 3056 | local_info_t *local = container_of(work, local_info_t, set_tim_queue); |
3056 | struct set_tim_data *entry; | 3057 | struct set_tim_data *entry; |
3057 | u16 val; | 3058 | u16 val; |
3058 | 3059 | ||
@@ -3209,15 +3210,15 @@ prism2_init_local_data(struct prism2_helper_functions *funcs, int card_idx, | |||
3209 | local->scan_channel_mask = 0xffff; | 3210 | local->scan_channel_mask = 0xffff; |
3210 | 3211 | ||
3211 | /* Initialize task queue structures */ | 3212 | /* Initialize task queue structures */ |
3212 | INIT_WORK(&local->reset_queue, handle_reset_queue, local); | 3213 | INIT_WORK(&local->reset_queue, handle_reset_queue); |
3213 | INIT_WORK(&local->set_multicast_list_queue, | 3214 | INIT_WORK(&local->set_multicast_list_queue, |
3214 | hostap_set_multicast_list_queue, local->dev); | 3215 | hostap_set_multicast_list_queue); |
3215 | 3216 | ||
3216 | INIT_WORK(&local->set_tim_queue, handle_set_tim_queue, local); | 3217 | INIT_WORK(&local->set_tim_queue, handle_set_tim_queue); |
3217 | INIT_LIST_HEAD(&local->set_tim_list); | 3218 | INIT_LIST_HEAD(&local->set_tim_list); |
3218 | spin_lock_init(&local->set_tim_lock); | 3219 | spin_lock_init(&local->set_tim_lock); |
3219 | 3220 | ||
3220 | INIT_WORK(&local->comms_qual_update, handle_comms_qual_update, local); | 3221 | INIT_WORK(&local->comms_qual_update, handle_comms_qual_update); |
3221 | 3222 | ||
3222 | /* Initialize tasklets for handling hardware IRQ related operations | 3223 | /* Initialize tasklets for handling hardware IRQ related operations |
3223 | * outside hw IRQ handler */ | 3224 | * outside hw IRQ handler */ |
diff --git a/drivers/net/wireless/hostap/hostap_info.c b/drivers/net/wireless/hostap/hostap_info.c index 50f72d831cf4..5fd2b1ad7f5e 100644 --- a/drivers/net/wireless/hostap/hostap_info.c +++ b/drivers/net/wireless/hostap/hostap_info.c | |||
@@ -474,9 +474,9 @@ static void handle_info_queue_scanresults(local_info_t *local) | |||
474 | 474 | ||
475 | /* Called only as scheduled task after receiving info frames (used to avoid | 475 | /* Called only as scheduled task after receiving info frames (used to avoid |
476 | * pending too much time in HW IRQ handler). */ | 476 | * pending too much time in HW IRQ handler). */ |
477 | static void handle_info_queue(void *data) | 477 | static void handle_info_queue(struct work_struct *work) |
478 | { | 478 | { |
479 | local_info_t *local = (local_info_t *) data; | 479 | local_info_t *local = container_of(work, local_info_t, info_queue); |
480 | 480 | ||
481 | if (test_and_clear_bit(PRISM2_INFO_PENDING_LINKSTATUS, | 481 | if (test_and_clear_bit(PRISM2_INFO_PENDING_LINKSTATUS, |
482 | &local->pending_info)) | 482 | &local->pending_info)) |
@@ -493,7 +493,7 @@ void hostap_info_init(local_info_t *local) | |||
493 | { | 493 | { |
494 | skb_queue_head_init(&local->info_list); | 494 | skb_queue_head_init(&local->info_list); |
495 | #ifndef PRISM2_NO_STATION_MODES | 495 | #ifndef PRISM2_NO_STATION_MODES |
496 | INIT_WORK(&local->info_queue, handle_info_queue, local); | 496 | INIT_WORK(&local->info_queue, handle_info_queue); |
497 | #endif /* PRISM2_NO_STATION_MODES */ | 497 | #endif /* PRISM2_NO_STATION_MODES */ |
498 | } | 498 | } |
499 | 499 | ||
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c index 53374fcba77e..0796be9d9e77 100644 --- a/drivers/net/wireless/hostap/hostap_main.c +++ b/drivers/net/wireless/hostap/hostap_main.c | |||
@@ -767,14 +767,14 @@ static int prism2_set_mac_address(struct net_device *dev, void *p) | |||
767 | 767 | ||
768 | /* TODO: to be further implemented as soon as Prism2 fully supports | 768 | /* TODO: to be further implemented as soon as Prism2 fully supports |
769 | * GroupAddresses and correct documentation is available */ | 769 | * GroupAddresses and correct documentation is available */ |
770 | void hostap_set_multicast_list_queue(void *data) | 770 | void hostap_set_multicast_list_queue(struct work_struct *work) |
771 | { | 771 | { |
772 | struct net_device *dev = (struct net_device *) data; | 772 | local_info_t *local = |
773 | container_of(work, local_info_t, set_multicast_list_queue); | ||
774 | struct net_device *dev = local->dev; | ||
773 | struct hostap_interface *iface; | 775 | struct hostap_interface *iface; |
774 | local_info_t *local; | ||
775 | 776 | ||
776 | iface = netdev_priv(dev); | 777 | iface = netdev_priv(dev); |
777 | local = iface->local; | ||
778 | if (hostap_set_word(dev, HFA384X_RID_PROMISCUOUSMODE, | 778 | if (hostap_set_word(dev, HFA384X_RID_PROMISCUOUSMODE, |
779 | local->is_promisc)) { | 779 | local->is_promisc)) { |
780 | printk(KERN_INFO "%s: %sabling promiscuous mode failed\n", | 780 | printk(KERN_INFO "%s: %sabling promiscuous mode failed\n", |
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index 79607b8b877c..1bcd352a813b 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c | |||
@@ -316,7 +316,7 @@ static void ipw2100_release_firmware(struct ipw2100_priv *priv, | |||
316 | struct ipw2100_fw *fw); | 316 | struct ipw2100_fw *fw); |
317 | static int ipw2100_ucode_download(struct ipw2100_priv *priv, | 317 | static int ipw2100_ucode_download(struct ipw2100_priv *priv, |
318 | struct ipw2100_fw *fw); | 318 | struct ipw2100_fw *fw); |
319 | static void ipw2100_wx_event_work(struct ipw2100_priv *priv); | 319 | static void ipw2100_wx_event_work(struct work_struct *work); |
320 | static struct iw_statistics *ipw2100_wx_wireless_stats(struct net_device *dev); | 320 | static struct iw_statistics *ipw2100_wx_wireless_stats(struct net_device *dev); |
321 | static struct iw_handler_def ipw2100_wx_handler_def; | 321 | static struct iw_handler_def ipw2100_wx_handler_def; |
322 | 322 | ||
@@ -679,7 +679,8 @@ static void schedule_reset(struct ipw2100_priv *priv) | |||
679 | queue_delayed_work(priv->workqueue, &priv->reset_work, | 679 | queue_delayed_work(priv->workqueue, &priv->reset_work, |
680 | priv->reset_backoff * HZ); | 680 | priv->reset_backoff * HZ); |
681 | else | 681 | else |
682 | queue_work(priv->workqueue, &priv->reset_work); | 682 | queue_delayed_work(priv->workqueue, &priv->reset_work, |
683 | 0); | ||
683 | 684 | ||
684 | if (priv->reset_backoff < MAX_RESET_BACKOFF) | 685 | if (priv->reset_backoff < MAX_RESET_BACKOFF) |
685 | priv->reset_backoff++; | 686 | priv->reset_backoff++; |
@@ -1873,8 +1874,10 @@ static void ipw2100_down(struct ipw2100_priv *priv) | |||
1873 | netif_stop_queue(priv->net_dev); | 1874 | netif_stop_queue(priv->net_dev); |
1874 | } | 1875 | } |
1875 | 1876 | ||
1876 | static void ipw2100_reset_adapter(struct ipw2100_priv *priv) | 1877 | static void ipw2100_reset_adapter(struct work_struct *work) |
1877 | { | 1878 | { |
1879 | struct ipw2100_priv *priv = | ||
1880 | container_of(work, struct ipw2100_priv, reset_work.work); | ||
1878 | unsigned long flags; | 1881 | unsigned long flags; |
1879 | union iwreq_data wrqu = { | 1882 | union iwreq_data wrqu = { |
1880 | .ap_addr = { | 1883 | .ap_addr = { |
@@ -2071,9 +2074,9 @@ static void isr_indicate_association_lost(struct ipw2100_priv *priv, u32 status) | |||
2071 | return; | 2074 | return; |
2072 | 2075 | ||
2073 | if (priv->status & STATUS_SECURITY_UPDATED) | 2076 | if (priv->status & STATUS_SECURITY_UPDATED) |
2074 | queue_work(priv->workqueue, &priv->security_work); | 2077 | queue_delayed_work(priv->workqueue, &priv->security_work, 0); |
2075 | 2078 | ||
2076 | queue_work(priv->workqueue, &priv->wx_event_work); | 2079 | queue_delayed_work(priv->workqueue, &priv->wx_event_work, 0); |
2077 | } | 2080 | } |
2078 | 2081 | ||
2079 | static void isr_indicate_rf_kill(struct ipw2100_priv *priv, u32 status) | 2082 | static void isr_indicate_rf_kill(struct ipw2100_priv *priv, u32 status) |
@@ -5524,8 +5527,11 @@ static int ipw2100_configure_security(struct ipw2100_priv *priv, int batch_mode) | |||
5524 | return err; | 5527 | return err; |
5525 | } | 5528 | } |
5526 | 5529 | ||
5527 | static void ipw2100_security_work(struct ipw2100_priv *priv) | 5530 | static void ipw2100_security_work(struct work_struct *work) |
5528 | { | 5531 | { |
5532 | struct ipw2100_priv *priv = | ||
5533 | container_of(work, struct ipw2100_priv, security_work.work); | ||
5534 | |||
5529 | /* If we happen to have reconnected before we get a chance to | 5535 | /* If we happen to have reconnected before we get a chance to |
5530 | * process this, then update the security settings--which causes | 5536 | * process this, then update the security settings--which causes |
5531 | * a disassociation to occur */ | 5537 | * a disassociation to occur */ |
@@ -5748,7 +5754,7 @@ static int ipw2100_set_address(struct net_device *dev, void *p) | |||
5748 | 5754 | ||
5749 | priv->reset_backoff = 0; | 5755 | priv->reset_backoff = 0; |
5750 | mutex_unlock(&priv->action_mutex); | 5756 | mutex_unlock(&priv->action_mutex); |
5751 | ipw2100_reset_adapter(priv); | 5757 | ipw2100_reset_adapter(&priv->reset_work.work); |
5752 | return 0; | 5758 | return 0; |
5753 | 5759 | ||
5754 | done: | 5760 | done: |
@@ -5910,9 +5916,10 @@ static const struct ethtool_ops ipw2100_ethtool_ops = { | |||
5910 | .get_drvinfo = ipw_ethtool_get_drvinfo, | 5916 | .get_drvinfo = ipw_ethtool_get_drvinfo, |
5911 | }; | 5917 | }; |
5912 | 5918 | ||
5913 | static void ipw2100_hang_check(void *adapter) | 5919 | static void ipw2100_hang_check(struct work_struct *work) |
5914 | { | 5920 | { |
5915 | struct ipw2100_priv *priv = adapter; | 5921 | struct ipw2100_priv *priv = |
5922 | container_of(work, struct ipw2100_priv, hang_check.work); | ||
5916 | unsigned long flags; | 5923 | unsigned long flags; |
5917 | u32 rtc = 0xa5a5a5a5; | 5924 | u32 rtc = 0xa5a5a5a5; |
5918 | u32 len = sizeof(rtc); | 5925 | u32 len = sizeof(rtc); |
@@ -5952,9 +5959,10 @@ static void ipw2100_hang_check(void *adapter) | |||
5952 | spin_unlock_irqrestore(&priv->low_lock, flags); | 5959 | spin_unlock_irqrestore(&priv->low_lock, flags); |
5953 | } | 5960 | } |
5954 | 5961 | ||
5955 | static void ipw2100_rf_kill(void *adapter) | 5962 | static void ipw2100_rf_kill(struct work_struct *work) |
5956 | { | 5963 | { |
5957 | struct ipw2100_priv *priv = adapter; | 5964 | struct ipw2100_priv *priv = |
5965 | container_of(work, struct ipw2100_priv, rf_kill.work); | ||
5958 | unsigned long flags; | 5966 | unsigned long flags; |
5959 | 5967 | ||
5960 | spin_lock_irqsave(&priv->low_lock, flags); | 5968 | spin_lock_irqsave(&priv->low_lock, flags); |
@@ -6103,14 +6111,11 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev, | |||
6103 | 6111 | ||
6104 | priv->workqueue = create_workqueue(DRV_NAME); | 6112 | priv->workqueue = create_workqueue(DRV_NAME); |
6105 | 6113 | ||
6106 | INIT_WORK(&priv->reset_work, | 6114 | INIT_DELAYED_WORK(&priv->reset_work, ipw2100_reset_adapter); |
6107 | (void (*)(void *))ipw2100_reset_adapter, priv); | 6115 | INIT_DELAYED_WORK(&priv->security_work, ipw2100_security_work); |
6108 | INIT_WORK(&priv->security_work, | 6116 | INIT_DELAYED_WORK(&priv->wx_event_work, ipw2100_wx_event_work); |
6109 | (void (*)(void *))ipw2100_security_work, priv); | 6117 | INIT_DELAYED_WORK(&priv->hang_check, ipw2100_hang_check); |
6110 | INIT_WORK(&priv->wx_event_work, | 6118 | INIT_DELAYED_WORK(&priv->rf_kill, ipw2100_rf_kill); |
6111 | (void (*)(void *))ipw2100_wx_event_work, priv); | ||
6112 | INIT_WORK(&priv->hang_check, ipw2100_hang_check, priv); | ||
6113 | INIT_WORK(&priv->rf_kill, ipw2100_rf_kill, priv); | ||
6114 | 6119 | ||
6115 | tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long)) | 6120 | tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long)) |
6116 | ipw2100_irq_tasklet, (unsigned long)priv); | 6121 | ipw2100_irq_tasklet, (unsigned long)priv); |
@@ -8281,8 +8286,10 @@ static struct iw_handler_def ipw2100_wx_handler_def = { | |||
8281 | .get_wireless_stats = ipw2100_wx_wireless_stats, | 8286 | .get_wireless_stats = ipw2100_wx_wireless_stats, |
8282 | }; | 8287 | }; |
8283 | 8288 | ||
8284 | static void ipw2100_wx_event_work(struct ipw2100_priv *priv) | 8289 | static void ipw2100_wx_event_work(struct work_struct *work) |
8285 | { | 8290 | { |
8291 | struct ipw2100_priv *priv = | ||
8292 | container_of(work, struct ipw2100_priv, wx_event_work.work); | ||
8286 | union iwreq_data wrqu; | 8293 | union iwreq_data wrqu; |
8287 | int len = ETH_ALEN; | 8294 | int len = ETH_ALEN; |
8288 | 8295 | ||
diff --git a/drivers/net/wireless/ipw2100.h b/drivers/net/wireless/ipw2100.h index 55b7227198df..de7d384d38af 100644 --- a/drivers/net/wireless/ipw2100.h +++ b/drivers/net/wireless/ipw2100.h | |||
@@ -583,11 +583,11 @@ struct ipw2100_priv { | |||
583 | struct tasklet_struct irq_tasklet; | 583 | struct tasklet_struct irq_tasklet; |
584 | 584 | ||
585 | struct workqueue_struct *workqueue; | 585 | struct workqueue_struct *workqueue; |
586 | struct work_struct reset_work; | 586 | struct delayed_work reset_work; |
587 | struct work_struct security_work; | 587 | struct delayed_work security_work; |
588 | struct work_struct wx_event_work; | 588 | struct delayed_work wx_event_work; |
589 | struct work_struct hang_check; | 589 | struct delayed_work hang_check; |
590 | struct work_struct rf_kill; | 590 | struct delayed_work rf_kill; |
591 | 591 | ||
592 | u32 interrupts; | 592 | u32 interrupts; |
593 | int tx_interrupts; | 593 | int tx_interrupts; |
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index c692d01a76ca..e82e56bb85e1 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c | |||
@@ -187,9 +187,9 @@ static struct ipw_rx_queue *ipw_rx_queue_alloc(struct ipw_priv *); | |||
187 | static void ipw_rx_queue_free(struct ipw_priv *, struct ipw_rx_queue *); | 187 | static void ipw_rx_queue_free(struct ipw_priv *, struct ipw_rx_queue *); |
188 | static void ipw_rx_queue_replenish(void *); | 188 | static void ipw_rx_queue_replenish(void *); |
189 | static int ipw_up(struct ipw_priv *); | 189 | static int ipw_up(struct ipw_priv *); |
190 | static void ipw_bg_up(void *); | 190 | static void ipw_bg_up(struct work_struct *work); |
191 | static void ipw_down(struct ipw_priv *); | 191 | static void ipw_down(struct ipw_priv *); |
192 | static void ipw_bg_down(void *); | 192 | static void ipw_bg_down(struct work_struct *work); |
193 | static int ipw_config(struct ipw_priv *); | 193 | static int ipw_config(struct ipw_priv *); |
194 | static int init_supported_rates(struct ipw_priv *priv, | 194 | static int init_supported_rates(struct ipw_priv *priv, |
195 | struct ipw_supported_rates *prates); | 195 | struct ipw_supported_rates *prates); |
@@ -862,11 +862,12 @@ static void ipw_led_link_on(struct ipw_priv *priv) | |||
862 | spin_unlock_irqrestore(&priv->lock, flags); | 862 | spin_unlock_irqrestore(&priv->lock, flags); |
863 | } | 863 | } |
864 | 864 | ||
865 | static void ipw_bg_led_link_on(void *data) | 865 | static void ipw_bg_led_link_on(struct work_struct *work) |
866 | { | 866 | { |
867 | struct ipw_priv *priv = data; | 867 | struct ipw_priv *priv = |
868 | container_of(work, struct ipw_priv, led_link_on.work); | ||
868 | mutex_lock(&priv->mutex); | 869 | mutex_lock(&priv->mutex); |
869 | ipw_led_link_on(data); | 870 | ipw_led_link_on(priv); |
870 | mutex_unlock(&priv->mutex); | 871 | mutex_unlock(&priv->mutex); |
871 | } | 872 | } |
872 | 873 | ||
@@ -906,11 +907,12 @@ static void ipw_led_link_off(struct ipw_priv *priv) | |||
906 | spin_unlock_irqrestore(&priv->lock, flags); | 907 | spin_unlock_irqrestore(&priv->lock, flags); |
907 | } | 908 | } |
908 | 909 | ||
909 | static void ipw_bg_led_link_off(void *data) | 910 | static void ipw_bg_led_link_off(struct work_struct *work) |
910 | { | 911 | { |
911 | struct ipw_priv *priv = data; | 912 | struct ipw_priv *priv = |
913 | container_of(work, struct ipw_priv, led_link_off.work); | ||
912 | mutex_lock(&priv->mutex); | 914 | mutex_lock(&priv->mutex); |
913 | ipw_led_link_off(data); | 915 | ipw_led_link_off(priv); |
914 | mutex_unlock(&priv->mutex); | 916 | mutex_unlock(&priv->mutex); |
915 | } | 917 | } |
916 | 918 | ||
@@ -985,11 +987,12 @@ static void ipw_led_activity_off(struct ipw_priv *priv) | |||
985 | spin_unlock_irqrestore(&priv->lock, flags); | 987 | spin_unlock_irqrestore(&priv->lock, flags); |
986 | } | 988 | } |
987 | 989 | ||
988 | static void ipw_bg_led_activity_off(void *data) | 990 | static void ipw_bg_led_activity_off(struct work_struct *work) |
989 | { | 991 | { |
990 | struct ipw_priv *priv = data; | 992 | struct ipw_priv *priv = |
993 | container_of(work, struct ipw_priv, led_act_off.work); | ||
991 | mutex_lock(&priv->mutex); | 994 | mutex_lock(&priv->mutex); |
992 | ipw_led_activity_off(data); | 995 | ipw_led_activity_off(priv); |
993 | mutex_unlock(&priv->mutex); | 996 | mutex_unlock(&priv->mutex); |
994 | } | 997 | } |
995 | 998 | ||
@@ -2228,11 +2231,12 @@ static void ipw_adapter_restart(void *adapter) | |||
2228 | } | 2231 | } |
2229 | } | 2232 | } |
2230 | 2233 | ||
2231 | static void ipw_bg_adapter_restart(void *data) | 2234 | static void ipw_bg_adapter_restart(struct work_struct *work) |
2232 | { | 2235 | { |
2233 | struct ipw_priv *priv = data; | 2236 | struct ipw_priv *priv = |
2237 | container_of(work, struct ipw_priv, adapter_restart); | ||
2234 | mutex_lock(&priv->mutex); | 2238 | mutex_lock(&priv->mutex); |
2235 | ipw_adapter_restart(data); | 2239 | ipw_adapter_restart(priv); |
2236 | mutex_unlock(&priv->mutex); | 2240 | mutex_unlock(&priv->mutex); |
2237 | } | 2241 | } |
2238 | 2242 | ||
@@ -2249,11 +2253,12 @@ static void ipw_scan_check(void *data) | |||
2249 | } | 2253 | } |
2250 | } | 2254 | } |
2251 | 2255 | ||
2252 | static void ipw_bg_scan_check(void *data) | 2256 | static void ipw_bg_scan_check(struct work_struct *work) |
2253 | { | 2257 | { |
2254 | struct ipw_priv *priv = data; | 2258 | struct ipw_priv *priv = |
2259 | container_of(work, struct ipw_priv, scan_check.work); | ||
2255 | mutex_lock(&priv->mutex); | 2260 | mutex_lock(&priv->mutex); |
2256 | ipw_scan_check(data); | 2261 | ipw_scan_check(priv); |
2257 | mutex_unlock(&priv->mutex); | 2262 | mutex_unlock(&priv->mutex); |
2258 | } | 2263 | } |
2259 | 2264 | ||
@@ -3831,17 +3836,19 @@ static int ipw_disassociate(void *data) | |||
3831 | return 1; | 3836 | return 1; |
3832 | } | 3837 | } |
3833 | 3838 | ||
3834 | static void ipw_bg_disassociate(void *data) | 3839 | static void ipw_bg_disassociate(struct work_struct *work) |
3835 | { | 3840 | { |
3836 | struct ipw_priv *priv = data; | 3841 | struct ipw_priv *priv = |
3842 | container_of(work, struct ipw_priv, disassociate); | ||
3837 | mutex_lock(&priv->mutex); | 3843 | mutex_lock(&priv->mutex); |
3838 | ipw_disassociate(data); | 3844 | ipw_disassociate(priv); |
3839 | mutex_unlock(&priv->mutex); | 3845 | mutex_unlock(&priv->mutex); |
3840 | } | 3846 | } |
3841 | 3847 | ||
3842 | static void ipw_system_config(void *data) | 3848 | static void ipw_system_config(struct work_struct *work) |
3843 | { | 3849 | { |
3844 | struct ipw_priv *priv = data; | 3850 | struct ipw_priv *priv = |
3851 | container_of(work, struct ipw_priv, system_config); | ||
3845 | 3852 | ||
3846 | #ifdef CONFIG_IPW2200_PROMISCUOUS | 3853 | #ifdef CONFIG_IPW2200_PROMISCUOUS |
3847 | if (priv->prom_net_dev && netif_running(priv->prom_net_dev)) { | 3854 | if (priv->prom_net_dev && netif_running(priv->prom_net_dev)) { |
@@ -4208,11 +4215,12 @@ static void ipw_gather_stats(struct ipw_priv *priv) | |||
4208 | IPW_STATS_INTERVAL); | 4215 | IPW_STATS_INTERVAL); |
4209 | } | 4216 | } |
4210 | 4217 | ||
4211 | static void ipw_bg_gather_stats(void *data) | 4218 | static void ipw_bg_gather_stats(struct work_struct *work) |
4212 | { | 4219 | { |
4213 | struct ipw_priv *priv = data; | 4220 | struct ipw_priv *priv = |
4221 | container_of(work, struct ipw_priv, gather_stats.work); | ||
4214 | mutex_lock(&priv->mutex); | 4222 | mutex_lock(&priv->mutex); |
4215 | ipw_gather_stats(data); | 4223 | ipw_gather_stats(priv); |
4216 | mutex_unlock(&priv->mutex); | 4224 | mutex_unlock(&priv->mutex); |
4217 | } | 4225 | } |
4218 | 4226 | ||
@@ -4268,8 +4276,8 @@ static void ipw_handle_missed_beacon(struct ipw_priv *priv, | |||
4268 | if (!(priv->status & STATUS_ROAMING)) { | 4276 | if (!(priv->status & STATUS_ROAMING)) { |
4269 | priv->status |= STATUS_ROAMING; | 4277 | priv->status |= STATUS_ROAMING; |
4270 | if (!(priv->status & STATUS_SCANNING)) | 4278 | if (!(priv->status & STATUS_SCANNING)) |
4271 | queue_work(priv->workqueue, | 4279 | queue_delayed_work(priv->workqueue, |
4272 | &priv->request_scan); | 4280 | &priv->request_scan, 0); |
4273 | } | 4281 | } |
4274 | return; | 4282 | return; |
4275 | } | 4283 | } |
@@ -4607,8 +4615,8 @@ static void ipw_rx_notification(struct ipw_priv *priv, | |||
4607 | #ifdef CONFIG_IPW2200_MONITOR | 4615 | #ifdef CONFIG_IPW2200_MONITOR |
4608 | if (priv->ieee->iw_mode == IW_MODE_MONITOR) { | 4616 | if (priv->ieee->iw_mode == IW_MODE_MONITOR) { |
4609 | priv->status |= STATUS_SCAN_FORCED; | 4617 | priv->status |= STATUS_SCAN_FORCED; |
4610 | queue_work(priv->workqueue, | 4618 | queue_delayed_work(priv->workqueue, |
4611 | &priv->request_scan); | 4619 | &priv->request_scan, 0); |
4612 | break; | 4620 | break; |
4613 | } | 4621 | } |
4614 | priv->status &= ~STATUS_SCAN_FORCED; | 4622 | priv->status &= ~STATUS_SCAN_FORCED; |
@@ -4631,8 +4639,8 @@ static void ipw_rx_notification(struct ipw_priv *priv, | |||
4631 | /* Don't schedule if we aborted the scan */ | 4639 | /* Don't schedule if we aborted the scan */ |
4632 | priv->status &= ~STATUS_ROAMING; | 4640 | priv->status &= ~STATUS_ROAMING; |
4633 | } else if (priv->status & STATUS_SCAN_PENDING) | 4641 | } else if (priv->status & STATUS_SCAN_PENDING) |
4634 | queue_work(priv->workqueue, | 4642 | queue_delayed_work(priv->workqueue, |
4635 | &priv->request_scan); | 4643 | &priv->request_scan, 0); |
4636 | else if (priv->config & CFG_BACKGROUND_SCAN | 4644 | else if (priv->config & CFG_BACKGROUND_SCAN |
4637 | && priv->status & STATUS_ASSOCIATED) | 4645 | && priv->status & STATUS_ASSOCIATED) |
4638 | queue_delayed_work(priv->workqueue, | 4646 | queue_delayed_work(priv->workqueue, |
@@ -5055,11 +5063,12 @@ static void ipw_rx_queue_replenish(void *data) | |||
5055 | ipw_rx_queue_restock(priv); | 5063 | ipw_rx_queue_restock(priv); |
5056 | } | 5064 | } |
5057 | 5065 | ||
5058 | static void ipw_bg_rx_queue_replenish(void *data) | 5066 | static void ipw_bg_rx_queue_replenish(struct work_struct *work) |
5059 | { | 5067 | { |
5060 | struct ipw_priv *priv = data; | 5068 | struct ipw_priv *priv = |
5069 | container_of(work, struct ipw_priv, rx_replenish); | ||
5061 | mutex_lock(&priv->mutex); | 5070 | mutex_lock(&priv->mutex); |
5062 | ipw_rx_queue_replenish(data); | 5071 | ipw_rx_queue_replenish(priv); |
5063 | mutex_unlock(&priv->mutex); | 5072 | mutex_unlock(&priv->mutex); |
5064 | } | 5073 | } |
5065 | 5074 | ||
@@ -5489,9 +5498,10 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv, | |||
5489 | return 1; | 5498 | return 1; |
5490 | } | 5499 | } |
5491 | 5500 | ||
5492 | static void ipw_merge_adhoc_network(void *data) | 5501 | static void ipw_merge_adhoc_network(struct work_struct *work) |
5493 | { | 5502 | { |
5494 | struct ipw_priv *priv = data; | 5503 | struct ipw_priv *priv = |
5504 | container_of(work, struct ipw_priv, merge_networks); | ||
5495 | struct ieee80211_network *network = NULL; | 5505 | struct ieee80211_network *network = NULL; |
5496 | struct ipw_network_match match = { | 5506 | struct ipw_network_match match = { |
5497 | .network = priv->assoc_network | 5507 | .network = priv->assoc_network |
@@ -5948,11 +5958,12 @@ static void ipw_adhoc_check(void *data) | |||
5948 | priv->assoc_request.beacon_interval); | 5958 | priv->assoc_request.beacon_interval); |
5949 | } | 5959 | } |
5950 | 5960 | ||
5951 | static void ipw_bg_adhoc_check(void *data) | 5961 | static void ipw_bg_adhoc_check(struct work_struct *work) |
5952 | { | 5962 | { |
5953 | struct ipw_priv *priv = data; | 5963 | struct ipw_priv *priv = |
5964 | container_of(work, struct ipw_priv, adhoc_check.work); | ||
5954 | mutex_lock(&priv->mutex); | 5965 | mutex_lock(&priv->mutex); |
5955 | ipw_adhoc_check(data); | 5966 | ipw_adhoc_check(priv); |
5956 | mutex_unlock(&priv->mutex); | 5967 | mutex_unlock(&priv->mutex); |
5957 | } | 5968 | } |
5958 | 5969 | ||
@@ -6299,19 +6310,26 @@ done: | |||
6299 | return err; | 6310 | return err; |
6300 | } | 6311 | } |
6301 | 6312 | ||
6302 | static int ipw_request_passive_scan(struct ipw_priv *priv) { | 6313 | static void ipw_request_passive_scan(struct work_struct *work) |
6303 | return ipw_request_scan_helper(priv, IW_SCAN_TYPE_PASSIVE); | 6314 | { |
6315 | struct ipw_priv *priv = | ||
6316 | container_of(work, struct ipw_priv, request_passive_scan); | ||
6317 | ipw_request_scan_helper(priv, IW_SCAN_TYPE_PASSIVE); | ||
6304 | } | 6318 | } |
6305 | 6319 | ||
6306 | static int ipw_request_scan(struct ipw_priv *priv) { | 6320 | static void ipw_request_scan(struct work_struct *work) |
6307 | return ipw_request_scan_helper(priv, IW_SCAN_TYPE_ACTIVE); | 6321 | { |
6322 | struct ipw_priv *priv = | ||
6323 | container_of(work, struct ipw_priv, request_scan.work); | ||
6324 | ipw_request_scan_helper(priv, IW_SCAN_TYPE_ACTIVE); | ||
6308 | } | 6325 | } |
6309 | 6326 | ||
6310 | static void ipw_bg_abort_scan(void *data) | 6327 | static void ipw_bg_abort_scan(struct work_struct *work) |
6311 | { | 6328 | { |
6312 | struct ipw_priv *priv = data; | 6329 | struct ipw_priv *priv = |
6330 | container_of(work, struct ipw_priv, abort_scan); | ||
6313 | mutex_lock(&priv->mutex); | 6331 | mutex_lock(&priv->mutex); |
6314 | ipw_abort_scan(data); | 6332 | ipw_abort_scan(priv); |
6315 | mutex_unlock(&priv->mutex); | 6333 | mutex_unlock(&priv->mutex); |
6316 | } | 6334 | } |
6317 | 6335 | ||
@@ -7084,9 +7102,10 @@ static int ipw_qos_set_tx_queue_command(struct ipw_priv *priv, | |||
7084 | /* | 7102 | /* |
7085 | * background support to run QoS activate functionality | 7103 | * background support to run QoS activate functionality |
7086 | */ | 7104 | */ |
7087 | static void ipw_bg_qos_activate(void *data) | 7105 | static void ipw_bg_qos_activate(struct work_struct *work) |
7088 | { | 7106 | { |
7089 | struct ipw_priv *priv = data; | 7107 | struct ipw_priv *priv = |
7108 | container_of(work, struct ipw_priv, qos_activate); | ||
7090 | 7109 | ||
7091 | if (priv == NULL) | 7110 | if (priv == NULL) |
7092 | return; | 7111 | return; |
@@ -7394,11 +7413,12 @@ static void ipw_roam(void *data) | |||
7394 | priv->status &= ~STATUS_ROAMING; | 7413 | priv->status &= ~STATUS_ROAMING; |
7395 | } | 7414 | } |
7396 | 7415 | ||
7397 | static void ipw_bg_roam(void *data) | 7416 | static void ipw_bg_roam(struct work_struct *work) |
7398 | { | 7417 | { |
7399 | struct ipw_priv *priv = data; | 7418 | struct ipw_priv *priv = |
7419 | container_of(work, struct ipw_priv, roam); | ||
7400 | mutex_lock(&priv->mutex); | 7420 | mutex_lock(&priv->mutex); |
7401 | ipw_roam(data); | 7421 | ipw_roam(priv); |
7402 | mutex_unlock(&priv->mutex); | 7422 | mutex_unlock(&priv->mutex); |
7403 | } | 7423 | } |
7404 | 7424 | ||
@@ -7479,8 +7499,8 @@ static int ipw_associate(void *data) | |||
7479 | &priv->request_scan, | 7499 | &priv->request_scan, |
7480 | SCAN_INTERVAL); | 7500 | SCAN_INTERVAL); |
7481 | else | 7501 | else |
7482 | queue_work(priv->workqueue, | 7502 | queue_delayed_work(priv->workqueue, |
7483 | &priv->request_scan); | 7503 | &priv->request_scan, 0); |
7484 | } | 7504 | } |
7485 | 7505 | ||
7486 | return 0; | 7506 | return 0; |
@@ -7491,11 +7511,12 @@ static int ipw_associate(void *data) | |||
7491 | return 1; | 7511 | return 1; |
7492 | } | 7512 | } |
7493 | 7513 | ||
7494 | static void ipw_bg_associate(void *data) | 7514 | static void ipw_bg_associate(struct work_struct *work) |
7495 | { | 7515 | { |
7496 | struct ipw_priv *priv = data; | 7516 | struct ipw_priv *priv = |
7517 | container_of(work, struct ipw_priv, associate); | ||
7497 | mutex_lock(&priv->mutex); | 7518 | mutex_lock(&priv->mutex); |
7498 | ipw_associate(data); | 7519 | ipw_associate(priv); |
7499 | mutex_unlock(&priv->mutex); | 7520 | mutex_unlock(&priv->mutex); |
7500 | } | 7521 | } |
7501 | 7522 | ||
@@ -9410,7 +9431,7 @@ static int ipw_wx_set_scan(struct net_device *dev, | |||
9410 | 9431 | ||
9411 | IPW_DEBUG_WX("Start scan\n"); | 9432 | IPW_DEBUG_WX("Start scan\n"); |
9412 | 9433 | ||
9413 | queue_work(priv->workqueue, &priv->request_scan); | 9434 | queue_delayed_work(priv->workqueue, &priv->request_scan, 0); |
9414 | 9435 | ||
9415 | return 0; | 9436 | return 0; |
9416 | } | 9437 | } |
@@ -10547,11 +10568,12 @@ static void ipw_rf_kill(void *adapter) | |||
10547 | spin_unlock_irqrestore(&priv->lock, flags); | 10568 | spin_unlock_irqrestore(&priv->lock, flags); |
10548 | } | 10569 | } |
10549 | 10570 | ||
10550 | static void ipw_bg_rf_kill(void *data) | 10571 | static void ipw_bg_rf_kill(struct work_struct *work) |
10551 | { | 10572 | { |
10552 | struct ipw_priv *priv = data; | 10573 | struct ipw_priv *priv = |
10574 | container_of(work, struct ipw_priv, rf_kill.work); | ||
10553 | mutex_lock(&priv->mutex); | 10575 | mutex_lock(&priv->mutex); |
10554 | ipw_rf_kill(data); | 10576 | ipw_rf_kill(priv); |
10555 | mutex_unlock(&priv->mutex); | 10577 | mutex_unlock(&priv->mutex); |
10556 | } | 10578 | } |
10557 | 10579 | ||
@@ -10582,11 +10604,12 @@ static void ipw_link_up(struct ipw_priv *priv) | |||
10582 | queue_delayed_work(priv->workqueue, &priv->request_scan, HZ); | 10604 | queue_delayed_work(priv->workqueue, &priv->request_scan, HZ); |
10583 | } | 10605 | } |
10584 | 10606 | ||
10585 | static void ipw_bg_link_up(void *data) | 10607 | static void ipw_bg_link_up(struct work_struct *work) |
10586 | { | 10608 | { |
10587 | struct ipw_priv *priv = data; | 10609 | struct ipw_priv *priv = |
10610 | container_of(work, struct ipw_priv, link_up); | ||
10588 | mutex_lock(&priv->mutex); | 10611 | mutex_lock(&priv->mutex); |
10589 | ipw_link_up(data); | 10612 | ipw_link_up(priv); |
10590 | mutex_unlock(&priv->mutex); | 10613 | mutex_unlock(&priv->mutex); |
10591 | } | 10614 | } |
10592 | 10615 | ||
@@ -10606,15 +10629,16 @@ static void ipw_link_down(struct ipw_priv *priv) | |||
10606 | 10629 | ||
10607 | if (!(priv->status & STATUS_EXIT_PENDING)) { | 10630 | if (!(priv->status & STATUS_EXIT_PENDING)) { |
10608 | /* Queue up another scan... */ | 10631 | /* Queue up another scan... */ |
10609 | queue_work(priv->workqueue, &priv->request_scan); | 10632 | queue_delayed_work(priv->workqueue, &priv->request_scan, 0); |
10610 | } | 10633 | } |
10611 | } | 10634 | } |
10612 | 10635 | ||
10613 | static void ipw_bg_link_down(void *data) | 10636 | static void ipw_bg_link_down(struct work_struct *work) |
10614 | { | 10637 | { |
10615 | struct ipw_priv *priv = data; | 10638 | struct ipw_priv *priv = |
10639 | container_of(work, struct ipw_priv, link_down); | ||
10616 | mutex_lock(&priv->mutex); | 10640 | mutex_lock(&priv->mutex); |
10617 | ipw_link_down(data); | 10641 | ipw_link_down(priv); |
10618 | mutex_unlock(&priv->mutex); | 10642 | mutex_unlock(&priv->mutex); |
10619 | } | 10643 | } |
10620 | 10644 | ||
@@ -10626,38 +10650,30 @@ static int ipw_setup_deferred_work(struct ipw_priv *priv) | |||
10626 | init_waitqueue_head(&priv->wait_command_queue); | 10650 | init_waitqueue_head(&priv->wait_command_queue); |
10627 | init_waitqueue_head(&priv->wait_state); | 10651 | init_waitqueue_head(&priv->wait_state); |
10628 | 10652 | ||
10629 | INIT_WORK(&priv->adhoc_check, ipw_bg_adhoc_check, priv); | 10653 | INIT_DELAYED_WORK(&priv->adhoc_check, ipw_bg_adhoc_check); |
10630 | INIT_WORK(&priv->associate, ipw_bg_associate, priv); | 10654 | INIT_WORK(&priv->associate, ipw_bg_associate); |
10631 | INIT_WORK(&priv->disassociate, ipw_bg_disassociate, priv); | 10655 | INIT_WORK(&priv->disassociate, ipw_bg_disassociate); |
10632 | INIT_WORK(&priv->system_config, ipw_system_config, priv); | 10656 | INIT_WORK(&priv->system_config, ipw_system_config); |
10633 | INIT_WORK(&priv->rx_replenish, ipw_bg_rx_queue_replenish, priv); | 10657 | INIT_WORK(&priv->rx_replenish, ipw_bg_rx_queue_replenish); |
10634 | INIT_WORK(&priv->adapter_restart, ipw_bg_adapter_restart, priv); | 10658 | INIT_WORK(&priv->adapter_restart, ipw_bg_adapter_restart); |
10635 | INIT_WORK(&priv->rf_kill, ipw_bg_rf_kill, priv); | 10659 | INIT_DELAYED_WORK(&priv->rf_kill, ipw_bg_rf_kill); |
10636 | INIT_WORK(&priv->up, (void (*)(void *))ipw_bg_up, priv); | 10660 | INIT_WORK(&priv->up, ipw_bg_up); |
10637 | INIT_WORK(&priv->down, (void (*)(void *))ipw_bg_down, priv); | 10661 | INIT_WORK(&priv->down, ipw_bg_down); |
10638 | INIT_WORK(&priv->request_scan, | 10662 | INIT_DELAYED_WORK(&priv->request_scan, ipw_request_scan); |
10639 | (void (*)(void *))ipw_request_scan, priv); | 10663 | INIT_WORK(&priv->request_passive_scan, ipw_request_passive_scan); |
10640 | INIT_WORK(&priv->request_passive_scan, | 10664 | INIT_DELAYED_WORK(&priv->gather_stats, ipw_bg_gather_stats); |
10641 | (void (*)(void *))ipw_request_passive_scan, priv); | 10665 | INIT_WORK(&priv->abort_scan, ipw_bg_abort_scan); |
10642 | INIT_WORK(&priv->gather_stats, | 10666 | INIT_WORK(&priv->roam, ipw_bg_roam); |
10643 | (void (*)(void *))ipw_bg_gather_stats, priv); | 10667 | INIT_DELAYED_WORK(&priv->scan_check, ipw_bg_scan_check); |
10644 | INIT_WORK(&priv->abort_scan, (void (*)(void *))ipw_bg_abort_scan, priv); | 10668 | INIT_WORK(&priv->link_up, ipw_bg_link_up); |
10645 | INIT_WORK(&priv->roam, ipw_bg_roam, priv); | 10669 | INIT_WORK(&priv->link_down, ipw_bg_link_down); |
10646 | INIT_WORK(&priv->scan_check, ipw_bg_scan_check, priv); | 10670 | INIT_DELAYED_WORK(&priv->led_link_on, ipw_bg_led_link_on); |
10647 | INIT_WORK(&priv->link_up, (void (*)(void *))ipw_bg_link_up, priv); | 10671 | INIT_DELAYED_WORK(&priv->led_link_off, ipw_bg_led_link_off); |
10648 | INIT_WORK(&priv->link_down, (void (*)(void *))ipw_bg_link_down, priv); | 10672 | INIT_DELAYED_WORK(&priv->led_act_off, ipw_bg_led_activity_off); |
10649 | INIT_WORK(&priv->led_link_on, (void (*)(void *))ipw_bg_led_link_on, | 10673 | INIT_WORK(&priv->merge_networks, ipw_merge_adhoc_network); |
10650 | priv); | ||
10651 | INIT_WORK(&priv->led_link_off, (void (*)(void *))ipw_bg_led_link_off, | ||
10652 | priv); | ||
10653 | INIT_WORK(&priv->led_act_off, (void (*)(void *))ipw_bg_led_activity_off, | ||
10654 | priv); | ||
10655 | INIT_WORK(&priv->merge_networks, | ||
10656 | (void (*)(void *))ipw_merge_adhoc_network, priv); | ||
10657 | 10674 | ||
10658 | #ifdef CONFIG_IPW2200_QOS | 10675 | #ifdef CONFIG_IPW2200_QOS |
10659 | INIT_WORK(&priv->qos_activate, (void (*)(void *))ipw_bg_qos_activate, | 10676 | INIT_WORK(&priv->qos_activate, ipw_bg_qos_activate); |
10660 | priv); | ||
10661 | #endif /* CONFIG_IPW2200_QOS */ | 10677 | #endif /* CONFIG_IPW2200_QOS */ |
10662 | 10678 | ||
10663 | tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long)) | 10679 | tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long)) |
@@ -11190,7 +11206,8 @@ static int ipw_up(struct ipw_priv *priv) | |||
11190 | 11206 | ||
11191 | /* If configure to try and auto-associate, kick | 11207 | /* If configure to try and auto-associate, kick |
11192 | * off a scan. */ | 11208 | * off a scan. */ |
11193 | queue_work(priv->workqueue, &priv->request_scan); | 11209 | queue_delayed_work(priv->workqueue, |
11210 | &priv->request_scan, 0); | ||
11194 | 11211 | ||
11195 | return 0; | 11212 | return 0; |
11196 | } | 11213 | } |
@@ -11211,11 +11228,12 @@ static int ipw_up(struct ipw_priv *priv) | |||
11211 | return -EIO; | 11228 | return -EIO; |
11212 | } | 11229 | } |
11213 | 11230 | ||
11214 | static void ipw_bg_up(void *data) | 11231 | static void ipw_bg_up(struct work_struct *work) |
11215 | { | 11232 | { |
11216 | struct ipw_priv *priv = data; | 11233 | struct ipw_priv *priv = |
11234 | container_of(work, struct ipw_priv, up); | ||
11217 | mutex_lock(&priv->mutex); | 11235 | mutex_lock(&priv->mutex); |
11218 | ipw_up(data); | 11236 | ipw_up(priv); |
11219 | mutex_unlock(&priv->mutex); | 11237 | mutex_unlock(&priv->mutex); |
11220 | } | 11238 | } |
11221 | 11239 | ||
@@ -11282,11 +11300,12 @@ static void ipw_down(struct ipw_priv *priv) | |||
11282 | ipw_led_radio_off(priv); | 11300 | ipw_led_radio_off(priv); |
11283 | } | 11301 | } |
11284 | 11302 | ||
11285 | static void ipw_bg_down(void *data) | 11303 | static void ipw_bg_down(struct work_struct *work) |
11286 | { | 11304 | { |
11287 | struct ipw_priv *priv = data; | 11305 | struct ipw_priv *priv = |
11306 | container_of(work, struct ipw_priv, down); | ||
11288 | mutex_lock(&priv->mutex); | 11307 | mutex_lock(&priv->mutex); |
11289 | ipw_down(data); | 11308 | ipw_down(priv); |
11290 | mutex_unlock(&priv->mutex); | 11309 | mutex_unlock(&priv->mutex); |
11291 | } | 11310 | } |
11292 | 11311 | ||
diff --git a/drivers/net/wireless/ipw2200.h b/drivers/net/wireless/ipw2200.h index dad5eedefbf1..626a240a87d8 100644 --- a/drivers/net/wireless/ipw2200.h +++ b/drivers/net/wireless/ipw2200.h | |||
@@ -1290,21 +1290,21 @@ struct ipw_priv { | |||
1290 | 1290 | ||
1291 | struct workqueue_struct *workqueue; | 1291 | struct workqueue_struct *workqueue; |
1292 | 1292 | ||
1293 | struct work_struct adhoc_check; | 1293 | struct delayed_work adhoc_check; |
1294 | struct work_struct associate; | 1294 | struct work_struct associate; |
1295 | struct work_struct disassociate; | 1295 | struct work_struct disassociate; |
1296 | struct work_struct system_config; | 1296 | struct work_struct system_config; |
1297 | struct work_struct rx_replenish; | 1297 | struct work_struct rx_replenish; |
1298 | struct work_struct request_scan; | 1298 | struct delayed_work request_scan; |
1299 | struct work_struct request_passive_scan; | 1299 | struct work_struct request_passive_scan; |
1300 | struct work_struct adapter_restart; | 1300 | struct work_struct adapter_restart; |
1301 | struct work_struct rf_kill; | 1301 | struct delayed_work rf_kill; |
1302 | struct work_struct up; | 1302 | struct work_struct up; |
1303 | struct work_struct down; | 1303 | struct work_struct down; |
1304 | struct work_struct gather_stats; | 1304 | struct delayed_work gather_stats; |
1305 | struct work_struct abort_scan; | 1305 | struct work_struct abort_scan; |
1306 | struct work_struct roam; | 1306 | struct work_struct roam; |
1307 | struct work_struct scan_check; | 1307 | struct delayed_work scan_check; |
1308 | struct work_struct link_up; | 1308 | struct work_struct link_up; |
1309 | struct work_struct link_down; | 1309 | struct work_struct link_down; |
1310 | 1310 | ||
@@ -1319,9 +1319,9 @@ struct ipw_priv { | |||
1319 | u32 led_ofdm_on; | 1319 | u32 led_ofdm_on; |
1320 | u32 led_ofdm_off; | 1320 | u32 led_ofdm_off; |
1321 | 1321 | ||
1322 | struct work_struct led_link_on; | 1322 | struct delayed_work led_link_on; |
1323 | struct work_struct led_link_off; | 1323 | struct delayed_work led_link_off; |
1324 | struct work_struct led_act_off; | 1324 | struct delayed_work led_act_off; |
1325 | struct work_struct merge_networks; | 1325 | struct work_struct merge_networks; |
1326 | 1326 | ||
1327 | struct ipw_cmd_log *cmdlog; | 1327 | struct ipw_cmd_log *cmdlog; |
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index 336cabac13b3..936c888e03e1 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c | |||
@@ -980,9 +980,11 @@ static void print_linkstatus(struct net_device *dev, u16 status) | |||
980 | } | 980 | } |
981 | 981 | ||
982 | /* Search scan results for requested BSSID, join it if found */ | 982 | /* Search scan results for requested BSSID, join it if found */ |
983 | static void orinoco_join_ap(struct net_device *dev) | 983 | static void orinoco_join_ap(struct work_struct *work) |
984 | { | 984 | { |
985 | struct orinoco_private *priv = netdev_priv(dev); | 985 | struct orinoco_private *priv = |
986 | container_of(work, struct orinoco_private, join_work); | ||
987 | struct net_device *dev = priv->ndev; | ||
986 | struct hermes *hw = &priv->hw; | 988 | struct hermes *hw = &priv->hw; |
987 | int err; | 989 | int err; |
988 | unsigned long flags; | 990 | unsigned long flags; |
@@ -1055,9 +1057,11 @@ static void orinoco_join_ap(struct net_device *dev) | |||
1055 | } | 1057 | } |
1056 | 1058 | ||
1057 | /* Send new BSSID to userspace */ | 1059 | /* Send new BSSID to userspace */ |
1058 | static void orinoco_send_wevents(struct net_device *dev) | 1060 | static void orinoco_send_wevents(struct work_struct *work) |
1059 | { | 1061 | { |
1060 | struct orinoco_private *priv = netdev_priv(dev); | 1062 | struct orinoco_private *priv = |
1063 | container_of(work, struct orinoco_private, wevent_work); | ||
1064 | struct net_device *dev = priv->ndev; | ||
1061 | struct hermes *hw = &priv->hw; | 1065 | struct hermes *hw = &priv->hw; |
1062 | union iwreq_data wrqu; | 1066 | union iwreq_data wrqu; |
1063 | int err; | 1067 | int err; |
@@ -1864,9 +1868,11 @@ __orinoco_set_multicast_list(struct net_device *dev) | |||
1864 | 1868 | ||
1865 | /* This must be called from user context, without locks held - use | 1869 | /* This must be called from user context, without locks held - use |
1866 | * schedule_work() */ | 1870 | * schedule_work() */ |
1867 | static void orinoco_reset(struct net_device *dev) | 1871 | static void orinoco_reset(struct work_struct *work) |
1868 | { | 1872 | { |
1869 | struct orinoco_private *priv = netdev_priv(dev); | 1873 | struct orinoco_private *priv = |
1874 | container_of(work, struct orinoco_private, reset_work); | ||
1875 | struct net_device *dev = priv->ndev; | ||
1870 | struct hermes *hw = &priv->hw; | 1876 | struct hermes *hw = &priv->hw; |
1871 | int err; | 1877 | int err; |
1872 | unsigned long flags; | 1878 | unsigned long flags; |
@@ -2434,9 +2440,9 @@ struct net_device *alloc_orinocodev(int sizeof_card, | |||
2434 | priv->hw_unavailable = 1; /* orinoco_init() must clear this | 2440 | priv->hw_unavailable = 1; /* orinoco_init() must clear this |
2435 | * before anything else touches the | 2441 | * before anything else touches the |
2436 | * hardware */ | 2442 | * hardware */ |
2437 | INIT_WORK(&priv->reset_work, (void (*)(void *))orinoco_reset, dev); | 2443 | INIT_WORK(&priv->reset_work, orinoco_reset); |
2438 | INIT_WORK(&priv->join_work, (void (*)(void *))orinoco_join_ap, dev); | 2444 | INIT_WORK(&priv->join_work, orinoco_join_ap); |
2439 | INIT_WORK(&priv->wevent_work, (void (*)(void *))orinoco_send_wevents, dev); | 2445 | INIT_WORK(&priv->wevent_work, orinoco_send_wevents); |
2440 | 2446 | ||
2441 | netif_carrier_off(dev); | 2447 | netif_carrier_off(dev); |
2442 | priv->last_linkstatus = 0xffff; | 2448 | priv->last_linkstatus = 0xffff; |
@@ -3608,7 +3614,7 @@ static int orinoco_ioctl_reset(struct net_device *dev, | |||
3608 | printk(KERN_DEBUG "%s: Forcing reset!\n", dev->name); | 3614 | printk(KERN_DEBUG "%s: Forcing reset!\n", dev->name); |
3609 | 3615 | ||
3610 | /* Firmware reset */ | 3616 | /* Firmware reset */ |
3611 | orinoco_reset(dev); | 3617 | orinoco_reset(&priv->reset_work); |
3612 | } else { | 3618 | } else { |
3613 | printk(KERN_DEBUG "%s: Force scheduling reset!\n", dev->name); | 3619 | printk(KERN_DEBUG "%s: Force scheduling reset!\n", dev->name); |
3614 | 3620 | ||
@@ -4154,7 +4160,7 @@ static int orinoco_ioctl_commit(struct net_device *dev, | |||
4154 | return 0; | 4160 | return 0; |
4155 | 4161 | ||
4156 | if (priv->broken_disableport) { | 4162 | if (priv->broken_disableport) { |
4157 | orinoco_reset(dev); | 4163 | orinoco_reset(&priv->reset_work); |
4158 | return 0; | 4164 | return 0; |
4159 | } | 4165 | } |
4160 | 4166 | ||
diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c index 4a20e45de3ca..a87eb51886c8 100644 --- a/drivers/net/wireless/prism54/isl_ioctl.c +++ b/drivers/net/wireless/prism54/isl_ioctl.c | |||
@@ -157,8 +157,9 @@ prism54_mib_init(islpci_private *priv) | |||
157 | * schedule_work(), thus we can as well use sleeping semaphore | 157 | * schedule_work(), thus we can as well use sleeping semaphore |
158 | * locking */ | 158 | * locking */ |
159 | void | 159 | void |
160 | prism54_update_stats(islpci_private *priv) | 160 | prism54_update_stats(struct work_struct *work) |
161 | { | 161 | { |
162 | islpci_private *priv = container_of(work, islpci_private, stats_work); | ||
162 | char *data; | 163 | char *data; |
163 | int j; | 164 | int j; |
164 | struct obj_bss bss, *bss2; | 165 | struct obj_bss bss, *bss2; |
@@ -2493,9 +2494,10 @@ prism54_process_trap_helper(islpci_private *priv, enum oid_num_t oid, | |||
2493 | * interrupt context, no locks held. | 2494 | * interrupt context, no locks held. |
2494 | */ | 2495 | */ |
2495 | void | 2496 | void |
2496 | prism54_process_trap(void *data) | 2497 | prism54_process_trap(struct work_struct *work) |
2497 | { | 2498 | { |
2498 | struct islpci_mgmtframe *frame = data; | 2499 | struct islpci_mgmtframe *frame = |
2500 | container_of(work, struct islpci_mgmtframe, ws); | ||
2499 | struct net_device *ndev = frame->ndev; | 2501 | struct net_device *ndev = frame->ndev; |
2500 | enum oid_num_t n = mgt_oidtonum(frame->header->oid); | 2502 | enum oid_num_t n = mgt_oidtonum(frame->header->oid); |
2501 | 2503 | ||
diff --git a/drivers/net/wireless/prism54/isl_ioctl.h b/drivers/net/wireless/prism54/isl_ioctl.h index e8183d30c52e..bcfbfb9281d2 100644 --- a/drivers/net/wireless/prism54/isl_ioctl.h +++ b/drivers/net/wireless/prism54/isl_ioctl.h | |||
@@ -31,12 +31,12 @@ | |||
31 | void prism54_mib_init(islpci_private *); | 31 | void prism54_mib_init(islpci_private *); |
32 | 32 | ||
33 | struct iw_statistics *prism54_get_wireless_stats(struct net_device *); | 33 | struct iw_statistics *prism54_get_wireless_stats(struct net_device *); |
34 | void prism54_update_stats(islpci_private *); | 34 | void prism54_update_stats(struct work_struct *); |
35 | 35 | ||
36 | void prism54_acl_init(struct islpci_acl *); | 36 | void prism54_acl_init(struct islpci_acl *); |
37 | void prism54_acl_clean(struct islpci_acl *); | 37 | void prism54_acl_clean(struct islpci_acl *); |
38 | 38 | ||
39 | void prism54_process_trap(void *); | 39 | void prism54_process_trap(struct work_struct *); |
40 | 40 | ||
41 | void prism54_wpa_bss_ie_init(islpci_private *priv); | 41 | void prism54_wpa_bss_ie_init(islpci_private *priv); |
42 | void prism54_wpa_bss_ie_clean(islpci_private *priv); | 42 | void prism54_wpa_bss_ie_clean(islpci_private *priv); |
diff --git a/drivers/net/wireless/prism54/islpci_dev.c b/drivers/net/wireless/prism54/islpci_dev.c index 1e0603ca436c..f057fd9fcd79 100644 --- a/drivers/net/wireless/prism54/islpci_dev.c +++ b/drivers/net/wireless/prism54/islpci_dev.c | |||
@@ -860,11 +860,10 @@ islpci_setup(struct pci_dev *pdev) | |||
860 | priv->state_off = 1; | 860 | priv->state_off = 1; |
861 | 861 | ||
862 | /* initialize workqueue's */ | 862 | /* initialize workqueue's */ |
863 | INIT_WORK(&priv->stats_work, | 863 | INIT_WORK(&priv->stats_work, prism54_update_stats); |
864 | (void (*)(void *)) prism54_update_stats, priv); | ||
865 | priv->stats_timestamp = 0; | 864 | priv->stats_timestamp = 0; |
866 | 865 | ||
867 | INIT_WORK(&priv->reset_task, islpci_do_reset_and_wake, priv); | 866 | INIT_WORK(&priv->reset_task, islpci_do_reset_and_wake); |
868 | priv->reset_task_pending = 0; | 867 | priv->reset_task_pending = 0; |
869 | 868 | ||
870 | /* allocate various memory areas */ | 869 | /* allocate various memory areas */ |
diff --git a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c index 676d83813dc8..b1122912ee2d 100644 --- a/drivers/net/wireless/prism54/islpci_eth.c +++ b/drivers/net/wireless/prism54/islpci_eth.c | |||
@@ -480,9 +480,9 @@ islpci_eth_receive(islpci_private *priv) | |||
480 | } | 480 | } |
481 | 481 | ||
482 | void | 482 | void |
483 | islpci_do_reset_and_wake(void *data) | 483 | islpci_do_reset_and_wake(struct work_struct *work) |
484 | { | 484 | { |
485 | islpci_private *priv = data; | 485 | islpci_private *priv = container_of(work, islpci_private, reset_task); |
486 | 486 | ||
487 | islpci_reset(priv, 1); | 487 | islpci_reset(priv, 1); |
488 | priv->reset_task_pending = 0; | 488 | priv->reset_task_pending = 0; |
diff --git a/drivers/net/wireless/prism54/islpci_eth.h b/drivers/net/wireless/prism54/islpci_eth.h index 26789454067c..5bf820defbd0 100644 --- a/drivers/net/wireless/prism54/islpci_eth.h +++ b/drivers/net/wireless/prism54/islpci_eth.h | |||
@@ -67,6 +67,6 @@ void islpci_eth_cleanup_transmit(islpci_private *, isl38xx_control_block *); | |||
67 | int islpci_eth_transmit(struct sk_buff *, struct net_device *); | 67 | int islpci_eth_transmit(struct sk_buff *, struct net_device *); |
68 | int islpci_eth_receive(islpci_private *); | 68 | int islpci_eth_receive(islpci_private *); |
69 | void islpci_eth_tx_timeout(struct net_device *); | 69 | void islpci_eth_tx_timeout(struct net_device *); |
70 | void islpci_do_reset_and_wake(void *data); | 70 | void islpci_do_reset_and_wake(struct work_struct *); |
71 | 71 | ||
72 | #endif /* _ISL_GEN_H */ | 72 | #endif /* _ISL_GEN_H */ |
diff --git a/drivers/net/wireless/prism54/islpci_mgt.c b/drivers/net/wireless/prism54/islpci_mgt.c index 036a875054c9..2246f7930b4e 100644 --- a/drivers/net/wireless/prism54/islpci_mgt.c +++ b/drivers/net/wireless/prism54/islpci_mgt.c | |||
@@ -386,7 +386,7 @@ islpci_mgt_receive(struct net_device *ndev) | |||
386 | 386 | ||
387 | /* Create work to handle trap out of interrupt | 387 | /* Create work to handle trap out of interrupt |
388 | * context. */ | 388 | * context. */ |
389 | INIT_WORK(&frame->ws, prism54_process_trap, frame); | 389 | INIT_WORK(&frame->ws, prism54_process_trap); |
390 | schedule_work(&frame->ws); | 390 | schedule_work(&frame->ws); |
391 | 391 | ||
392 | } else { | 392 | } else { |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index 2696f95b9278..f1573a9c2336 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c | |||
@@ -32,8 +32,8 @@ | |||
32 | 32 | ||
33 | static void ieee_init(struct ieee80211_device *ieee); | 33 | static void ieee_init(struct ieee80211_device *ieee); |
34 | static void softmac_init(struct ieee80211softmac_device *sm); | 34 | static void softmac_init(struct ieee80211softmac_device *sm); |
35 | static void set_rts_cts_work(void *d); | 35 | static void set_rts_cts_work(struct work_struct *work); |
36 | static void set_basic_rates_work(void *d); | 36 | static void set_basic_rates_work(struct work_struct *work); |
37 | 37 | ||
38 | static void housekeeping_init(struct zd_mac *mac); | 38 | static void housekeeping_init(struct zd_mac *mac); |
39 | static void housekeeping_enable(struct zd_mac *mac); | 39 | static void housekeeping_enable(struct zd_mac *mac); |
@@ -48,8 +48,8 @@ int zd_mac_init(struct zd_mac *mac, | |||
48 | memset(mac, 0, sizeof(*mac)); | 48 | memset(mac, 0, sizeof(*mac)); |
49 | spin_lock_init(&mac->lock); | 49 | spin_lock_init(&mac->lock); |
50 | mac->netdev = netdev; | 50 | mac->netdev = netdev; |
51 | INIT_WORK(&mac->set_rts_cts_work, set_rts_cts_work, mac); | 51 | INIT_DELAYED_WORK(&mac->set_rts_cts_work, set_rts_cts_work); |
52 | INIT_WORK(&mac->set_basic_rates_work, set_basic_rates_work, mac); | 52 | INIT_DELAYED_WORK(&mac->set_basic_rates_work, set_basic_rates_work); |
53 | 53 | ||
54 | ieee_init(ieee); | 54 | ieee_init(ieee); |
55 | softmac_init(ieee80211_priv(netdev)); | 55 | softmac_init(ieee80211_priv(netdev)); |
@@ -366,9 +366,10 @@ static void try_enable_tx(struct zd_mac *mac) | |||
366 | spin_unlock_irqrestore(&mac->lock, flags); | 366 | spin_unlock_irqrestore(&mac->lock, flags); |
367 | } | 367 | } |
368 | 368 | ||
369 | static void set_rts_cts_work(void *d) | 369 | static void set_rts_cts_work(struct work_struct *work) |
370 | { | 370 | { |
371 | struct zd_mac *mac = d; | 371 | struct zd_mac *mac = |
372 | container_of(work, struct zd_mac, set_rts_cts_work.work); | ||
372 | unsigned long flags; | 373 | unsigned long flags; |
373 | u8 rts_rate; | 374 | u8 rts_rate; |
374 | unsigned int short_preamble; | 375 | unsigned int short_preamble; |
@@ -387,9 +388,10 @@ static void set_rts_cts_work(void *d) | |||
387 | try_enable_tx(mac); | 388 | try_enable_tx(mac); |
388 | } | 389 | } |
389 | 390 | ||
390 | static void set_basic_rates_work(void *d) | 391 | static void set_basic_rates_work(struct work_struct *work) |
391 | { | 392 | { |
392 | struct zd_mac *mac = d; | 393 | struct zd_mac *mac = |
394 | container_of(work, struct zd_mac, set_basic_rates_work.work); | ||
393 | unsigned long flags; | 395 | unsigned long flags; |
394 | u16 basic_rates; | 396 | u16 basic_rates; |
395 | 397 | ||
@@ -467,12 +469,13 @@ static void bssinfo_change(struct net_device *netdev, u32 changes) | |||
467 | if (need_set_rts_cts && !mac->updating_rts_rate) { | 469 | if (need_set_rts_cts && !mac->updating_rts_rate) { |
468 | mac->updating_rts_rate = 1; | 470 | mac->updating_rts_rate = 1; |
469 | netif_stop_queue(mac->netdev); | 471 | netif_stop_queue(mac->netdev); |
470 | queue_work(zd_workqueue, &mac->set_rts_cts_work); | 472 | queue_delayed_work(zd_workqueue, &mac->set_rts_cts_work, 0); |
471 | } | 473 | } |
472 | if (need_set_rates && !mac->updating_basic_rates) { | 474 | if (need_set_rates && !mac->updating_basic_rates) { |
473 | mac->updating_basic_rates = 1; | 475 | mac->updating_basic_rates = 1; |
474 | netif_stop_queue(mac->netdev); | 476 | netif_stop_queue(mac->netdev); |
475 | queue_work(zd_workqueue, &mac->set_basic_rates_work); | 477 | queue_delayed_work(zd_workqueue, &mac->set_basic_rates_work, |
478 | 0); | ||
476 | } | 479 | } |
477 | spin_unlock_irqrestore(&mac->lock, flags); | 480 | spin_unlock_irqrestore(&mac->lock, flags); |
478 | } | 481 | } |
@@ -1182,9 +1185,10 @@ struct iw_statistics *zd_mac_get_wireless_stats(struct net_device *ndev) | |||
1182 | 1185 | ||
1183 | #define LINK_LED_WORK_DELAY HZ | 1186 | #define LINK_LED_WORK_DELAY HZ |
1184 | 1187 | ||
1185 | static void link_led_handler(void *p) | 1188 | static void link_led_handler(struct work_struct *work) |
1186 | { | 1189 | { |
1187 | struct zd_mac *mac = p; | 1190 | struct zd_mac *mac = |
1191 | container_of(work, struct zd_mac, housekeeping.link_led_work.work); | ||
1188 | struct zd_chip *chip = &mac->chip; | 1192 | struct zd_chip *chip = &mac->chip; |
1189 | struct ieee80211softmac_device *sm = ieee80211_priv(mac->netdev); | 1193 | struct ieee80211softmac_device *sm = ieee80211_priv(mac->netdev); |
1190 | int is_associated; | 1194 | int is_associated; |
@@ -1205,7 +1209,7 @@ static void link_led_handler(void *p) | |||
1205 | 1209 | ||
1206 | static void housekeeping_init(struct zd_mac *mac) | 1210 | static void housekeeping_init(struct zd_mac *mac) |
1207 | { | 1211 | { |
1208 | INIT_WORK(&mac->housekeeping.link_led_work, link_led_handler, mac); | 1212 | INIT_DELAYED_WORK(&mac->housekeeping.link_led_work, link_led_handler); |
1209 | } | 1213 | } |
1210 | 1214 | ||
1211 | static void housekeeping_enable(struct zd_mac *mac) | 1215 | static void housekeeping_enable(struct zd_mac *mac) |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.h b/drivers/net/wireless/zd1211rw/zd_mac.h index 5dcfb251f02e..d4e8b870409d 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.h +++ b/drivers/net/wireless/zd1211rw/zd_mac.h | |||
@@ -119,7 +119,7 @@ struct rx_status { | |||
119 | #define ZD_RX_ERROR 0x80 | 119 | #define ZD_RX_ERROR 0x80 |
120 | 120 | ||
121 | struct housekeeping { | 121 | struct housekeeping { |
122 | struct work_struct link_led_work; | 122 | struct delayed_work link_led_work; |
123 | }; | 123 | }; |
124 | 124 | ||
125 | #define ZD_MAC_STATS_BUFFER_SIZE 16 | 125 | #define ZD_MAC_STATS_BUFFER_SIZE 16 |
@@ -133,8 +133,8 @@ struct zd_mac { | |||
133 | struct iw_statistics iw_stats; | 133 | struct iw_statistics iw_stats; |
134 | 134 | ||
135 | struct housekeeping housekeeping; | 135 | struct housekeeping housekeeping; |
136 | struct work_struct set_rts_cts_work; | 136 | struct delayed_work set_rts_cts_work; |
137 | struct work_struct set_basic_rates_work; | 137 | struct delayed_work set_basic_rates_work; |
138 | 138 | ||
139 | unsigned int stats_count; | 139 | unsigned int stats_count; |
140 | u8 qual_buffer[ZD_MAC_STATS_BUFFER_SIZE]; | 140 | u8 qual_buffer[ZD_MAC_STATS_BUFFER_SIZE]; |
diff --git a/drivers/oprofile/cpu_buffer.c b/drivers/oprofile/cpu_buffer.c index fc4bc9b94c74..a83c3db7d18f 100644 --- a/drivers/oprofile/cpu_buffer.c +++ b/drivers/oprofile/cpu_buffer.c | |||
@@ -29,7 +29,7 @@ | |||
29 | 29 | ||
30 | struct oprofile_cpu_buffer cpu_buffer[NR_CPUS] __cacheline_aligned; | 30 | struct oprofile_cpu_buffer cpu_buffer[NR_CPUS] __cacheline_aligned; |
31 | 31 | ||
32 | static void wq_sync_buffer(void *); | 32 | static void wq_sync_buffer(struct work_struct *work); |
33 | 33 | ||
34 | #define DEFAULT_TIMER_EXPIRE (HZ / 10) | 34 | #define DEFAULT_TIMER_EXPIRE (HZ / 10) |
35 | static int work_enabled; | 35 | static int work_enabled; |
@@ -65,7 +65,7 @@ int alloc_cpu_buffers(void) | |||
65 | b->sample_received = 0; | 65 | b->sample_received = 0; |
66 | b->sample_lost_overflow = 0; | 66 | b->sample_lost_overflow = 0; |
67 | b->cpu = i; | 67 | b->cpu = i; |
68 | INIT_WORK(&b->work, wq_sync_buffer, b); | 68 | INIT_DELAYED_WORK(&b->work, wq_sync_buffer); |
69 | } | 69 | } |
70 | return 0; | 70 | return 0; |
71 | 71 | ||
@@ -282,9 +282,10 @@ void oprofile_add_trace(unsigned long pc) | |||
282 | * By using schedule_delayed_work_on and then schedule_delayed_work | 282 | * By using schedule_delayed_work_on and then schedule_delayed_work |
283 | * we guarantee this will stay on the correct cpu | 283 | * we guarantee this will stay on the correct cpu |
284 | */ | 284 | */ |
285 | static void wq_sync_buffer(void * data) | 285 | static void wq_sync_buffer(struct work_struct *work) |
286 | { | 286 | { |
287 | struct oprofile_cpu_buffer * b = data; | 287 | struct oprofile_cpu_buffer * b = |
288 | container_of(work, struct oprofile_cpu_buffer, work.work); | ||
288 | if (b->cpu != smp_processor_id()) { | 289 | if (b->cpu != smp_processor_id()) { |
289 | printk("WQ on CPU%d, prefer CPU%d\n", | 290 | printk("WQ on CPU%d, prefer CPU%d\n", |
290 | smp_processor_id(), b->cpu); | 291 | smp_processor_id(), b->cpu); |
diff --git a/drivers/oprofile/cpu_buffer.h b/drivers/oprofile/cpu_buffer.h index 09abb80e0570..49900d9e3235 100644 --- a/drivers/oprofile/cpu_buffer.h +++ b/drivers/oprofile/cpu_buffer.h | |||
@@ -43,7 +43,7 @@ struct oprofile_cpu_buffer { | |||
43 | unsigned long sample_lost_overflow; | 43 | unsigned long sample_lost_overflow; |
44 | unsigned long backtrace_aborted; | 44 | unsigned long backtrace_aborted; |
45 | int cpu; | 45 | int cpu; |
46 | struct work_struct work; | 46 | struct delayed_work work; |
47 | } ____cacheline_aligned; | 47 | } ____cacheline_aligned; |
48 | 48 | ||
49 | extern struct oprofile_cpu_buffer cpu_buffer[]; | 49 | extern struct oprofile_cpu_buffer cpu_buffer[]; |
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h index ea2087c34149..50757695844f 100644 --- a/drivers/pci/hotplug/shpchp.h +++ b/drivers/pci/hotplug/shpchp.h | |||
@@ -70,7 +70,7 @@ struct slot { | |||
70 | struct hotplug_slot *hotplug_slot; | 70 | struct hotplug_slot *hotplug_slot; |
71 | struct list_head slot_list; | 71 | struct list_head slot_list; |
72 | char name[SLOT_NAME_SIZE]; | 72 | char name[SLOT_NAME_SIZE]; |
73 | struct work_struct work; /* work for button event */ | 73 | struct delayed_work work; /* work for button event */ |
74 | struct mutex lock; | 74 | struct mutex lock; |
75 | }; | 75 | }; |
76 | 76 | ||
@@ -187,7 +187,7 @@ extern int shpchp_configure_device(struct slot *p_slot); | |||
187 | extern int shpchp_unconfigure_device(struct slot *p_slot); | 187 | extern int shpchp_unconfigure_device(struct slot *p_slot); |
188 | extern void shpchp_remove_ctrl_files(struct controller *ctrl); | 188 | extern void shpchp_remove_ctrl_files(struct controller *ctrl); |
189 | extern void cleanup_slots(struct controller *ctrl); | 189 | extern void cleanup_slots(struct controller *ctrl); |
190 | extern void queue_pushbutton_work(void *data); | 190 | extern void queue_pushbutton_work(struct work_struct *work); |
191 | 191 | ||
192 | 192 | ||
193 | #ifdef CONFIG_ACPI | 193 | #ifdef CONFIG_ACPI |
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c index 235c18a22393..4eac85b3d90e 100644 --- a/drivers/pci/hotplug/shpchp_core.c +++ b/drivers/pci/hotplug/shpchp_core.c | |||
@@ -159,7 +159,7 @@ static int init_slots(struct controller *ctrl) | |||
159 | goto error_info; | 159 | goto error_info; |
160 | 160 | ||
161 | slot->number = sun; | 161 | slot->number = sun; |
162 | INIT_WORK(&slot->work, queue_pushbutton_work, slot); | 162 | INIT_DELAYED_WORK(&slot->work, queue_pushbutton_work); |
163 | 163 | ||
164 | /* register this slot with the hotplug pci core */ | 164 | /* register this slot with the hotplug pci core */ |
165 | hotplug_slot->private = slot; | 165 | hotplug_slot->private = slot; |
diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c index c39901dbff20..158ac7836096 100644 --- a/drivers/pci/hotplug/shpchp_ctrl.c +++ b/drivers/pci/hotplug/shpchp_ctrl.c | |||
@@ -36,7 +36,7 @@ | |||
36 | #include "../pci.h" | 36 | #include "../pci.h" |
37 | #include "shpchp.h" | 37 | #include "shpchp.h" |
38 | 38 | ||
39 | static void interrupt_event_handler(void *data); | 39 | static void interrupt_event_handler(struct work_struct *work); |
40 | static int shpchp_enable_slot(struct slot *p_slot); | 40 | static int shpchp_enable_slot(struct slot *p_slot); |
41 | static int shpchp_disable_slot(struct slot *p_slot); | 41 | static int shpchp_disable_slot(struct slot *p_slot); |
42 | 42 | ||
@@ -50,7 +50,7 @@ static int queue_interrupt_event(struct slot *p_slot, u32 event_type) | |||
50 | 50 | ||
51 | info->event_type = event_type; | 51 | info->event_type = event_type; |
52 | info->p_slot = p_slot; | 52 | info->p_slot = p_slot; |
53 | INIT_WORK(&info->work, interrupt_event_handler, info); | 53 | INIT_WORK(&info->work, interrupt_event_handler); |
54 | 54 | ||
55 | schedule_work(&info->work); | 55 | schedule_work(&info->work); |
56 | 56 | ||
@@ -408,9 +408,10 @@ struct pushbutton_work_info { | |||
408 | * Handles all pending events and exits. | 408 | * Handles all pending events and exits. |
409 | * | 409 | * |
410 | */ | 410 | */ |
411 | static void shpchp_pushbutton_thread(void *data) | 411 | static void shpchp_pushbutton_thread(struct work_struct *work) |
412 | { | 412 | { |
413 | struct pushbutton_work_info *info = data; | 413 | struct pushbutton_work_info *info = |
414 | container_of(work, struct pushbutton_work_info, work); | ||
414 | struct slot *p_slot = info->p_slot; | 415 | struct slot *p_slot = info->p_slot; |
415 | 416 | ||
416 | mutex_lock(&p_slot->lock); | 417 | mutex_lock(&p_slot->lock); |
@@ -436,9 +437,9 @@ static void shpchp_pushbutton_thread(void *data) | |||
436 | kfree(info); | 437 | kfree(info); |
437 | } | 438 | } |
438 | 439 | ||
439 | void queue_pushbutton_work(void *data) | 440 | void queue_pushbutton_work(struct work_struct *work) |
440 | { | 441 | { |
441 | struct slot *p_slot = data; | 442 | struct slot *p_slot = container_of(work, struct slot, work.work); |
442 | struct pushbutton_work_info *info; | 443 | struct pushbutton_work_info *info; |
443 | 444 | ||
444 | info = kmalloc(sizeof(*info), GFP_KERNEL); | 445 | info = kmalloc(sizeof(*info), GFP_KERNEL); |
@@ -447,7 +448,7 @@ void queue_pushbutton_work(void *data) | |||
447 | return; | 448 | return; |
448 | } | 449 | } |
449 | info->p_slot = p_slot; | 450 | info->p_slot = p_slot; |
450 | INIT_WORK(&info->work, shpchp_pushbutton_thread, info); | 451 | INIT_WORK(&info->work, shpchp_pushbutton_thread); |
451 | 452 | ||
452 | mutex_lock(&p_slot->lock); | 453 | mutex_lock(&p_slot->lock); |
453 | switch (p_slot->state) { | 454 | switch (p_slot->state) { |
@@ -541,9 +542,9 @@ static void handle_button_press_event(struct slot *p_slot) | |||
541 | } | 542 | } |
542 | } | 543 | } |
543 | 544 | ||
544 | static void interrupt_event_handler(void *data) | 545 | static void interrupt_event_handler(struct work_struct *work) |
545 | { | 546 | { |
546 | struct event_info *info = data; | 547 | struct event_info *info = container_of(work, struct event_info, work); |
547 | struct slot *p_slot = info->p_slot; | 548 | struct slot *p_slot = info->p_slot; |
548 | 549 | ||
549 | mutex_lock(&p_slot->lock); | 550 | mutex_lock(&p_slot->lock); |
diff --git a/drivers/pci/pcie/aer/aerdrv.c b/drivers/pci/pcie/aer/aerdrv.c index 04c43ef529ac..55866b6b26fa 100644 --- a/drivers/pci/pcie/aer/aerdrv.c +++ b/drivers/pci/pcie/aer/aerdrv.c | |||
@@ -160,7 +160,7 @@ static struct aer_rpc* aer_alloc_rpc(struct pcie_device *dev) | |||
160 | rpc->e_lock = SPIN_LOCK_UNLOCKED; | 160 | rpc->e_lock = SPIN_LOCK_UNLOCKED; |
161 | 161 | ||
162 | rpc->rpd = dev; | 162 | rpc->rpd = dev; |
163 | INIT_WORK(&rpc->dpc_handler, aer_isr, (void *)dev); | 163 | INIT_WORK(&rpc->dpc_handler, aer_isr); |
164 | rpc->prod_idx = rpc->cons_idx = 0; | 164 | rpc->prod_idx = rpc->cons_idx = 0; |
165 | mutex_init(&rpc->rpc_mutex); | 165 | mutex_init(&rpc->rpc_mutex); |
166 | init_waitqueue_head(&rpc->wait_release); | 166 | init_waitqueue_head(&rpc->wait_release); |
diff --git a/drivers/pci/pcie/aer/aerdrv.h b/drivers/pci/pcie/aer/aerdrv.h index daf0cad88fc8..3c0a58f64dd8 100644 --- a/drivers/pci/pcie/aer/aerdrv.h +++ b/drivers/pci/pcie/aer/aerdrv.h | |||
@@ -118,7 +118,7 @@ extern struct bus_type pcie_port_bus_type; | |||
118 | extern void aer_enable_rootport(struct aer_rpc *rpc); | 118 | extern void aer_enable_rootport(struct aer_rpc *rpc); |
119 | extern void aer_delete_rootport(struct aer_rpc *rpc); | 119 | extern void aer_delete_rootport(struct aer_rpc *rpc); |
120 | extern int aer_init(struct pcie_device *dev); | 120 | extern int aer_init(struct pcie_device *dev); |
121 | extern void aer_isr(void *context); | 121 | extern void aer_isr(struct work_struct *work); |
122 | extern void aer_print_error(struct pci_dev *dev, struct aer_err_info *info); | 122 | extern void aer_print_error(struct pci_dev *dev, struct aer_err_info *info); |
123 | extern int aer_osc_setup(struct pci_dev *dev); | 123 | extern int aer_osc_setup(struct pci_dev *dev); |
124 | 124 | ||
diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c index 1c7e660d6535..08e13033ced8 100644 --- a/drivers/pci/pcie/aer/aerdrv_core.c +++ b/drivers/pci/pcie/aer/aerdrv_core.c | |||
@@ -690,14 +690,14 @@ static void aer_isr_one_error(struct pcie_device *p_device, | |||
690 | 690 | ||
691 | /** | 691 | /** |
692 | * aer_isr - consume errors detected by root port | 692 | * aer_isr - consume errors detected by root port |
693 | * @context: pointer to a private data of pcie device | 693 | * @work: definition of this work item |
694 | * | 694 | * |
695 | * Invoked, as DPC, when root port records new detected error | 695 | * Invoked, as DPC, when root port records new detected error |
696 | **/ | 696 | **/ |
697 | void aer_isr(void *context) | 697 | void aer_isr(struct work_struct *work) |
698 | { | 698 | { |
699 | struct pcie_device *p_device = (struct pcie_device *) context; | 699 | struct aer_rpc *rpc = container_of(work, struct aer_rpc, dpc_handler); |
700 | struct aer_rpc *rpc = get_service_data(p_device); | 700 | struct pcie_device *p_device = rpc->rpd; |
701 | struct aer_err_source *e_src; | 701 | struct aer_err_source *e_src; |
702 | 702 | ||
703 | mutex_lock(&rpc->rpc_mutex); | 703 | mutex_lock(&rpc->rpc_mutex); |
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 45df12eda3c5..7355eb455a88 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
@@ -675,9 +675,10 @@ static int pcmcia_card_add(struct pcmcia_socket *s) | |||
675 | } | 675 | } |
676 | 676 | ||
677 | 677 | ||
678 | static void pcmcia_delayed_add_device(void *data) | 678 | static void pcmcia_delayed_add_device(struct work_struct *work) |
679 | { | 679 | { |
680 | struct pcmcia_socket *s = data; | 680 | struct pcmcia_socket *s = |
681 | container_of(work, struct pcmcia_socket, device_add); | ||
681 | ds_dbg(1, "adding additional device to %d\n", s->sock); | 682 | ds_dbg(1, "adding additional device to %d\n", s->sock); |
682 | pcmcia_device_add(s, s->pcmcia_state.mfc_pfc); | 683 | pcmcia_device_add(s, s->pcmcia_state.mfc_pfc); |
683 | s->pcmcia_state.device_add_pending = 0; | 684 | s->pcmcia_state.device_add_pending = 0; |
@@ -1349,7 +1350,7 @@ static int __devinit pcmcia_bus_add_socket(struct class_device *class_dev, | |||
1349 | init_waitqueue_head(&socket->queue); | 1350 | init_waitqueue_head(&socket->queue); |
1350 | #endif | 1351 | #endif |
1351 | INIT_LIST_HEAD(&socket->devices_list); | 1352 | INIT_LIST_HEAD(&socket->devices_list); |
1352 | INIT_WORK(&socket->device_add, pcmcia_delayed_add_device, socket); | 1353 | INIT_WORK(&socket->device_add, pcmcia_delayed_add_device); |
1353 | memset(&socket->pcmcia_state, 0, sizeof(u8)); | 1354 | memset(&socket->pcmcia_state, 0, sizeof(u8)); |
1354 | socket->device_count = 0; | 1355 | socket->device_count = 0; |
1355 | 1356 | ||
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c index 814b9e1873f5..828b329e08e0 100644 --- a/drivers/rtc/rtc-dev.c +++ b/drivers/rtc/rtc-dev.c | |||
@@ -53,9 +53,10 @@ static int rtc_dev_open(struct inode *inode, struct file *file) | |||
53 | * Routine to poll RTC seconds field for change as often as possible, | 53 | * Routine to poll RTC seconds field for change as often as possible, |
54 | * after first RTC_UIE use timer to reduce polling | 54 | * after first RTC_UIE use timer to reduce polling |
55 | */ | 55 | */ |
56 | static void rtc_uie_task(void *data) | 56 | static void rtc_uie_task(struct work_struct *work) |
57 | { | 57 | { |
58 | struct rtc_device *rtc = data; | 58 | struct rtc_device *rtc = |
59 | container_of(work, struct rtc_device, uie_task); | ||
59 | struct rtc_time tm; | 60 | struct rtc_time tm; |
60 | int num = 0; | 61 | int num = 0; |
61 | int err; | 62 | int err; |
@@ -411,7 +412,7 @@ static int rtc_dev_add_device(struct class_device *class_dev, | |||
411 | spin_lock_init(&rtc->irq_lock); | 412 | spin_lock_init(&rtc->irq_lock); |
412 | init_waitqueue_head(&rtc->irq_queue); | 413 | init_waitqueue_head(&rtc->irq_queue); |
413 | #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL | 414 | #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL |
414 | INIT_WORK(&rtc->uie_task, rtc_uie_task, rtc); | 415 | INIT_WORK(&rtc->uie_task, rtc_uie_task); |
415 | setup_timer(&rtc->uie_timer, rtc_uie_timer, (unsigned long)rtc); | 416 | setup_timer(&rtc->uie_timer, rtc_uie_timer, (unsigned long)rtc); |
416 | #endif | 417 | #endif |
417 | 418 | ||
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index a6aa91072880..bb3cb3360541 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c | |||
@@ -849,7 +849,7 @@ static int __devinit NCR5380_init(struct Scsi_Host *instance, int flags) | |||
849 | hostdata->issue_queue = NULL; | 849 | hostdata->issue_queue = NULL; |
850 | hostdata->disconnected_queue = NULL; | 850 | hostdata->disconnected_queue = NULL; |
851 | 851 | ||
852 | INIT_WORK(&hostdata->coroutine, NCR5380_main, hostdata); | 852 | INIT_DELAYED_WORK(&hostdata->coroutine, NCR5380_main); |
853 | 853 | ||
854 | #ifdef NCR5380_STATS | 854 | #ifdef NCR5380_STATS |
855 | for (i = 0; i < 8; ++i) { | 855 | for (i = 0; i < 8; ++i) { |
@@ -1016,7 +1016,7 @@ static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) | |||
1016 | 1016 | ||
1017 | /* Run the coroutine if it isn't already running. */ | 1017 | /* Run the coroutine if it isn't already running. */ |
1018 | /* Kick off command processing */ | 1018 | /* Kick off command processing */ |
1019 | schedule_work(&hostdata->coroutine); | 1019 | schedule_delayed_work(&hostdata->coroutine, 0); |
1020 | return 0; | 1020 | return 0; |
1021 | } | 1021 | } |
1022 | 1022 | ||
@@ -1033,9 +1033,10 @@ static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) | |||
1033 | * host lock and called routines may take the isa dma lock. | 1033 | * host lock and called routines may take the isa dma lock. |
1034 | */ | 1034 | */ |
1035 | 1035 | ||
1036 | static void NCR5380_main(void *p) | 1036 | static void NCR5380_main(struct work_struct *work) |
1037 | { | 1037 | { |
1038 | struct NCR5380_hostdata *hostdata = p; | 1038 | struct NCR5380_hostdata *hostdata = |
1039 | container_of(work, struct NCR5380_hostdata, coroutine.work); | ||
1039 | struct Scsi_Host *instance = hostdata->host; | 1040 | struct Scsi_Host *instance = hostdata->host; |
1040 | Scsi_Cmnd *tmp, *prev; | 1041 | Scsi_Cmnd *tmp, *prev; |
1041 | int done; | 1042 | int done; |
@@ -1221,7 +1222,7 @@ static irqreturn_t NCR5380_intr(int irq, void *dev_id) | |||
1221 | } /* if BASR_IRQ */ | 1222 | } /* if BASR_IRQ */ |
1222 | spin_unlock_irqrestore(instance->host_lock, flags); | 1223 | spin_unlock_irqrestore(instance->host_lock, flags); |
1223 | if(!done) | 1224 | if(!done) |
1224 | schedule_work(&hostdata->coroutine); | 1225 | schedule_delayed_work(&hostdata->coroutine, 0); |
1225 | } while (!done); | 1226 | } while (!done); |
1226 | return IRQ_HANDLED; | 1227 | return IRQ_HANDLED; |
1227 | } | 1228 | } |
diff --git a/drivers/scsi/NCR5380.h b/drivers/scsi/NCR5380.h index 1bc73de496b0..713a108c02ef 100644 --- a/drivers/scsi/NCR5380.h +++ b/drivers/scsi/NCR5380.h | |||
@@ -271,7 +271,7 @@ struct NCR5380_hostdata { | |||
271 | unsigned long time_expires; /* in jiffies, set prior to sleeping */ | 271 | unsigned long time_expires; /* in jiffies, set prior to sleeping */ |
272 | int select_time; /* timer in select for target response */ | 272 | int select_time; /* timer in select for target response */ |
273 | volatile Scsi_Cmnd *selecting; | 273 | volatile Scsi_Cmnd *selecting; |
274 | struct work_struct coroutine; /* our co-routine */ | 274 | struct delayed_work coroutine; /* our co-routine */ |
275 | #ifdef NCR5380_STATS | 275 | #ifdef NCR5380_STATS |
276 | unsigned timebase; /* Base for time calcs */ | 276 | unsigned timebase; /* Base for time calcs */ |
277 | long time_read[8]; /* time to do reads */ | 277 | long time_read[8]; /* time to do reads */ |
@@ -298,7 +298,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance); | |||
298 | #ifndef DONT_USE_INTR | 298 | #ifndef DONT_USE_INTR |
299 | static irqreturn_t NCR5380_intr(int irq, void *dev_id); | 299 | static irqreturn_t NCR5380_intr(int irq, void *dev_id); |
300 | #endif | 300 | #endif |
301 | static void NCR5380_main(void *ptr); | 301 | static void NCR5380_main(struct work_struct *work); |
302 | static void NCR5380_print_options(struct Scsi_Host *instance); | 302 | static void NCR5380_print_options(struct Scsi_Host *instance); |
303 | #ifdef NDEBUG | 303 | #ifdef NDEBUG |
304 | static void NCR5380_print_phase(struct Scsi_Host *instance); | 304 | static void NCR5380_print_phase(struct Scsi_Host *instance); |
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index 306f46b85a55..0cec742d12e9 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c | |||
@@ -1443,7 +1443,7 @@ static struct work_struct aha152x_tq; | |||
1443 | * Run service completions on the card with interrupts enabled. | 1443 | * Run service completions on the card with interrupts enabled. |
1444 | * | 1444 | * |
1445 | */ | 1445 | */ |
1446 | static void run(void) | 1446 | static void run(struct work_struct *work) |
1447 | { | 1447 | { |
1448 | struct aha152x_hostdata *hd; | 1448 | struct aha152x_hostdata *hd; |
1449 | 1449 | ||
@@ -1499,7 +1499,7 @@ static irqreturn_t intr(int irqno, void *dev_id) | |||
1499 | HOSTDATA(shpnt)->service=1; | 1499 | HOSTDATA(shpnt)->service=1; |
1500 | 1500 | ||
1501 | /* Poke the BH handler */ | 1501 | /* Poke the BH handler */ |
1502 | INIT_WORK(&aha152x_tq, (void *) run, NULL); | 1502 | INIT_WORK(&aha152x_tq, run); |
1503 | schedule_work(&aha152x_tq); | 1503 | schedule_work(&aha152x_tq); |
1504 | } | 1504 | } |
1505 | DO_UNLOCK(flags); | 1505 | DO_UNLOCK(flags); |
diff --git a/drivers/scsi/aic94xx/aic94xx_scb.c b/drivers/scsi/aic94xx/aic94xx_scb.c index 14d5d8c2ee13..75ed6b0569d1 100644 --- a/drivers/scsi/aic94xx/aic94xx_scb.c +++ b/drivers/scsi/aic94xx/aic94xx_scb.c | |||
@@ -414,9 +414,10 @@ void asd_invalidate_edb(struct asd_ascb *ascb, int edb_id) | |||
414 | } | 414 | } |
415 | 415 | ||
416 | /* hard reset a phy later */ | 416 | /* hard reset a phy later */ |
417 | static void do_phy_reset_later(void *data) | 417 | static void do_phy_reset_later(struct work_struct *work) |
418 | { | 418 | { |
419 | struct sas_phy *sas_phy = data; | 419 | struct sas_phy *sas_phy = |
420 | container_of(work, struct sas_phy, reset_work); | ||
420 | int error; | 421 | int error; |
421 | 422 | ||
422 | ASD_DPRINTK("%s: About to hard reset phy %d\n", __FUNCTION__, | 423 | ASD_DPRINTK("%s: About to hard reset phy %d\n", __FUNCTION__, |
@@ -430,7 +431,7 @@ static void do_phy_reset_later(void *data) | |||
430 | 431 | ||
431 | static void phy_reset_later(struct sas_phy *sas_phy, struct Scsi_Host *shost) | 432 | static void phy_reset_later(struct sas_phy *sas_phy, struct Scsi_Host *shost) |
432 | { | 433 | { |
433 | INIT_WORK(&sas_phy->reset_work, do_phy_reset_later, sas_phy); | 434 | INIT_WORK(&sas_phy->reset_work, do_phy_reset_later); |
434 | queue_work(shost->work_q, &sas_phy->reset_work); | 435 | queue_work(shost->work_q, &sas_phy->reset_work); |
435 | } | 436 | } |
436 | 437 | ||
@@ -442,7 +443,7 @@ static void task_kill_later(struct asd_ascb *ascb) | |||
442 | struct Scsi_Host *shost = sas_ha->core.shost; | 443 | struct Scsi_Host *shost = sas_ha->core.shost; |
443 | struct sas_task *task = ascb->uldd_task; | 444 | struct sas_task *task = ascb->uldd_task; |
444 | 445 | ||
445 | INIT_WORK(&task->abort_work, (void (*)(void *))sas_task_abort, task); | 446 | INIT_WORK(&task->abort_work, sas_task_abort); |
446 | queue_work(shost->work_q, &task->abort_work); | 447 | queue_work(shost->work_q, &task->abort_work); |
447 | } | 448 | } |
448 | 449 | ||
diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c index e31f6122106f..0464c182c577 100644 --- a/drivers/scsi/imm.c +++ b/drivers/scsi/imm.c | |||
@@ -36,7 +36,7 @@ typedef struct { | |||
36 | int base_hi; /* Hi Base address for ECP-ISA chipset */ | 36 | int base_hi; /* Hi Base address for ECP-ISA chipset */ |
37 | int mode; /* Transfer mode */ | 37 | int mode; /* Transfer mode */ |
38 | struct scsi_cmnd *cur_cmd; /* Current queued command */ | 38 | struct scsi_cmnd *cur_cmd; /* Current queued command */ |
39 | struct work_struct imm_tq; /* Polling interrupt stuff */ | 39 | struct delayed_work imm_tq; /* Polling interrupt stuff */ |
40 | unsigned long jstart; /* Jiffies at start */ | 40 | unsigned long jstart; /* Jiffies at start */ |
41 | unsigned failed:1; /* Failure flag */ | 41 | unsigned failed:1; /* Failure flag */ |
42 | unsigned dp:1; /* Data phase present */ | 42 | unsigned dp:1; /* Data phase present */ |
@@ -733,9 +733,9 @@ static int imm_completion(struct scsi_cmnd *cmd) | |||
733 | * the scheduler's task queue to generate a stream of call-backs and | 733 | * the scheduler's task queue to generate a stream of call-backs and |
734 | * complete the request when the drive is ready. | 734 | * complete the request when the drive is ready. |
735 | */ | 735 | */ |
736 | static void imm_interrupt(void *data) | 736 | static void imm_interrupt(struct work_struct *work) |
737 | { | 737 | { |
738 | imm_struct *dev = (imm_struct *) data; | 738 | imm_struct *dev = container_of(work, imm_struct, imm_tq.work); |
739 | struct scsi_cmnd *cmd = dev->cur_cmd; | 739 | struct scsi_cmnd *cmd = dev->cur_cmd; |
740 | struct Scsi_Host *host = cmd->device->host; | 740 | struct Scsi_Host *host = cmd->device->host; |
741 | unsigned long flags; | 741 | unsigned long flags; |
@@ -745,7 +745,6 @@ static void imm_interrupt(void *data) | |||
745 | return; | 745 | return; |
746 | } | 746 | } |
747 | if (imm_engine(dev, cmd)) { | 747 | if (imm_engine(dev, cmd)) { |
748 | INIT_WORK(&dev->imm_tq, imm_interrupt, (void *) dev); | ||
749 | schedule_delayed_work(&dev->imm_tq, 1); | 748 | schedule_delayed_work(&dev->imm_tq, 1); |
750 | return; | 749 | return; |
751 | } | 750 | } |
@@ -953,8 +952,7 @@ static int imm_queuecommand(struct scsi_cmnd *cmd, | |||
953 | cmd->result = DID_ERROR << 16; /* default return code */ | 952 | cmd->result = DID_ERROR << 16; /* default return code */ |
954 | cmd->SCp.phase = 0; /* bus free */ | 953 | cmd->SCp.phase = 0; /* bus free */ |
955 | 954 | ||
956 | INIT_WORK(&dev->imm_tq, imm_interrupt, dev); | 955 | schedule_delayed_work(&dev->imm_tq, 0); |
957 | schedule_work(&dev->imm_tq); | ||
958 | 956 | ||
959 | imm_pb_claim(dev); | 957 | imm_pb_claim(dev); |
960 | 958 | ||
@@ -1225,7 +1223,7 @@ static int __imm_attach(struct parport *pb) | |||
1225 | else | 1223 | else |
1226 | ports = 8; | 1224 | ports = 8; |
1227 | 1225 | ||
1228 | INIT_WORK(&dev->imm_tq, imm_interrupt, dev); | 1226 | INIT_DELAYED_WORK(&dev->imm_tq, imm_interrupt); |
1229 | 1227 | ||
1230 | err = -ENOMEM; | 1228 | err = -ENOMEM; |
1231 | host = scsi_host_alloc(&imm_template, sizeof(imm_struct *)); | 1229 | host = scsi_host_alloc(&imm_template, sizeof(imm_struct *)); |
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 2d83fbb806a5..ccd4dafce8e2 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -2307,7 +2307,7 @@ static void ipr_release_dump(struct kref *kref) | |||
2307 | 2307 | ||
2308 | /** | 2308 | /** |
2309 | * ipr_worker_thread - Worker thread | 2309 | * ipr_worker_thread - Worker thread |
2310 | * @data: ioa config struct | 2310 | * @work: ioa config struct |
2311 | * | 2311 | * |
2312 | * Called at task level from a work thread. This function takes care | 2312 | * Called at task level from a work thread. This function takes care |
2313 | * of adding and removing device from the mid-layer as configuration | 2313 | * of adding and removing device from the mid-layer as configuration |
@@ -2316,13 +2316,14 @@ static void ipr_release_dump(struct kref *kref) | |||
2316 | * Return value: | 2316 | * Return value: |
2317 | * nothing | 2317 | * nothing |
2318 | **/ | 2318 | **/ |
2319 | static void ipr_worker_thread(void *data) | 2319 | static void ipr_worker_thread(struct work_struct *work) |
2320 | { | 2320 | { |
2321 | unsigned long lock_flags; | 2321 | unsigned long lock_flags; |
2322 | struct ipr_resource_entry *res; | 2322 | struct ipr_resource_entry *res; |
2323 | struct scsi_device *sdev; | 2323 | struct scsi_device *sdev; |
2324 | struct ipr_dump *dump; | 2324 | struct ipr_dump *dump; |
2325 | struct ipr_ioa_cfg *ioa_cfg = data; | 2325 | struct ipr_ioa_cfg *ioa_cfg = |
2326 | container_of(work, struct ipr_ioa_cfg, work_q); | ||
2326 | u8 bus, target, lun; | 2327 | u8 bus, target, lun; |
2327 | int did_work; | 2328 | int did_work; |
2328 | 2329 | ||
@@ -7121,7 +7122,7 @@ static void __devinit ipr_init_ioa_cfg(struct ipr_ioa_cfg *ioa_cfg, | |||
7121 | INIT_LIST_HEAD(&ioa_cfg->hostrcb_pending_q); | 7122 | INIT_LIST_HEAD(&ioa_cfg->hostrcb_pending_q); |
7122 | INIT_LIST_HEAD(&ioa_cfg->free_res_q); | 7123 | INIT_LIST_HEAD(&ioa_cfg->free_res_q); |
7123 | INIT_LIST_HEAD(&ioa_cfg->used_res_q); | 7124 | INIT_LIST_HEAD(&ioa_cfg->used_res_q); |
7124 | INIT_WORK(&ioa_cfg->work_q, ipr_worker_thread, ioa_cfg); | 7125 | INIT_WORK(&ioa_cfg->work_q, ipr_worker_thread); |
7125 | init_waitqueue_head(&ioa_cfg->reset_wait_q); | 7126 | init_waitqueue_head(&ioa_cfg->reset_wait_q); |
7126 | ioa_cfg->sdt_state = INACTIVE; | 7127 | ioa_cfg->sdt_state = INACTIVE; |
7127 | if (ipr_enable_cache) | 7128 | if (ipr_enable_cache) |
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 5d8862189485..e11b23c641e2 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c | |||
@@ -719,9 +719,10 @@ again: | |||
719 | return rc; | 719 | return rc; |
720 | } | 720 | } |
721 | 721 | ||
722 | static void iscsi_xmitworker(void *data) | 722 | static void iscsi_xmitworker(struct work_struct *work) |
723 | { | 723 | { |
724 | struct iscsi_conn *conn = data; | 724 | struct iscsi_conn *conn = |
725 | container_of(work, struct iscsi_conn, xmitwork); | ||
725 | int rc; | 726 | int rc; |
726 | /* | 727 | /* |
727 | * serialize Xmit worker on a per-connection basis. | 728 | * serialize Xmit worker on a per-connection basis. |
@@ -1512,7 +1513,7 @@ iscsi_conn_setup(struct iscsi_cls_session *cls_session, uint32_t conn_idx) | |||
1512 | if (conn->mgmtqueue == ERR_PTR(-ENOMEM)) | 1513 | if (conn->mgmtqueue == ERR_PTR(-ENOMEM)) |
1513 | goto mgmtqueue_alloc_fail; | 1514 | goto mgmtqueue_alloc_fail; |
1514 | 1515 | ||
1515 | INIT_WORK(&conn->xmitwork, iscsi_xmitworker, conn); | 1516 | INIT_WORK(&conn->xmitwork, iscsi_xmitworker); |
1516 | 1517 | ||
1517 | /* allocate login_mtask used for the login/text sequences */ | 1518 | /* allocate login_mtask used for the login/text sequences */ |
1518 | spin_lock_bh(&session->lock); | 1519 | spin_lock_bh(&session->lock); |
diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c index d977bd492d8d..fb7df7b75811 100644 --- a/drivers/scsi/libsas/sas_discover.c +++ b/drivers/scsi/libsas/sas_discover.c | |||
@@ -647,10 +647,12 @@ void sas_unregister_domain_devices(struct asd_sas_port *port) | |||
647 | * Discover process only interrogates devices in order to discover the | 647 | * Discover process only interrogates devices in order to discover the |
648 | * domain. | 648 | * domain. |
649 | */ | 649 | */ |
650 | static void sas_discover_domain(void *data) | 650 | static void sas_discover_domain(struct work_struct *work) |
651 | { | 651 | { |
652 | int error = 0; | 652 | int error = 0; |
653 | struct asd_sas_port *port = data; | 653 | struct sas_discovery_event *ev = |
654 | container_of(work, struct sas_discovery_event, work); | ||
655 | struct asd_sas_port *port = ev->port; | ||
654 | 656 | ||
655 | sas_begin_event(DISCE_DISCOVER_DOMAIN, &port->disc.disc_event_lock, | 657 | sas_begin_event(DISCE_DISCOVER_DOMAIN, &port->disc.disc_event_lock, |
656 | &port->disc.pending); | 658 | &port->disc.pending); |
@@ -692,10 +694,12 @@ static void sas_discover_domain(void *data) | |||
692 | current->pid, error); | 694 | current->pid, error); |
693 | } | 695 | } |
694 | 696 | ||
695 | static void sas_revalidate_domain(void *data) | 697 | static void sas_revalidate_domain(struct work_struct *work) |
696 | { | 698 | { |
697 | int res = 0; | 699 | int res = 0; |
698 | struct asd_sas_port *port = data; | 700 | struct sas_discovery_event *ev = |
701 | container_of(work, struct sas_discovery_event, work); | ||
702 | struct asd_sas_port *port = ev->port; | ||
699 | 703 | ||
700 | sas_begin_event(DISCE_REVALIDATE_DOMAIN, &port->disc.disc_event_lock, | 704 | sas_begin_event(DISCE_REVALIDATE_DOMAIN, &port->disc.disc_event_lock, |
701 | &port->disc.pending); | 705 | &port->disc.pending); |
@@ -722,7 +726,7 @@ int sas_discover_event(struct asd_sas_port *port, enum discover_event ev) | |||
722 | BUG_ON(ev >= DISC_NUM_EVENTS); | 726 | BUG_ON(ev >= DISC_NUM_EVENTS); |
723 | 727 | ||
724 | sas_queue_event(ev, &disc->disc_event_lock, &disc->pending, | 728 | sas_queue_event(ev, &disc->disc_event_lock, &disc->pending, |
725 | &disc->disc_work[ev], port->ha->core.shost); | 729 | &disc->disc_work[ev].work, port->ha->core.shost); |
726 | 730 | ||
727 | return 0; | 731 | return 0; |
728 | } | 732 | } |
@@ -737,13 +741,15 @@ void sas_init_disc(struct sas_discovery *disc, struct asd_sas_port *port) | |||
737 | { | 741 | { |
738 | int i; | 742 | int i; |
739 | 743 | ||
740 | static void (*sas_event_fns[DISC_NUM_EVENTS])(void *) = { | 744 | static const work_func_t sas_event_fns[DISC_NUM_EVENTS] = { |
741 | [DISCE_DISCOVER_DOMAIN] = sas_discover_domain, | 745 | [DISCE_DISCOVER_DOMAIN] = sas_discover_domain, |
742 | [DISCE_REVALIDATE_DOMAIN] = sas_revalidate_domain, | 746 | [DISCE_REVALIDATE_DOMAIN] = sas_revalidate_domain, |
743 | }; | 747 | }; |
744 | 748 | ||
745 | spin_lock_init(&disc->disc_event_lock); | 749 | spin_lock_init(&disc->disc_event_lock); |
746 | disc->pending = 0; | 750 | disc->pending = 0; |
747 | for (i = 0; i < DISC_NUM_EVENTS; i++) | 751 | for (i = 0; i < DISC_NUM_EVENTS; i++) { |
748 | INIT_WORK(&disc->disc_work[i], sas_event_fns[i], port); | 752 | INIT_WORK(&disc->disc_work[i].work, sas_event_fns[i]); |
753 | disc->disc_work[i].port = port; | ||
754 | } | ||
749 | } | 755 | } |
diff --git a/drivers/scsi/libsas/sas_event.c b/drivers/scsi/libsas/sas_event.c index 19110ed1c89c..d83392ee6823 100644 --- a/drivers/scsi/libsas/sas_event.c +++ b/drivers/scsi/libsas/sas_event.c | |||
@@ -31,7 +31,7 @@ static void notify_ha_event(struct sas_ha_struct *sas_ha, enum ha_event event) | |||
31 | BUG_ON(event >= HA_NUM_EVENTS); | 31 | BUG_ON(event >= HA_NUM_EVENTS); |
32 | 32 | ||
33 | sas_queue_event(event, &sas_ha->event_lock, &sas_ha->pending, | 33 | sas_queue_event(event, &sas_ha->event_lock, &sas_ha->pending, |
34 | &sas_ha->ha_events[event], sas_ha->core.shost); | 34 | &sas_ha->ha_events[event].work, sas_ha->core.shost); |
35 | } | 35 | } |
36 | 36 | ||
37 | static void notify_port_event(struct asd_sas_phy *phy, enum port_event event) | 37 | static void notify_port_event(struct asd_sas_phy *phy, enum port_event event) |
@@ -41,7 +41,7 @@ static void notify_port_event(struct asd_sas_phy *phy, enum port_event event) | |||
41 | BUG_ON(event >= PORT_NUM_EVENTS); | 41 | BUG_ON(event >= PORT_NUM_EVENTS); |
42 | 42 | ||
43 | sas_queue_event(event, &ha->event_lock, &phy->port_events_pending, | 43 | sas_queue_event(event, &ha->event_lock, &phy->port_events_pending, |
44 | &phy->port_events[event], ha->core.shost); | 44 | &phy->port_events[event].work, ha->core.shost); |
45 | } | 45 | } |
46 | 46 | ||
47 | static void notify_phy_event(struct asd_sas_phy *phy, enum phy_event event) | 47 | static void notify_phy_event(struct asd_sas_phy *phy, enum phy_event event) |
@@ -51,12 +51,12 @@ static void notify_phy_event(struct asd_sas_phy *phy, enum phy_event event) | |||
51 | BUG_ON(event >= PHY_NUM_EVENTS); | 51 | BUG_ON(event >= PHY_NUM_EVENTS); |
52 | 52 | ||
53 | sas_queue_event(event, &ha->event_lock, &phy->phy_events_pending, | 53 | sas_queue_event(event, &ha->event_lock, &phy->phy_events_pending, |
54 | &phy->phy_events[event], ha->core.shost); | 54 | &phy->phy_events[event].work, ha->core.shost); |
55 | } | 55 | } |
56 | 56 | ||
57 | int sas_init_events(struct sas_ha_struct *sas_ha) | 57 | int sas_init_events(struct sas_ha_struct *sas_ha) |
58 | { | 58 | { |
59 | static void (*sas_ha_event_fns[HA_NUM_EVENTS])(void *) = { | 59 | static const work_func_t sas_ha_event_fns[HA_NUM_EVENTS] = { |
60 | [HAE_RESET] = sas_hae_reset, | 60 | [HAE_RESET] = sas_hae_reset, |
61 | }; | 61 | }; |
62 | 62 | ||
@@ -64,8 +64,10 @@ int sas_init_events(struct sas_ha_struct *sas_ha) | |||
64 | 64 | ||
65 | spin_lock_init(&sas_ha->event_lock); | 65 | spin_lock_init(&sas_ha->event_lock); |
66 | 66 | ||
67 | for (i = 0; i < HA_NUM_EVENTS; i++) | 67 | for (i = 0; i < HA_NUM_EVENTS; i++) { |
68 | INIT_WORK(&sas_ha->ha_events[i], sas_ha_event_fns[i], sas_ha); | 68 | INIT_WORK(&sas_ha->ha_events[i].work, sas_ha_event_fns[i]); |
69 | sas_ha->ha_events[i].ha = sas_ha; | ||
70 | } | ||
69 | 71 | ||
70 | sas_ha->notify_ha_event = notify_ha_event; | 72 | sas_ha->notify_ha_event = notify_ha_event; |
71 | sas_ha->notify_port_event = notify_port_event; | 73 | sas_ha->notify_port_event = notify_port_event; |
diff --git a/drivers/scsi/libsas/sas_init.c b/drivers/scsi/libsas/sas_init.c index 0fb347b4b1a2..d65bc4e0f214 100644 --- a/drivers/scsi/libsas/sas_init.c +++ b/drivers/scsi/libsas/sas_init.c | |||
@@ -65,9 +65,11 @@ void sas_hash_addr(u8 *hashed, const u8 *sas_addr) | |||
65 | 65 | ||
66 | /* ---------- HA events ---------- */ | 66 | /* ---------- HA events ---------- */ |
67 | 67 | ||
68 | void sas_hae_reset(void *data) | 68 | void sas_hae_reset(struct work_struct *work) |
69 | { | 69 | { |
70 | struct sas_ha_struct *ha = data; | 70 | struct sas_ha_event *ev = |
71 | container_of(work, struct sas_ha_event, work); | ||
72 | struct sas_ha_struct *ha = ev->ha; | ||
71 | 73 | ||
72 | sas_begin_event(HAE_RESET, &ha->event_lock, | 74 | sas_begin_event(HAE_RESET, &ha->event_lock, |
73 | &ha->pending); | 75 | &ha->pending); |
diff --git a/drivers/scsi/libsas/sas_internal.h b/drivers/scsi/libsas/sas_internal.h index bffcee474921..137d7e496b6d 100644 --- a/drivers/scsi/libsas/sas_internal.h +++ b/drivers/scsi/libsas/sas_internal.h | |||
@@ -60,11 +60,11 @@ void sas_shutdown_queue(struct sas_ha_struct *sas_ha); | |||
60 | 60 | ||
61 | void sas_deform_port(struct asd_sas_phy *phy); | 61 | void sas_deform_port(struct asd_sas_phy *phy); |
62 | 62 | ||
63 | void sas_porte_bytes_dmaed(void *); | 63 | void sas_porte_bytes_dmaed(struct work_struct *work); |
64 | void sas_porte_broadcast_rcvd(void *); | 64 | void sas_porte_broadcast_rcvd(struct work_struct *work); |
65 | void sas_porte_link_reset_err(void *); | 65 | void sas_porte_link_reset_err(struct work_struct *work); |
66 | void sas_porte_timer_event(void *); | 66 | void sas_porte_timer_event(struct work_struct *work); |
67 | void sas_porte_hard_reset(void *); | 67 | void sas_porte_hard_reset(struct work_struct *work); |
68 | 68 | ||
69 | int sas_notify_lldd_dev_found(struct domain_device *); | 69 | int sas_notify_lldd_dev_found(struct domain_device *); |
70 | void sas_notify_lldd_dev_gone(struct domain_device *); | 70 | void sas_notify_lldd_dev_gone(struct domain_device *); |
@@ -75,7 +75,7 @@ int sas_smp_get_phy_events(struct sas_phy *phy); | |||
75 | 75 | ||
76 | struct domain_device *sas_find_dev_by_rphy(struct sas_rphy *rphy); | 76 | struct domain_device *sas_find_dev_by_rphy(struct sas_rphy *rphy); |
77 | 77 | ||
78 | void sas_hae_reset(void *); | 78 | void sas_hae_reset(struct work_struct *work); |
79 | 79 | ||
80 | static inline void sas_queue_event(int event, spinlock_t *lock, | 80 | static inline void sas_queue_event(int event, spinlock_t *lock, |
81 | unsigned long *pending, | 81 | unsigned long *pending, |
diff --git a/drivers/scsi/libsas/sas_phy.c b/drivers/scsi/libsas/sas_phy.c index 9340cdbae4a3..b459c4b635b1 100644 --- a/drivers/scsi/libsas/sas_phy.c +++ b/drivers/scsi/libsas/sas_phy.c | |||
@@ -30,9 +30,11 @@ | |||
30 | 30 | ||
31 | /* ---------- Phy events ---------- */ | 31 | /* ---------- Phy events ---------- */ |
32 | 32 | ||
33 | static void sas_phye_loss_of_signal(void *data) | 33 | static void sas_phye_loss_of_signal(struct work_struct *work) |
34 | { | 34 | { |
35 | struct asd_sas_phy *phy = data; | 35 | struct asd_sas_event *ev = |
36 | container_of(work, struct asd_sas_event, work); | ||
37 | struct asd_sas_phy *phy = ev->phy; | ||
36 | 38 | ||
37 | sas_begin_event(PHYE_LOSS_OF_SIGNAL, &phy->ha->event_lock, | 39 | sas_begin_event(PHYE_LOSS_OF_SIGNAL, &phy->ha->event_lock, |
38 | &phy->phy_events_pending); | 40 | &phy->phy_events_pending); |
@@ -40,18 +42,22 @@ static void sas_phye_loss_of_signal(void *data) | |||
40 | sas_deform_port(phy); | 42 | sas_deform_port(phy); |
41 | } | 43 | } |
42 | 44 | ||
43 | static void sas_phye_oob_done(void *data) | 45 | static void sas_phye_oob_done(struct work_struct *work) |
44 | { | 46 | { |
45 | struct asd_sas_phy *phy = data; | 47 | struct asd_sas_event *ev = |
48 | container_of(work, struct asd_sas_event, work); | ||
49 | struct asd_sas_phy *phy = ev->phy; | ||
46 | 50 | ||
47 | sas_begin_event(PHYE_OOB_DONE, &phy->ha->event_lock, | 51 | sas_begin_event(PHYE_OOB_DONE, &phy->ha->event_lock, |
48 | &phy->phy_events_pending); | 52 | &phy->phy_events_pending); |
49 | phy->error = 0; | 53 | phy->error = 0; |
50 | } | 54 | } |
51 | 55 | ||
52 | static void sas_phye_oob_error(void *data) | 56 | static void sas_phye_oob_error(struct work_struct *work) |
53 | { | 57 | { |
54 | struct asd_sas_phy *phy = data; | 58 | struct asd_sas_event *ev = |
59 | container_of(work, struct asd_sas_event, work); | ||
60 | struct asd_sas_phy *phy = ev->phy; | ||
55 | struct sas_ha_struct *sas_ha = phy->ha; | 61 | struct sas_ha_struct *sas_ha = phy->ha; |
56 | struct asd_sas_port *port = phy->port; | 62 | struct asd_sas_port *port = phy->port; |
57 | struct sas_internal *i = | 63 | struct sas_internal *i = |
@@ -80,9 +86,11 @@ static void sas_phye_oob_error(void *data) | |||
80 | } | 86 | } |
81 | } | 87 | } |
82 | 88 | ||
83 | static void sas_phye_spinup_hold(void *data) | 89 | static void sas_phye_spinup_hold(struct work_struct *work) |
84 | { | 90 | { |
85 | struct asd_sas_phy *phy = data; | 91 | struct asd_sas_event *ev = |
92 | container_of(work, struct asd_sas_event, work); | ||
93 | struct asd_sas_phy *phy = ev->phy; | ||
86 | struct sas_ha_struct *sas_ha = phy->ha; | 94 | struct sas_ha_struct *sas_ha = phy->ha; |
87 | struct sas_internal *i = | 95 | struct sas_internal *i = |
88 | to_sas_internal(sas_ha->core.shost->transportt); | 96 | to_sas_internal(sas_ha->core.shost->transportt); |
@@ -100,14 +108,14 @@ int sas_register_phys(struct sas_ha_struct *sas_ha) | |||
100 | { | 108 | { |
101 | int i; | 109 | int i; |
102 | 110 | ||
103 | static void (*sas_phy_event_fns[PHY_NUM_EVENTS])(void *) = { | 111 | static const work_func_t sas_phy_event_fns[PHY_NUM_EVENTS] = { |
104 | [PHYE_LOSS_OF_SIGNAL] = sas_phye_loss_of_signal, | 112 | [PHYE_LOSS_OF_SIGNAL] = sas_phye_loss_of_signal, |
105 | [PHYE_OOB_DONE] = sas_phye_oob_done, | 113 | [PHYE_OOB_DONE] = sas_phye_oob_done, |
106 | [PHYE_OOB_ERROR] = sas_phye_oob_error, | 114 | [PHYE_OOB_ERROR] = sas_phye_oob_error, |
107 | [PHYE_SPINUP_HOLD] = sas_phye_spinup_hold, | 115 | [PHYE_SPINUP_HOLD] = sas_phye_spinup_hold, |
108 | }; | 116 | }; |
109 | 117 | ||
110 | static void (*sas_port_event_fns[PORT_NUM_EVENTS])(void *) = { | 118 | static const work_func_t sas_port_event_fns[PORT_NUM_EVENTS] = { |
111 | [PORTE_BYTES_DMAED] = sas_porte_bytes_dmaed, | 119 | [PORTE_BYTES_DMAED] = sas_porte_bytes_dmaed, |
112 | [PORTE_BROADCAST_RCVD] = sas_porte_broadcast_rcvd, | 120 | [PORTE_BROADCAST_RCVD] = sas_porte_broadcast_rcvd, |
113 | [PORTE_LINK_RESET_ERR] = sas_porte_link_reset_err, | 121 | [PORTE_LINK_RESET_ERR] = sas_porte_link_reset_err, |
@@ -122,13 +130,18 @@ int sas_register_phys(struct sas_ha_struct *sas_ha) | |||
122 | 130 | ||
123 | phy->error = 0; | 131 | phy->error = 0; |
124 | INIT_LIST_HEAD(&phy->port_phy_el); | 132 | INIT_LIST_HEAD(&phy->port_phy_el); |
125 | for (k = 0; k < PORT_NUM_EVENTS; k++) | 133 | for (k = 0; k < PORT_NUM_EVENTS; k++) { |
126 | INIT_WORK(&phy->port_events[k], sas_port_event_fns[k], | 134 | INIT_WORK(&phy->port_events[k].work, |
127 | phy); | 135 | sas_port_event_fns[k]); |
136 | phy->port_events[k].phy = phy; | ||
137 | } | ||
138 | |||
139 | for (k = 0; k < PHY_NUM_EVENTS; k++) { | ||
140 | INIT_WORK(&phy->phy_events[k].work, | ||
141 | sas_phy_event_fns[k]); | ||
142 | phy->phy_events[k].phy = phy; | ||
143 | } | ||
128 | 144 | ||
129 | for (k = 0; k < PHY_NUM_EVENTS; k++) | ||
130 | INIT_WORK(&phy->phy_events[k], sas_phy_event_fns[k], | ||
131 | phy); | ||
132 | phy->port = NULL; | 145 | phy->port = NULL; |
133 | phy->ha = sas_ha; | 146 | phy->ha = sas_ha; |
134 | spin_lock_init(&phy->frame_rcvd_lock); | 147 | spin_lock_init(&phy->frame_rcvd_lock); |
diff --git a/drivers/scsi/libsas/sas_port.c b/drivers/scsi/libsas/sas_port.c index 253cdcf306a2..971c37ceecb4 100644 --- a/drivers/scsi/libsas/sas_port.c +++ b/drivers/scsi/libsas/sas_port.c | |||
@@ -181,9 +181,11 @@ void sas_deform_port(struct asd_sas_phy *phy) | |||
181 | 181 | ||
182 | /* ---------- SAS port events ---------- */ | 182 | /* ---------- SAS port events ---------- */ |
183 | 183 | ||
184 | void sas_porte_bytes_dmaed(void *data) | 184 | void sas_porte_bytes_dmaed(struct work_struct *work) |
185 | { | 185 | { |
186 | struct asd_sas_phy *phy = data; | 186 | struct asd_sas_event *ev = |
187 | container_of(work, struct asd_sas_event, work); | ||
188 | struct asd_sas_phy *phy = ev->phy; | ||
187 | 189 | ||
188 | sas_begin_event(PORTE_BYTES_DMAED, &phy->ha->event_lock, | 190 | sas_begin_event(PORTE_BYTES_DMAED, &phy->ha->event_lock, |
189 | &phy->port_events_pending); | 191 | &phy->port_events_pending); |
@@ -191,11 +193,13 @@ void sas_porte_bytes_dmaed(void *data) | |||
191 | sas_form_port(phy); | 193 | sas_form_port(phy); |
192 | } | 194 | } |
193 | 195 | ||
194 | void sas_porte_broadcast_rcvd(void *data) | 196 | void sas_porte_broadcast_rcvd(struct work_struct *work) |
195 | { | 197 | { |
198 | struct asd_sas_event *ev = | ||
199 | container_of(work, struct asd_sas_event, work); | ||
200 | struct asd_sas_phy *phy = ev->phy; | ||
196 | unsigned long flags; | 201 | unsigned long flags; |
197 | u32 prim; | 202 | u32 prim; |
198 | struct asd_sas_phy *phy = data; | ||
199 | 203 | ||
200 | sas_begin_event(PORTE_BROADCAST_RCVD, &phy->ha->event_lock, | 204 | sas_begin_event(PORTE_BROADCAST_RCVD, &phy->ha->event_lock, |
201 | &phy->port_events_pending); | 205 | &phy->port_events_pending); |
@@ -208,9 +212,11 @@ void sas_porte_broadcast_rcvd(void *data) | |||
208 | sas_discover_event(phy->port, DISCE_REVALIDATE_DOMAIN); | 212 | sas_discover_event(phy->port, DISCE_REVALIDATE_DOMAIN); |
209 | } | 213 | } |
210 | 214 | ||
211 | void sas_porte_link_reset_err(void *data) | 215 | void sas_porte_link_reset_err(struct work_struct *work) |
212 | { | 216 | { |
213 | struct asd_sas_phy *phy = data; | 217 | struct asd_sas_event *ev = |
218 | container_of(work, struct asd_sas_event, work); | ||
219 | struct asd_sas_phy *phy = ev->phy; | ||
214 | 220 | ||
215 | sas_begin_event(PORTE_LINK_RESET_ERR, &phy->ha->event_lock, | 221 | sas_begin_event(PORTE_LINK_RESET_ERR, &phy->ha->event_lock, |
216 | &phy->port_events_pending); | 222 | &phy->port_events_pending); |
@@ -218,9 +224,11 @@ void sas_porte_link_reset_err(void *data) | |||
218 | sas_deform_port(phy); | 224 | sas_deform_port(phy); |
219 | } | 225 | } |
220 | 226 | ||
221 | void sas_porte_timer_event(void *data) | 227 | void sas_porte_timer_event(struct work_struct *work) |
222 | { | 228 | { |
223 | struct asd_sas_phy *phy = data; | 229 | struct asd_sas_event *ev = |
230 | container_of(work, struct asd_sas_event, work); | ||
231 | struct asd_sas_phy *phy = ev->phy; | ||
224 | 232 | ||
225 | sas_begin_event(PORTE_TIMER_EVENT, &phy->ha->event_lock, | 233 | sas_begin_event(PORTE_TIMER_EVENT, &phy->ha->event_lock, |
226 | &phy->port_events_pending); | 234 | &phy->port_events_pending); |
@@ -228,9 +236,11 @@ void sas_porte_timer_event(void *data) | |||
228 | sas_deform_port(phy); | 236 | sas_deform_port(phy); |
229 | } | 237 | } |
230 | 238 | ||
231 | void sas_porte_hard_reset(void *data) | 239 | void sas_porte_hard_reset(struct work_struct *work) |
232 | { | 240 | { |
233 | struct asd_sas_phy *phy = data; | 241 | struct asd_sas_event *ev = |
242 | container_of(work, struct asd_sas_event, work); | ||
243 | struct asd_sas_phy *phy = ev->phy; | ||
234 | 244 | ||
235 | sas_begin_event(PORTE_HARD_RESET, &phy->ha->event_lock, | 245 | sas_begin_event(PORTE_HARD_RESET, &phy->ha->event_lock, |
236 | &phy->port_events_pending); | 246 | &phy->port_events_pending); |
diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index e064aac06b90..22672d54aa27 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c | |||
@@ -846,8 +846,10 @@ static int do_sas_task_abort(struct sas_task *task) | |||
846 | return -EAGAIN; | 846 | return -EAGAIN; |
847 | } | 847 | } |
848 | 848 | ||
849 | void sas_task_abort(struct sas_task *task) | 849 | void sas_task_abort(struct work_struct *work) |
850 | { | 850 | { |
851 | struct sas_task *task = | ||
852 | container_of(work, struct sas_task, abort_work); | ||
851 | int i; | 853 | int i; |
852 | 854 | ||
853 | for (i = 0; i < 5; i++) | 855 | for (i = 0; i < 5; i++) |
diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c index 89a2a9f11e41..584ba4d6e038 100644 --- a/drivers/scsi/ppa.c +++ b/drivers/scsi/ppa.c | |||
@@ -31,7 +31,7 @@ typedef struct { | |||
31 | int base; /* Actual port address */ | 31 | int base; /* Actual port address */ |
32 | int mode; /* Transfer mode */ | 32 | int mode; /* Transfer mode */ |
33 | struct scsi_cmnd *cur_cmd; /* Current queued command */ | 33 | struct scsi_cmnd *cur_cmd; /* Current queued command */ |
34 | struct work_struct ppa_tq; /* Polling interrupt stuff */ | 34 | struct delayed_work ppa_tq; /* Polling interrupt stuff */ |
35 | unsigned long jstart; /* Jiffies at start */ | 35 | unsigned long jstart; /* Jiffies at start */ |
36 | unsigned long recon_tmo; /* How many usecs to wait for reconnection (6th bit) */ | 36 | unsigned long recon_tmo; /* How many usecs to wait for reconnection (6th bit) */ |
37 | unsigned int failed:1; /* Failure flag */ | 37 | unsigned int failed:1; /* Failure flag */ |
@@ -627,9 +627,9 @@ static int ppa_completion(struct scsi_cmnd *cmd) | |||
627 | * the scheduler's task queue to generate a stream of call-backs and | 627 | * the scheduler's task queue to generate a stream of call-backs and |
628 | * complete the request when the drive is ready. | 628 | * complete the request when the drive is ready. |
629 | */ | 629 | */ |
630 | static void ppa_interrupt(void *data) | 630 | static void ppa_interrupt(struct work_struct *work) |
631 | { | 631 | { |
632 | ppa_struct *dev = (ppa_struct *) data; | 632 | ppa_struct *dev = container_of(work, ppa_struct, ppa_tq.work); |
633 | struct scsi_cmnd *cmd = dev->cur_cmd; | 633 | struct scsi_cmnd *cmd = dev->cur_cmd; |
634 | 634 | ||
635 | if (!cmd) { | 635 | if (!cmd) { |
@@ -637,7 +637,6 @@ static void ppa_interrupt(void *data) | |||
637 | return; | 637 | return; |
638 | } | 638 | } |
639 | if (ppa_engine(dev, cmd)) { | 639 | if (ppa_engine(dev, cmd)) { |
640 | dev->ppa_tq.data = (void *) dev; | ||
641 | schedule_delayed_work(&dev->ppa_tq, 1); | 640 | schedule_delayed_work(&dev->ppa_tq, 1); |
642 | return; | 641 | return; |
643 | } | 642 | } |
@@ -822,8 +821,7 @@ static int ppa_queuecommand(struct scsi_cmnd *cmd, | |||
822 | cmd->result = DID_ERROR << 16; /* default return code */ | 821 | cmd->result = DID_ERROR << 16; /* default return code */ |
823 | cmd->SCp.phase = 0; /* bus free */ | 822 | cmd->SCp.phase = 0; /* bus free */ |
824 | 823 | ||
825 | dev->ppa_tq.data = dev; | 824 | schedule_delayed_work(&dev->ppa_tq, 0); |
826 | schedule_work(&dev->ppa_tq); | ||
827 | 825 | ||
828 | ppa_pb_claim(dev); | 826 | ppa_pb_claim(dev); |
829 | 827 | ||
@@ -1086,7 +1084,7 @@ static int __ppa_attach(struct parport *pb) | |||
1086 | else | 1084 | else |
1087 | ports = 8; | 1085 | ports = 8; |
1088 | 1086 | ||
1089 | INIT_WORK(&dev->ppa_tq, ppa_interrupt, dev); | 1087 | INIT_DELAYED_WORK(&dev->ppa_tq, ppa_interrupt); |
1090 | 1088 | ||
1091 | err = -ENOMEM; | 1089 | err = -ENOMEM; |
1092 | host = scsi_host_alloc(&ppa_template, sizeof(ppa_struct *)); | 1090 | host = scsi_host_alloc(&ppa_template, sizeof(ppa_struct *)); |
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index db9d88e7bee7..969c9e431028 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c | |||
@@ -961,9 +961,10 @@ static int qla4xxx_recover_adapter(struct scsi_qla_host *ha, | |||
961 | * the mid-level tries to sleep when it reaches the driver threshold | 961 | * the mid-level tries to sleep when it reaches the driver threshold |
962 | * "host->can_queue". This can cause a panic if we were in our interrupt code. | 962 | * "host->can_queue". This can cause a panic if we were in our interrupt code. |
963 | **/ | 963 | **/ |
964 | static void qla4xxx_do_dpc(void *data) | 964 | static void qla4xxx_do_dpc(struct work_struct *work) |
965 | { | 965 | { |
966 | struct scsi_qla_host *ha = (struct scsi_qla_host *) data; | 966 | struct scsi_qla_host *ha = |
967 | container_of(work, struct scsi_qla_host, dpc_work); | ||
967 | struct ddb_entry *ddb_entry, *dtemp; | 968 | struct ddb_entry *ddb_entry, *dtemp; |
968 | 969 | ||
969 | DEBUG2(printk("scsi%ld: %s: DPC handler waking up." | 970 | DEBUG2(printk("scsi%ld: %s: DPC handler waking up." |
@@ -1253,7 +1254,7 @@ static int __devinit qla4xxx_probe_adapter(struct pci_dev *pdev, | |||
1253 | ret = -ENODEV; | 1254 | ret = -ENODEV; |
1254 | goto probe_failed; | 1255 | goto probe_failed; |
1255 | } | 1256 | } |
1256 | INIT_WORK(&ha->dpc_work, qla4xxx_do_dpc, ha); | 1257 | INIT_WORK(&ha->dpc_work, qla4xxx_do_dpc); |
1257 | 1258 | ||
1258 | ret = request_irq(pdev->irq, qla4xxx_intr_handler, | 1259 | ret = request_irq(pdev->irq, qla4xxx_intr_handler, |
1259 | SA_INTERRUPT|SA_SHIRQ, "qla4xxx", ha); | 1260 | SA_INTERRUPT|SA_SHIRQ, "qla4xxx", ha); |
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 4d656148bd67..14e635aa44ce 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c | |||
@@ -437,9 +437,10 @@ static struct scsi_target *scsi_alloc_target(struct device *parent, | |||
437 | goto retry; | 437 | goto retry; |
438 | } | 438 | } |
439 | 439 | ||
440 | static void scsi_target_reap_usercontext(void *data) | 440 | static void scsi_target_reap_usercontext(struct work_struct *work) |
441 | { | 441 | { |
442 | struct scsi_target *starget = data; | 442 | struct scsi_target *starget = |
443 | container_of(work, struct scsi_target, ew.work); | ||
443 | struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); | 444 | struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); |
444 | unsigned long flags; | 445 | unsigned long flags; |
445 | 446 | ||
@@ -475,7 +476,7 @@ void scsi_target_reap(struct scsi_target *starget) | |||
475 | starget->state = STARGET_DEL; | 476 | starget->state = STARGET_DEL; |
476 | spin_unlock_irqrestore(shost->host_lock, flags); | 477 | spin_unlock_irqrestore(shost->host_lock, flags); |
477 | execute_in_process_context(scsi_target_reap_usercontext, | 478 | execute_in_process_context(scsi_target_reap_usercontext, |
478 | starget, &starget->ew); | 479 | &starget->ew); |
479 | return; | 480 | return; |
480 | 481 | ||
481 | } | 482 | } |
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index e1a91665d1c2..259c90cfa367 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c | |||
@@ -218,16 +218,16 @@ static void scsi_device_cls_release(struct class_device *class_dev) | |||
218 | put_device(&sdev->sdev_gendev); | 218 | put_device(&sdev->sdev_gendev); |
219 | } | 219 | } |
220 | 220 | ||
221 | static void scsi_device_dev_release_usercontext(void *data) | 221 | static void scsi_device_dev_release_usercontext(struct work_struct *work) |
222 | { | 222 | { |
223 | struct device *dev = data; | ||
224 | struct scsi_device *sdev; | 223 | struct scsi_device *sdev; |
225 | struct device *parent; | 224 | struct device *parent; |
226 | struct scsi_target *starget; | 225 | struct scsi_target *starget; |
227 | unsigned long flags; | 226 | unsigned long flags; |
228 | 227 | ||
229 | parent = dev->parent; | 228 | sdev = container_of(work, struct scsi_device, ew.work); |
230 | sdev = to_scsi_device(dev); | 229 | |
230 | parent = sdev->sdev_gendev.parent; | ||
231 | starget = to_scsi_target(parent); | 231 | starget = to_scsi_target(parent); |
232 | 232 | ||
233 | spin_lock_irqsave(sdev->host->host_lock, flags); | 233 | spin_lock_irqsave(sdev->host->host_lock, flags); |
@@ -258,7 +258,7 @@ static void scsi_device_dev_release_usercontext(void *data) | |||
258 | static void scsi_device_dev_release(struct device *dev) | 258 | static void scsi_device_dev_release(struct device *dev) |
259 | { | 259 | { |
260 | struct scsi_device *sdp = to_scsi_device(dev); | 260 | struct scsi_device *sdp = to_scsi_device(dev); |
261 | execute_in_process_context(scsi_device_dev_release_usercontext, dev, | 261 | execute_in_process_context(scsi_device_dev_release_usercontext, |
262 | &sdp->ew); | 262 | &sdp->ew); |
263 | } | 263 | } |
264 | 264 | ||
diff --git a/drivers/scsi/scsi_tgt_lib.c b/drivers/scsi/scsi_tgt_lib.c index 39da5cd6fb6f..386dbae17b44 100644 --- a/drivers/scsi/scsi_tgt_lib.c +++ b/drivers/scsi/scsi_tgt_lib.c | |||
@@ -185,10 +185,11 @@ static void cmd_hashlist_del(struct scsi_cmnd *cmd) | |||
185 | spin_unlock_irqrestore(&qdata->cmd_hash_lock, flags); | 185 | spin_unlock_irqrestore(&qdata->cmd_hash_lock, flags); |
186 | } | 186 | } |
187 | 187 | ||
188 | static void scsi_tgt_cmd_destroy(void *data) | 188 | static void scsi_tgt_cmd_destroy(struct work_struct *work) |
189 | { | 189 | { |
190 | struct scsi_cmnd *cmd = data; | 190 | struct scsi_tgt_cmd *tcmd = |
191 | struct scsi_tgt_cmd *tcmd = cmd->request->end_io_data; | 191 | container_of(work, struct scsi_tgt_cmd, work); |
192 | struct scsi_cmnd *cmd = tcmd->rq->special; | ||
192 | 193 | ||
193 | dprintk("cmd %p %d %lu\n", cmd, cmd->sc_data_direction, | 194 | dprintk("cmd %p %d %lu\n", cmd, cmd->sc_data_direction, |
194 | rq_data_dir(cmd->request)); | 195 | rq_data_dir(cmd->request)); |
@@ -214,6 +215,7 @@ static void init_scsi_tgt_cmd(struct request *rq, struct scsi_tgt_cmd *tcmd, | |||
214 | struct list_head *head; | 215 | struct list_head *head; |
215 | 216 | ||
216 | tcmd->tag = tag; | 217 | tcmd->tag = tag; |
218 | INIT_WORK(&tcmd->work, scsi_tgt_cmd_destroy); | ||
217 | spin_lock_irqsave(&qdata->cmd_hash_lock, flags); | 219 | spin_lock_irqsave(&qdata->cmd_hash_lock, flags); |
218 | head = &qdata->cmd_hash[cmd_hashfn(tag)]; | 220 | head = &qdata->cmd_hash[cmd_hashfn(tag)]; |
219 | list_add(&tcmd->hash_list, head); | 221 | list_add(&tcmd->hash_list, head); |
@@ -303,7 +305,7 @@ void scsi_tgt_free_queue(struct Scsi_Host *shost) | |||
303 | cmd = tcmd->rq->special; | 305 | cmd = tcmd->rq->special; |
304 | 306 | ||
305 | shost->hostt->eh_abort_handler(cmd); | 307 | shost->hostt->eh_abort_handler(cmd); |
306 | scsi_tgt_cmd_destroy(cmd); | 308 | scsi_tgt_cmd_destroy(&tcmd->work); |
307 | } | 309 | } |
308 | } | 310 | } |
309 | EXPORT_SYMBOL_GPL(scsi_tgt_free_queue); | 311 | EXPORT_SYMBOL_GPL(scsi_tgt_free_queue); |
@@ -347,7 +349,6 @@ static void scsi_tgt_cmd_done(struct scsi_cmnd *cmd) | |||
347 | dprintk("cmd %p %lu\n", cmd, rq_data_dir(cmd->request)); | 349 | dprintk("cmd %p %lu\n", cmd, rq_data_dir(cmd->request)); |
348 | 350 | ||
349 | scsi_tgt_uspace_send_status(cmd, tcmd->tag); | 351 | scsi_tgt_uspace_send_status(cmd, tcmd->tag); |
350 | INIT_WORK(&tcmd->work, scsi_tgt_cmd_destroy, cmd); | ||
351 | queue_work(scsi_tgtd, &tcmd->work); | 352 | queue_work(scsi_tgtd, &tcmd->work); |
352 | } | 353 | } |
353 | 354 | ||
@@ -549,13 +550,15 @@ static int scsi_tgt_copy_sense(struct scsi_cmnd *cmd, unsigned long uaddr, | |||
549 | 550 | ||
550 | static int scsi_tgt_abort_cmd(struct Scsi_Host *shost, struct scsi_cmnd *cmd) | 551 | static int scsi_tgt_abort_cmd(struct Scsi_Host *shost, struct scsi_cmnd *cmd) |
551 | { | 552 | { |
553 | struct scsi_tgt_cmd *tcmd; | ||
552 | int err; | 554 | int err; |
553 | 555 | ||
554 | err = shost->hostt->eh_abort_handler(cmd); | 556 | err = shost->hostt->eh_abort_handler(cmd); |
555 | if (err) | 557 | if (err) |
556 | eprintk("fail to abort %p\n", cmd); | 558 | eprintk("fail to abort %p\n", cmd); |
557 | 559 | ||
558 | scsi_tgt_cmd_destroy(cmd); | 560 | tcmd = cmd->request->end_io_data; |
561 | scsi_tgt_cmd_destroy(&tcmd->work); | ||
559 | return err; | 562 | return err; |
560 | } | 563 | } |
561 | 564 | ||
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index 38c215a78f69..3571ce8934e7 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c | |||
@@ -241,9 +241,9 @@ fc_bitfield_name_search(remote_port_roles, fc_remote_port_role_names) | |||
241 | #define FC_MGMTSRVR_PORTID 0x00000a | 241 | #define FC_MGMTSRVR_PORTID 0x00000a |
242 | 242 | ||
243 | 243 | ||
244 | static void fc_timeout_deleted_rport(void *data); | 244 | static void fc_timeout_deleted_rport(struct work_struct *work); |
245 | static void fc_timeout_fail_rport_io(void *data); | 245 | static void fc_timeout_fail_rport_io(struct work_struct *work); |
246 | static void fc_scsi_scan_rport(void *data); | 246 | static void fc_scsi_scan_rport(struct work_struct *work); |
247 | 247 | ||
248 | /* | 248 | /* |
249 | * Attribute counts pre object type... | 249 | * Attribute counts pre object type... |
@@ -1613,7 +1613,7 @@ fc_flush_work(struct Scsi_Host *shost) | |||
1613 | * 1 on success / 0 already queued / < 0 for error | 1613 | * 1 on success / 0 already queued / < 0 for error |
1614 | **/ | 1614 | **/ |
1615 | static int | 1615 | static int |
1616 | fc_queue_devloss_work(struct Scsi_Host *shost, struct work_struct *work, | 1616 | fc_queue_devloss_work(struct Scsi_Host *shost, struct delayed_work *work, |
1617 | unsigned long delay) | 1617 | unsigned long delay) |
1618 | { | 1618 | { |
1619 | if (unlikely(!fc_host_devloss_work_q(shost))) { | 1619 | if (unlikely(!fc_host_devloss_work_q(shost))) { |
@@ -1625,9 +1625,6 @@ fc_queue_devloss_work(struct Scsi_Host *shost, struct work_struct *work, | |||
1625 | return -EINVAL; | 1625 | return -EINVAL; |
1626 | } | 1626 | } |
1627 | 1627 | ||
1628 | if (delay == 0) | ||
1629 | return queue_work(fc_host_devloss_work_q(shost), work); | ||
1630 | |||
1631 | return queue_delayed_work(fc_host_devloss_work_q(shost), work, delay); | 1628 | return queue_delayed_work(fc_host_devloss_work_q(shost), work, delay); |
1632 | } | 1629 | } |
1633 | 1630 | ||
@@ -1712,12 +1709,13 @@ EXPORT_SYMBOL(fc_remove_host); | |||
1712 | * fc_starget_delete - called to delete the scsi decendents of an rport | 1709 | * fc_starget_delete - called to delete the scsi decendents of an rport |
1713 | * (target and all sdevs) | 1710 | * (target and all sdevs) |
1714 | * | 1711 | * |
1715 | * @data: remote port to be operated on. | 1712 | * @work: remote port to be operated on. |
1716 | **/ | 1713 | **/ |
1717 | static void | 1714 | static void |
1718 | fc_starget_delete(void *data) | 1715 | fc_starget_delete(struct work_struct *work) |
1719 | { | 1716 | { |
1720 | struct fc_rport *rport = (struct fc_rport *)data; | 1717 | struct fc_rport *rport = |
1718 | container_of(work, struct fc_rport, stgt_delete_work); | ||
1721 | struct Scsi_Host *shost = rport_to_shost(rport); | 1719 | struct Scsi_Host *shost = rport_to_shost(rport); |
1722 | unsigned long flags; | 1720 | unsigned long flags; |
1723 | struct fc_internal *i = to_fc_internal(shost->transportt); | 1721 | struct fc_internal *i = to_fc_internal(shost->transportt); |
@@ -1751,12 +1749,13 @@ fc_starget_delete(void *data) | |||
1751 | /** | 1749 | /** |
1752 | * fc_rport_final_delete - finish rport termination and delete it. | 1750 | * fc_rport_final_delete - finish rport termination and delete it. |
1753 | * | 1751 | * |
1754 | * @data: remote port to be deleted. | 1752 | * @work: remote port to be deleted. |
1755 | **/ | 1753 | **/ |
1756 | static void | 1754 | static void |
1757 | fc_rport_final_delete(void *data) | 1755 | fc_rport_final_delete(struct work_struct *work) |
1758 | { | 1756 | { |
1759 | struct fc_rport *rport = (struct fc_rport *)data; | 1757 | struct fc_rport *rport = |
1758 | container_of(work, struct fc_rport, rport_delete_work); | ||
1760 | struct device *dev = &rport->dev; | 1759 | struct device *dev = &rport->dev; |
1761 | struct Scsi_Host *shost = rport_to_shost(rport); | 1760 | struct Scsi_Host *shost = rport_to_shost(rport); |
1762 | struct fc_internal *i = to_fc_internal(shost->transportt); | 1761 | struct fc_internal *i = to_fc_internal(shost->transportt); |
@@ -1770,7 +1769,7 @@ fc_rport_final_delete(void *data) | |||
1770 | 1769 | ||
1771 | /* Delete SCSI target and sdevs */ | 1770 | /* Delete SCSI target and sdevs */ |
1772 | if (rport->scsi_target_id != -1) | 1771 | if (rport->scsi_target_id != -1) |
1773 | fc_starget_delete(data); | 1772 | fc_starget_delete(&rport->stgt_delete_work); |
1774 | else if (i->f->dev_loss_tmo_callbk) | 1773 | else if (i->f->dev_loss_tmo_callbk) |
1775 | i->f->dev_loss_tmo_callbk(rport); | 1774 | i->f->dev_loss_tmo_callbk(rport); |
1776 | else if (i->f->terminate_rport_io) | 1775 | else if (i->f->terminate_rport_io) |
@@ -1829,11 +1828,11 @@ fc_rport_create(struct Scsi_Host *shost, int channel, | |||
1829 | rport->channel = channel; | 1828 | rport->channel = channel; |
1830 | rport->fast_io_fail_tmo = -1; | 1829 | rport->fast_io_fail_tmo = -1; |
1831 | 1830 | ||
1832 | INIT_WORK(&rport->dev_loss_work, fc_timeout_deleted_rport, rport); | 1831 | INIT_DELAYED_WORK(&rport->dev_loss_work, fc_timeout_deleted_rport); |
1833 | INIT_WORK(&rport->fail_io_work, fc_timeout_fail_rport_io, rport); | 1832 | INIT_DELAYED_WORK(&rport->fail_io_work, fc_timeout_fail_rport_io); |
1834 | INIT_WORK(&rport->scan_work, fc_scsi_scan_rport, rport); | 1833 | INIT_WORK(&rport->scan_work, fc_scsi_scan_rport); |
1835 | INIT_WORK(&rport->stgt_delete_work, fc_starget_delete, rport); | 1834 | INIT_WORK(&rport->stgt_delete_work, fc_starget_delete); |
1836 | INIT_WORK(&rport->rport_delete_work, fc_rport_final_delete, rport); | 1835 | INIT_WORK(&rport->rport_delete_work, fc_rport_final_delete); |
1837 | 1836 | ||
1838 | spin_lock_irqsave(shost->host_lock, flags); | 1837 | spin_lock_irqsave(shost->host_lock, flags); |
1839 | 1838 | ||
@@ -1963,7 +1962,7 @@ fc_remote_port_add(struct Scsi_Host *shost, int channel, | |||
1963 | } | 1962 | } |
1964 | 1963 | ||
1965 | if (match) { | 1964 | if (match) { |
1966 | struct work_struct *work = | 1965 | struct delayed_work *work = |
1967 | &rport->dev_loss_work; | 1966 | &rport->dev_loss_work; |
1968 | 1967 | ||
1969 | memcpy(&rport->node_name, &ids->node_name, | 1968 | memcpy(&rport->node_name, &ids->node_name, |
@@ -2267,12 +2266,13 @@ EXPORT_SYMBOL(fc_remote_port_rolechg); | |||
2267 | * was a SCSI target (thus was blocked), and failed | 2266 | * was a SCSI target (thus was blocked), and failed |
2268 | * to return in the alloted time. | 2267 | * to return in the alloted time. |
2269 | * | 2268 | * |
2270 | * @data: rport target that failed to reappear in the alloted time. | 2269 | * @work: rport target that failed to reappear in the alloted time. |
2271 | **/ | 2270 | **/ |
2272 | static void | 2271 | static void |
2273 | fc_timeout_deleted_rport(void *data) | 2272 | fc_timeout_deleted_rport(struct work_struct *work) |
2274 | { | 2273 | { |
2275 | struct fc_rport *rport = (struct fc_rport *)data; | 2274 | struct fc_rport *rport = |
2275 | container_of(work, struct fc_rport, dev_loss_work.work); | ||
2276 | struct Scsi_Host *shost = rport_to_shost(rport); | 2276 | struct Scsi_Host *shost = rport_to_shost(rport); |
2277 | struct fc_host_attrs *fc_host = shost_to_fc_host(shost); | 2277 | struct fc_host_attrs *fc_host = shost_to_fc_host(shost); |
2278 | unsigned long flags; | 2278 | unsigned long flags; |
@@ -2366,15 +2366,16 @@ fc_timeout_deleted_rport(void *data) | |||
2366 | * fc_timeout_fail_rport_io - Timeout handler for a fast io failing on a | 2366 | * fc_timeout_fail_rport_io - Timeout handler for a fast io failing on a |
2367 | * disconnected SCSI target. | 2367 | * disconnected SCSI target. |
2368 | * | 2368 | * |
2369 | * @data: rport to terminate io on. | 2369 | * @work: rport to terminate io on. |
2370 | * | 2370 | * |
2371 | * Notes: Only requests the failure of the io, not that all are flushed | 2371 | * Notes: Only requests the failure of the io, not that all are flushed |
2372 | * prior to returning. | 2372 | * prior to returning. |
2373 | **/ | 2373 | **/ |
2374 | static void | 2374 | static void |
2375 | fc_timeout_fail_rport_io(void *data) | 2375 | fc_timeout_fail_rport_io(struct work_struct *work) |
2376 | { | 2376 | { |
2377 | struct fc_rport *rport = (struct fc_rport *)data; | 2377 | struct fc_rport *rport = |
2378 | container_of(work, struct fc_rport, fail_io_work.work); | ||
2378 | struct Scsi_Host *shost = rport_to_shost(rport); | 2379 | struct Scsi_Host *shost = rport_to_shost(rport); |
2379 | struct fc_internal *i = to_fc_internal(shost->transportt); | 2380 | struct fc_internal *i = to_fc_internal(shost->transportt); |
2380 | 2381 | ||
@@ -2387,12 +2388,13 @@ fc_timeout_fail_rport_io(void *data) | |||
2387 | /** | 2388 | /** |
2388 | * fc_scsi_scan_rport - called to perform a scsi scan on a remote port. | 2389 | * fc_scsi_scan_rport - called to perform a scsi scan on a remote port. |
2389 | * | 2390 | * |
2390 | * @data: remote port to be scanned. | 2391 | * @work: remote port to be scanned. |
2391 | **/ | 2392 | **/ |
2392 | static void | 2393 | static void |
2393 | fc_scsi_scan_rport(void *data) | 2394 | fc_scsi_scan_rport(struct work_struct *work) |
2394 | { | 2395 | { |
2395 | struct fc_rport *rport = (struct fc_rport *)data; | 2396 | struct fc_rport *rport = |
2397 | container_of(work, struct fc_rport, scan_work); | ||
2396 | struct Scsi_Host *shost = rport_to_shost(rport); | 2398 | struct Scsi_Host *shost = rport_to_shost(rport); |
2397 | unsigned long flags; | 2399 | unsigned long flags; |
2398 | 2400 | ||
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 9b25124a989e..9c22f1342715 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c | |||
@@ -234,9 +234,11 @@ static int iscsi_user_scan(struct Scsi_Host *shost, uint channel, | |||
234 | return 0; | 234 | return 0; |
235 | } | 235 | } |
236 | 236 | ||
237 | static void session_recovery_timedout(void *data) | 237 | static void session_recovery_timedout(struct work_struct *work) |
238 | { | 238 | { |
239 | struct iscsi_cls_session *session = data; | 239 | struct iscsi_cls_session *session = |
240 | container_of(work, struct iscsi_cls_session, | ||
241 | recovery_work.work); | ||
240 | 242 | ||
241 | dev_printk(KERN_INFO, &session->dev, "iscsi: session recovery timed " | 243 | dev_printk(KERN_INFO, &session->dev, "iscsi: session recovery timed " |
242 | "out after %d secs\n", session->recovery_tmo); | 244 | "out after %d secs\n", session->recovery_tmo); |
@@ -276,7 +278,7 @@ iscsi_alloc_session(struct Scsi_Host *shost, | |||
276 | 278 | ||
277 | session->transport = transport; | 279 | session->transport = transport; |
278 | session->recovery_tmo = 120; | 280 | session->recovery_tmo = 120; |
279 | INIT_WORK(&session->recovery_work, session_recovery_timedout, session); | 281 | INIT_DELAYED_WORK(&session->recovery_work, session_recovery_timedout); |
280 | INIT_LIST_HEAD(&session->host_list); | 282 | INIT_LIST_HEAD(&session->host_list); |
281 | INIT_LIST_HEAD(&session->sess_list); | 283 | INIT_LIST_HEAD(&session->sess_list); |
282 | 284 | ||
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index 9f070f0d0f2b..3fded4831460 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c | |||
@@ -964,9 +964,10 @@ struct work_queue_wrapper { | |||
964 | }; | 964 | }; |
965 | 965 | ||
966 | static void | 966 | static void |
967 | spi_dv_device_work_wrapper(void *data) | 967 | spi_dv_device_work_wrapper(struct work_struct *work) |
968 | { | 968 | { |
969 | struct work_queue_wrapper *wqw = (struct work_queue_wrapper *)data; | 969 | struct work_queue_wrapper *wqw = |
970 | container_of(work, struct work_queue_wrapper, work); | ||
970 | struct scsi_device *sdev = wqw->sdev; | 971 | struct scsi_device *sdev = wqw->sdev; |
971 | 972 | ||
972 | kfree(wqw); | 973 | kfree(wqw); |
@@ -1006,7 +1007,7 @@ spi_schedule_dv_device(struct scsi_device *sdev) | |||
1006 | return; | 1007 | return; |
1007 | } | 1008 | } |
1008 | 1009 | ||
1009 | INIT_WORK(&wqw->work, spi_dv_device_work_wrapper, wqw); | 1010 | INIT_WORK(&wqw->work, spi_dv_device_work_wrapper); |
1010 | wqw->sdev = sdev; | 1011 | wqw->sdev = sdev; |
1011 | 1012 | ||
1012 | schedule_work(&wqw->work); | 1013 | schedule_work(&wqw->work); |
diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c index 72025df5561d..494d9b856488 100644 --- a/drivers/spi/pxa2xx_spi.c +++ b/drivers/spi/pxa2xx_spi.c | |||
@@ -148,7 +148,7 @@ struct chip_data { | |||
148 | void (*cs_control)(u32 command); | 148 | void (*cs_control)(u32 command); |
149 | }; | 149 | }; |
150 | 150 | ||
151 | static void pump_messages(void *data); | 151 | static void pump_messages(struct work_struct *work); |
152 | 152 | ||
153 | static int flush(struct driver_data *drv_data) | 153 | static int flush(struct driver_data *drv_data) |
154 | { | 154 | { |
@@ -884,9 +884,10 @@ static void pump_transfers(unsigned long data) | |||
884 | } | 884 | } |
885 | } | 885 | } |
886 | 886 | ||
887 | static void pump_messages(void *data) | 887 | static void pump_messages(struct work_struct *work) |
888 | { | 888 | { |
889 | struct driver_data *drv_data = data; | 889 | struct driver_data *drv_data = |
890 | container_of(work, struct driver_data, pump_messages); | ||
890 | unsigned long flags; | 891 | unsigned long flags; |
891 | 892 | ||
892 | /* Lock queue and check for queue work */ | 893 | /* Lock queue and check for queue work */ |
@@ -1098,7 +1099,7 @@ static int init_queue(struct driver_data *drv_data) | |||
1098 | tasklet_init(&drv_data->pump_transfers, | 1099 | tasklet_init(&drv_data->pump_transfers, |
1099 | pump_transfers, (unsigned long)drv_data); | 1100 | pump_transfers, (unsigned long)drv_data); |
1100 | 1101 | ||
1101 | INIT_WORK(&drv_data->pump_messages, pump_messages, drv_data); | 1102 | INIT_WORK(&drv_data->pump_messages, pump_messages); |
1102 | drv_data->workqueue = create_singlethread_workqueue( | 1103 | drv_data->workqueue = create_singlethread_workqueue( |
1103 | drv_data->master->cdev.dev->bus_id); | 1104 | drv_data->master->cdev.dev->bus_id); |
1104 | if (drv_data->workqueue == NULL) | 1105 | if (drv_data->workqueue == NULL) |
diff --git a/drivers/spi/spi_bitbang.c b/drivers/spi/spi_bitbang.c index a23862ef72b2..08c1c57c6128 100644 --- a/drivers/spi/spi_bitbang.c +++ b/drivers/spi/spi_bitbang.c | |||
@@ -265,9 +265,10 @@ static int spi_bitbang_bufs(struct spi_device *spi, struct spi_transfer *t) | |||
265 | * Drivers can provide word-at-a-time i/o primitives, or provide | 265 | * Drivers can provide word-at-a-time i/o primitives, or provide |
266 | * transfer-at-a-time ones to leverage dma or fifo hardware. | 266 | * transfer-at-a-time ones to leverage dma or fifo hardware. |
267 | */ | 267 | */ |
268 | static void bitbang_work(void *_bitbang) | 268 | static void bitbang_work(struct work_struct *work) |
269 | { | 269 | { |
270 | struct spi_bitbang *bitbang = _bitbang; | 270 | struct spi_bitbang *bitbang = |
271 | container_of(work, struct spi_bitbang, work); | ||
271 | unsigned long flags; | 272 | unsigned long flags; |
272 | 273 | ||
273 | spin_lock_irqsave(&bitbang->lock, flags); | 274 | spin_lock_irqsave(&bitbang->lock, flags); |
@@ -456,7 +457,7 @@ int spi_bitbang_start(struct spi_bitbang *bitbang) | |||
456 | if (!bitbang->master || !bitbang->chipselect) | 457 | if (!bitbang->master || !bitbang->chipselect) |
457 | return -EINVAL; | 458 | return -EINVAL; |
458 | 459 | ||
459 | INIT_WORK(&bitbang->work, bitbang_work, bitbang); | 460 | INIT_WORK(&bitbang->work, bitbang_work); |
460 | spin_lock_init(&bitbang->lock); | 461 | spin_lock_init(&bitbang->lock); |
461 | INIT_LIST_HEAD(&bitbang->queue); | 462 | INIT_LIST_HEAD(&bitbang->queue); |
462 | 463 | ||
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 a823486495c3..8ed6c75adf0f 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 c137c041f7a4..f2d196fa1e8b 100644 --- a/drivers/usb/atm/ueagle-atm.c +++ b/drivers/usb/atm/ueagle-atm.c | |||
@@ -655,9 +655,9 @@ static int request_dsp(struct uea_softc *sc) | |||
655 | /* | 655 | /* |
656 | * The uea_load_page() function must be called within a process context | 656 | * The uea_load_page() function must be called within a process context |
657 | */ | 657 | */ |
658 | static void uea_load_page(void *xsc) | 658 | static void uea_load_page(struct work_struct *work) |
659 | { | 659 | { |
660 | struct uea_softc *sc = xsc; | 660 | struct uea_softc *sc = container_of(work, struct uea_softc, task); |
661 | u16 pageno = sc->pageno; | 661 | u16 pageno = sc->pageno; |
662 | u16 ovl = sc->ovl; | 662 | u16 ovl = sc->ovl; |
663 | struct block_info bi; | 663 | struct block_info bi; |
@@ -1348,7 +1348,7 @@ static int uea_boot(struct uea_softc *sc) | |||
1348 | 1348 | ||
1349 | uea_enters(INS_TO_USBDEV(sc)); | 1349 | uea_enters(INS_TO_USBDEV(sc)); |
1350 | 1350 | ||
1351 | INIT_WORK(&sc->task, uea_load_page, sc); | 1351 | INIT_WORK(&sc->task, uea_load_page); |
1352 | init_waitqueue_head(&sc->sync_q); | 1352 | init_waitqueue_head(&sc->sync_q); |
1353 | init_waitqueue_head(&sc->cmv_ack_wait); | 1353 | init_waitqueue_head(&sc->cmv_ack_wait); |
1354 | 1354 | ||
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index ec3438dc8ee5..7f1fa956dcdb 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 0ce393eb3c4b..9be41ed1f9a6 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -68,7 +68,7 @@ struct usb_hub { | |||
68 | 68 | ||
69 | unsigned has_indicators:1; | 69 | unsigned has_indicators:1; |
70 | u8 indicator[USB_MAXCHILDREN]; | 70 | u8 indicator[USB_MAXCHILDREN]; |
71 | struct work_struct leds; | 71 | struct delayed_work leds; |
72 | }; | 72 | }; |
73 | 73 | ||
74 | 74 | ||
@@ -218,9 +218,10 @@ static void set_port_led( | |||
218 | 218 | ||
219 | #define LED_CYCLE_PERIOD ((2*HZ)/3) | 219 | #define LED_CYCLE_PERIOD ((2*HZ)/3) |
220 | 220 | ||
221 | static void led_work (void *__hub) | 221 | static void led_work (struct work_struct *work) |
222 | { | 222 | { |
223 | struct usb_hub *hub = __hub; | 223 | struct usb_hub *hub = |
224 | container_of(work, struct usb_hub, leds.work); | ||
224 | struct usb_device *hdev = hub->hdev; | 225 | struct usb_device *hdev = hub->hdev; |
225 | unsigned i; | 226 | unsigned i; |
226 | unsigned changed = 0; | 227 | unsigned changed = 0; |
@@ -405,9 +406,10 @@ hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt) | |||
405 | * talking to TTs must queue control transfers (not just bulk and iso), so | 406 | * talking to TTs must queue control transfers (not just bulk and iso), so |
406 | * both can talk to the same hub concurrently. | 407 | * both can talk to the same hub concurrently. |
407 | */ | 408 | */ |
408 | static void hub_tt_kevent (void *arg) | 409 | static void hub_tt_kevent (struct work_struct *work) |
409 | { | 410 | { |
410 | struct usb_hub *hub = arg; | 411 | struct usb_hub *hub = |
412 | container_of(work, struct usb_hub, tt.kevent); | ||
411 | unsigned long flags; | 413 | unsigned long flags; |
412 | 414 | ||
413 | spin_lock_irqsave (&hub->tt.lock, flags); | 415 | spin_lock_irqsave (&hub->tt.lock, flags); |
@@ -694,7 +696,7 @@ static int hub_configure(struct usb_hub *hub, | |||
694 | 696 | ||
695 | spin_lock_init (&hub->tt.lock); | 697 | spin_lock_init (&hub->tt.lock); |
696 | INIT_LIST_HEAD (&hub->tt.clear_list); | 698 | INIT_LIST_HEAD (&hub->tt.clear_list); |
697 | INIT_WORK (&hub->tt.kevent, hub_tt_kevent, hub); | 699 | INIT_WORK (&hub->tt.kevent, hub_tt_kevent); |
698 | switch (hdev->descriptor.bDeviceProtocol) { | 700 | switch (hdev->descriptor.bDeviceProtocol) { |
699 | case 0: | 701 | case 0: |
700 | break; | 702 | break; |
@@ -938,7 +940,7 @@ descriptor_error: | |||
938 | INIT_LIST_HEAD(&hub->event_list); | 940 | INIT_LIST_HEAD(&hub->event_list); |
939 | hub->intfdev = &intf->dev; | 941 | hub->intfdev = &intf->dev; |
940 | hub->hdev = hdev; | 942 | hub->hdev = hdev; |
941 | INIT_WORK(&hub->leds, led_work, hub); | 943 | INIT_DELAYED_WORK(&hub->leds, led_work); |
942 | 944 | ||
943 | usb_set_intfdata (intf, hub); | 945 | usb_set_intfdata (intf, hub); |
944 | intf->needs_remote_wakeup = 1; | 946 | intf->needs_remote_wakeup = 1; |
@@ -2381,7 +2383,7 @@ check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1) | |||
2381 | /* hub LEDs are probably harder to miss than syslog */ | 2383 | /* hub LEDs are probably harder to miss than syslog */ |
2382 | if (hub->has_indicators) { | 2384 | if (hub->has_indicators) { |
2383 | hub->indicator[port1-1] = INDICATOR_GREEN_BLINK; | 2385 | hub->indicator[port1-1] = INDICATOR_GREEN_BLINK; |
2384 | schedule_work (&hub->leds); | 2386 | schedule_delayed_work (&hub->leds, 0); |
2385 | } | 2387 | } |
2386 | } | 2388 | } |
2387 | kfree(qual); | 2389 | kfree(qual); |
@@ -2555,7 +2557,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, | |||
2555 | if (hub->has_indicators) { | 2557 | if (hub->has_indicators) { |
2556 | hub->indicator[port1-1] = | 2558 | hub->indicator[port1-1] = |
2557 | INDICATOR_AMBER_BLINK; | 2559 | INDICATOR_AMBER_BLINK; |
2558 | schedule_work (&hub->leds); | 2560 | schedule_delayed_work (&hub->leds, 0); |
2559 | } | 2561 | } |
2560 | status = -ENOTCONN; /* Don't retry */ | 2562 | status = -ENOTCONN; /* Don't retry */ |
2561 | goto loop_disable; | 2563 | goto loop_disable; |
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 29b0fa9ff9d0..7390b67c609d 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 81cb52564e68..02426d0b9a34 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
@@ -203,9 +203,10 @@ static void ksuspend_usb_cleanup(void) | |||
203 | #ifdef CONFIG_USB_SUSPEND | 203 | #ifdef CONFIG_USB_SUSPEND |
204 | 204 | ||
205 | /* usb_autosuspend_work - callback routine to autosuspend a USB device */ | 205 | /* usb_autosuspend_work - callback routine to autosuspend a USB device */ |
206 | static void usb_autosuspend_work(void *_udev) | 206 | static void usb_autosuspend_work(struct work_struct *work) |
207 | { | 207 | { |
208 | struct usb_device *udev = _udev; | 208 | struct usb_device *udev = |
209 | container_of(work, struct usb_device, autosuspend.work); | ||
209 | 210 | ||
210 | usb_pm_lock(udev); | 211 | usb_pm_lock(udev); |
211 | udev->auto_pm = 1; | 212 | udev->auto_pm = 1; |
@@ -215,7 +216,7 @@ static void usb_autosuspend_work(void *_udev) | |||
215 | 216 | ||
216 | #else | 217 | #else |
217 | 218 | ||
218 | static void usb_autosuspend_work(void *_udev) | 219 | static void usb_autosuspend_work(struct work_struct *work) |
219 | {} | 220 | {} |
220 | 221 | ||
221 | #endif /* CONFIG_USB_SUSPEND */ | 222 | #endif /* CONFIG_USB_SUSPEND */ |
@@ -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 3bd1dfe565c1..d15bf22b9a03 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 ef54e310bfc4..a9d7119e3176 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]; |
@@ -310,7 +310,7 @@ static void u132_ring_requeue_work(struct u132 *u132, struct u132_ring *ring, | |||
310 | if (delta > 0) { | 310 | if (delta > 0) { |
311 | if (queue_delayed_work(workqueue, &ring->scheduler, delta)) | 311 | if (queue_delayed_work(workqueue, &ring->scheduler, delta)) |
312 | return; | 312 | return; |
313 | } else if (queue_work(workqueue, &ring->scheduler)) | 313 | } else if (queue_delayed_work(workqueue, &ring->scheduler, 0)) |
314 | return; | 314 | return; |
315 | kref_put(&u132->kref, u132_hcd_delete); | 315 | kref_put(&u132->kref, u132_hcd_delete); |
316 | return; | 316 | return; |
@@ -389,12 +389,8 @@ static inline void u132_endp_init_kref(struct u132 *u132, | |||
389 | static void u132_endp_queue_work(struct u132 *u132, struct u132_endp *endp, | 389 | static void u132_endp_queue_work(struct u132 *u132, struct u132_endp *endp, |
390 | unsigned int delta) | 390 | unsigned int delta) |
391 | { | 391 | { |
392 | if (delta > 0) { | 392 | if (queue_delayed_work(workqueue, &endp->scheduler, delta)) |
393 | if (queue_delayed_work(workqueue, &endp->scheduler, delta)) | 393 | kref_get(&endp->kref); |
394 | kref_get(&endp->kref); | ||
395 | } else if (queue_work(workqueue, &endp->scheduler)) | ||
396 | kref_get(&endp->kref); | ||
397 | return; | ||
398 | } | 394 | } |
399 | 395 | ||
400 | static void u132_endp_cancel_work(struct u132 *u132, struct u132_endp *endp) | 396 | static void u132_endp_cancel_work(struct u132 *u132, struct u132_endp *endp) |
@@ -410,24 +406,14 @@ static inline void u132_monitor_put_kref(struct u132 *u132) | |||
410 | 406 | ||
411 | static void u132_monitor_queue_work(struct u132 *u132, unsigned int delta) | 407 | static void u132_monitor_queue_work(struct u132 *u132, unsigned int delta) |
412 | { | 408 | { |
413 | if (delta > 0) { | 409 | if (queue_delayed_work(workqueue, &u132->monitor, delta)) |
414 | if (queue_delayed_work(workqueue, &u132->monitor, delta)) { | 410 | kref_get(&u132->kref); |
415 | kref_get(&u132->kref); | ||
416 | } | ||
417 | } else if (queue_work(workqueue, &u132->monitor)) | ||
418 | kref_get(&u132->kref); | ||
419 | return; | ||
420 | } | 411 | } |
421 | 412 | ||
422 | static void u132_monitor_requeue_work(struct u132 *u132, unsigned int delta) | 413 | static void u132_monitor_requeue_work(struct u132 *u132, unsigned int delta) |
423 | { | 414 | { |
424 | if (delta > 0) { | 415 | if (!queue_delayed_work(workqueue, &u132->monitor, delta)) |
425 | if (queue_delayed_work(workqueue, &u132->monitor, delta)) | 416 | kref_put(&u132->kref, u132_hcd_delete); |
426 | return; | ||
427 | } else if (queue_work(workqueue, &u132->monitor)) | ||
428 | return; | ||
429 | kref_put(&u132->kref, u132_hcd_delete); | ||
430 | return; | ||
431 | } | 417 | } |
432 | 418 | ||
433 | static void u132_monitor_cancel_work(struct u132 *u132) | 419 | static void u132_monitor_cancel_work(struct u132 *u132) |
@@ -489,9 +475,9 @@ static int read_roothub_info(struct u132 *u132) | |||
489 | return 0; | 475 | return 0; |
490 | } | 476 | } |
491 | 477 | ||
492 | static void u132_hcd_monitor_work(void *data) | 478 | static void u132_hcd_monitor_work(struct work_struct *work) |
493 | { | 479 | { |
494 | struct u132 *u132 = data; | 480 | struct u132 *u132 = container_of(work, struct u132, monitor.work); |
495 | if (u132->going > 1) { | 481 | if (u132->going > 1) { |
496 | dev_err(&u132->platform_dev->dev, "device has been removed %d\n" | 482 | dev_err(&u132->platform_dev->dev, "device has been removed %d\n" |
497 | , u132->going); | 483 | , u132->going); |
@@ -1315,15 +1301,14 @@ static void u132_hcd_initial_setup_sent(void *data, struct urb *urb, u8 *buf, | |||
1315 | } | 1301 | } |
1316 | } | 1302 | } |
1317 | 1303 | ||
1318 | static void u132_hcd_ring_work_scheduler(void *data); | ||
1319 | static void u132_hcd_endp_work_scheduler(void *data); | ||
1320 | /* | 1304 | /* |
1321 | * this work function is only executed from the work queue | 1305 | * this work function is only executed from the work queue |
1322 | * | 1306 | * |
1323 | */ | 1307 | */ |
1324 | static void u132_hcd_ring_work_scheduler(void *data) | 1308 | static void u132_hcd_ring_work_scheduler(struct work_struct *work) |
1325 | { | 1309 | { |
1326 | struct u132_ring *ring = data; | 1310 | struct u132_ring *ring = |
1311 | container_of(work, struct u132_ring, scheduler.work); | ||
1327 | struct u132 *u132 = ring->u132; | 1312 | struct u132 *u132 = ring->u132; |
1328 | down(&u132->scheduler_lock); | 1313 | down(&u132->scheduler_lock); |
1329 | if (ring->in_use) { | 1314 | if (ring->in_use) { |
@@ -1382,10 +1367,11 @@ static void u132_hcd_ring_work_scheduler(void *data) | |||
1382 | } | 1367 | } |
1383 | } | 1368 | } |
1384 | 1369 | ||
1385 | static void u132_hcd_endp_work_scheduler(void *data) | 1370 | static void u132_hcd_endp_work_scheduler(struct work_struct *work) |
1386 | { | 1371 | { |
1387 | struct u132_ring *ring; | 1372 | struct u132_ring *ring; |
1388 | struct u132_endp *endp = data; | 1373 | struct u132_endp *endp = |
1374 | container_of(work, struct u132_endp, scheduler.work); | ||
1389 | struct u132 *u132 = endp->u132; | 1375 | struct u132 *u132 = endp->u132; |
1390 | down(&u132->scheduler_lock); | 1376 | down(&u132->scheduler_lock); |
1391 | ring = endp->ring; | 1377 | ring = endp->ring; |
@@ -1943,7 +1929,7 @@ static int create_endpoint_and_queue_int(struct u132 *u132, | |||
1943 | if (!endp) { | 1929 | if (!endp) { |
1944 | return -ENOMEM; | 1930 | return -ENOMEM; |
1945 | } | 1931 | } |
1946 | INIT_WORK(&endp->scheduler, u132_hcd_endp_work_scheduler, (void *)endp); | 1932 | INIT_DELAYED_WORK(&endp->scheduler, u132_hcd_endp_work_scheduler); |
1947 | spin_lock_init(&endp->queue_lock.slock); | 1933 | spin_lock_init(&endp->queue_lock.slock); |
1948 | INIT_LIST_HEAD(&endp->urb_more); | 1934 | INIT_LIST_HEAD(&endp->urb_more); |
1949 | ring = endp->ring = &u132->ring[0]; | 1935 | ring = endp->ring = &u132->ring[0]; |
@@ -2032,7 +2018,7 @@ static int create_endpoint_and_queue_bulk(struct u132 *u132, | |||
2032 | if (!endp) { | 2018 | if (!endp) { |
2033 | return -ENOMEM; | 2019 | return -ENOMEM; |
2034 | } | 2020 | } |
2035 | INIT_WORK(&endp->scheduler, u132_hcd_endp_work_scheduler, (void *)endp); | 2021 | INIT_DELAYED_WORK(&endp->scheduler, u132_hcd_endp_work_scheduler); |
2036 | spin_lock_init(&endp->queue_lock.slock); | 2022 | spin_lock_init(&endp->queue_lock.slock); |
2037 | INIT_LIST_HEAD(&endp->urb_more); | 2023 | INIT_LIST_HEAD(&endp->urb_more); |
2038 | endp->dequeueing = 0; | 2024 | endp->dequeueing = 0; |
@@ -2117,7 +2103,7 @@ static int create_endpoint_and_queue_control(struct u132 *u132, | |||
2117 | if (!endp) { | 2103 | if (!endp) { |
2118 | return -ENOMEM; | 2104 | return -ENOMEM; |
2119 | } | 2105 | } |
2120 | INIT_WORK(&endp->scheduler, u132_hcd_endp_work_scheduler, (void *)endp); | 2106 | INIT_DELAYED_WORK(&endp->scheduler, u132_hcd_endp_work_scheduler); |
2121 | spin_lock_init(&endp->queue_lock.slock); | 2107 | spin_lock_init(&endp->queue_lock.slock); |
2122 | INIT_LIST_HEAD(&endp->urb_more); | 2108 | INIT_LIST_HEAD(&endp->urb_more); |
2123 | ring = endp->ring = &u132->ring[0]; | 2109 | ring = endp->ring = &u132->ring[0]; |
@@ -3096,10 +3082,10 @@ static void u132_initialise(struct u132 *u132, struct platform_device *pdev) | |||
3096 | ring->number = rings + 1; | 3082 | ring->number = rings + 1; |
3097 | ring->length = 0; | 3083 | ring->length = 0; |
3098 | ring->curr_endp = NULL; | 3084 | ring->curr_endp = NULL; |
3099 | INIT_WORK(&ring->scheduler, u132_hcd_ring_work_scheduler, | 3085 | INIT_DELAYED_WORK(&ring->scheduler, |
3100 | (void *)ring); | 3086 | u132_hcd_ring_work_scheduler); |
3101 | } down(&u132->sw_lock); | 3087 | } down(&u132->sw_lock); |
3102 | INIT_WORK(&u132->monitor, u132_hcd_monitor_work, (void *)u132); | 3088 | INIT_DELAYED_WORK(&u132->monitor, u132_hcd_monitor_work); |
3103 | while (ports-- > 0) { | 3089 | while (ports-- > 0) { |
3104 | struct u132_port *port = &u132->port[ports]; | 3090 | struct u132_port *port = &u132->port[ports]; |
3105 | port->u132 = u132; | 3091 | port->u132 = u132; |
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index a49644b7c58e..4295bab4f1e2 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 or clear a halt */ | 971 | /* Workqueue routine to reset the device or clear a halt */ |
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 = 0; | 976 | int rc_lock, rc = 0; |
976 | 977 | ||
977 | if (test_bit(HID_CLEAR_HALT, &hid->iofl)) { | 978 | if (test_bit(HID_CLEAR_HALT, &hid->iofl)) { |
@@ -2043,7 +2044,7 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
2043 | 2044 | ||
2044 | init_waitqueue_head(&hid->wait); | 2045 | init_waitqueue_head(&hid->wait); |
2045 | 2046 | ||
2046 | INIT_WORK(&hid->reset_work, hid_reset, hid); | 2047 | INIT_WORK(&hid->reset_work, hid_reset); |
2047 | setup_timer(&hid->io_retry, hid_retry_timeout, (unsigned long) hid); | 2048 | setup_timer(&hid->io_retry, hid_retry_timeout, (unsigned long) hid); |
2048 | 2049 | ||
2049 | spin_lock_init(&hid->inlock); | 2050 | spin_lock_init(&hid->inlock); |
diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c index ba30ca6a14aa..02cbb7fff24f 100644 --- a/drivers/usb/misc/appledisplay.c +++ b/drivers/usb/misc/appledisplay.c | |||
@@ -76,7 +76,7 @@ struct appledisplay { | |||
76 | char *urbdata; /* interrupt URB data buffer */ | 76 | char *urbdata; /* interrupt URB data buffer */ |
77 | char *msgdata; /* control message data buffer */ | 77 | char *msgdata; /* control message data buffer */ |
78 | 78 | ||
79 | struct work_struct work; | 79 | struct delayed_work work; |
80 | int button_pressed; | 80 | int button_pressed; |
81 | spinlock_t lock; | 81 | spinlock_t lock; |
82 | }; | 82 | }; |
@@ -117,7 +117,7 @@ static void appledisplay_complete(struct urb *urb) | |||
117 | case ACD_BTN_BRIGHT_UP: | 117 | case ACD_BTN_BRIGHT_UP: |
118 | case ACD_BTN_BRIGHT_DOWN: | 118 | case ACD_BTN_BRIGHT_DOWN: |
119 | pdata->button_pressed = 1; | 119 | pdata->button_pressed = 1; |
120 | queue_work(wq, &pdata->work); | 120 | queue_delayed_work(wq, &pdata->work, 0); |
121 | break; | 121 | break; |
122 | case ACD_BTN_NONE: | 122 | case ACD_BTN_NONE: |
123 | default: | 123 | default: |
@@ -184,9 +184,10 @@ static struct backlight_properties appledisplay_bl_data = { | |||
184 | .max_brightness = 0xFF | 184 | .max_brightness = 0xFF |
185 | }; | 185 | }; |
186 | 186 | ||
187 | static void appledisplay_work(void *private) | 187 | static void appledisplay_work(struct work_struct *work) |
188 | { | 188 | { |
189 | struct appledisplay *pdata = private; | 189 | struct appledisplay *pdata = |
190 | container_of(work, struct appledisplay, work.work); | ||
190 | int retval; | 191 | int retval; |
191 | 192 | ||
192 | up(&pdata->bd->sem); | 193 | up(&pdata->bd->sem); |
@@ -238,7 +239,7 @@ static int appledisplay_probe(struct usb_interface *iface, | |||
238 | pdata->udev = udev; | 239 | pdata->udev = udev; |
239 | 240 | ||
240 | spin_lock_init(&pdata->lock); | 241 | spin_lock_init(&pdata->lock); |
241 | INIT_WORK(&pdata->work, appledisplay_work, pdata); | 242 | INIT_DELAYED_WORK(&pdata->work, appledisplay_work); |
242 | 243 | ||
243 | /* Allocate buffer for control messages */ | 244 | /* Allocate buffer for control messages */ |
244 | pdata->msgdata = kmalloc(ACD_MSG_BUFFER_LEN, GFP_KERNEL); | 245 | pdata->msgdata = kmalloc(ACD_MSG_BUFFER_LEN, GFP_KERNEL); |
diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c index cb0ba3107d7f..18b1925032a8 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); |
@@ -2677,12 +2650,9 @@ static int ftdi_elan_probe(struct usb_interface *interface, | |||
2677 | ftdi->class = NULL; | 2650 | ftdi->class = NULL; |
2678 | dev_info(&ftdi->udev->dev, "USB FDTI=%p ELAN interface %d now a" | 2651 | dev_info(&ftdi->udev->dev, "USB FDTI=%p ELAN interface %d now a" |
2679 | "ctivated\n", ftdi, iface_desc->desc.bInterfaceNumber); | 2652 | "ctivated\n", ftdi, iface_desc->desc.bInterfaceNumber); |
2680 | INIT_WORK(&ftdi->status_work, ftdi_elan_status_work, | 2653 | INIT_DELAYED_WORK(&ftdi->status_work, ftdi_elan_status_work); |
2681 | (void *)ftdi); | 2654 | INIT_DELAYED_WORK(&ftdi->command_work, ftdi_elan_command_work); |
2682 | INIT_WORK(&ftdi->command_work, ftdi_elan_command_work, | 2655 | INIT_DELAYED_WORK(&ftdi->respond_work, ftdi_elan_respond_work); |
2683 | (void *)ftdi); | ||
2684 | INIT_WORK(&ftdi->respond_work, ftdi_elan_respond_work, | ||
2685 | (void *)ftdi); | ||
2686 | ftdi_status_queue_work(ftdi, msecs_to_jiffies(3 *1000)); | 2656 | ftdi_status_queue_work(ftdi, msecs_to_jiffies(3 *1000)); |
2687 | return 0; | 2657 | return 0; |
2688 | } else { | 2658 | } else { |
diff --git a/drivers/usb/misc/phidgetkit.c b/drivers/usb/misc/phidgetkit.c index 9110793f81d3..9659c79e187e 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 c3469b0a67c2..2bb4fa572bb7 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 69eb0db399df..b5690b3834e3 100644 --- a/drivers/usb/net/pegasus.c +++ b/drivers/usb/net/pegasus.c | |||
@@ -1281,9 +1281,9 @@ static inline void setup_pegasus_II(pegasus_t * pegasus) | |||
1281 | static struct workqueue_struct *pegasus_workqueue = NULL; | 1281 | static struct workqueue_struct *pegasus_workqueue = NULL; |
1282 | #define CARRIER_CHECK_DELAY (2 * HZ) | 1282 | #define CARRIER_CHECK_DELAY (2 * HZ) |
1283 | 1283 | ||
1284 | static void check_carrier(void *data) | 1284 | static void check_carrier(struct work_struct *work) |
1285 | { | 1285 | { |
1286 | pegasus_t *pegasus = data; | 1286 | pegasus_t *pegasus = container_of(work, pegasus_t, carrier_check.work); |
1287 | set_carrier(pegasus->net); | 1287 | set_carrier(pegasus->net); |
1288 | if (!(pegasus->flags & PEGASUS_UNPLUG)) { | 1288 | if (!(pegasus->flags & PEGASUS_UNPLUG)) { |
1289 | queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check, | 1289 | queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check, |
@@ -1319,7 +1319,7 @@ static int pegasus_probe(struct usb_interface *intf, | |||
1319 | 1319 | ||
1320 | tasklet_init(&pegasus->rx_tl, rx_fixup, (unsigned long) pegasus); | 1320 | tasklet_init(&pegasus->rx_tl, rx_fixup, (unsigned long) pegasus); |
1321 | 1321 | ||
1322 | INIT_WORK(&pegasus->carrier_check, check_carrier, pegasus); | 1322 | INIT_DELAYED_WORK(&pegasus->carrier_check, check_carrier); |
1323 | 1323 | ||
1324 | pegasus->intf = intf; | 1324 | pegasus->intf = intf; |
1325 | pegasus->usb = dev; | 1325 | 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 7672e11c94c4..327f97555679 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 b1b5707bc99a..86bcf63b6ba5 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; |
@@ -349,7 +351,8 @@ static int aircable_attach (struct usb_serial *serial) | |||
349 | } | 351 | } |
350 | 352 | ||
351 | priv->rx_flags &= ~(THROTTLED | ACTUALLY_THROTTLED); | 353 | priv->rx_flags &= ~(THROTTLED | ACTUALLY_THROTTLED); |
352 | INIT_WORK(&priv->rx_work, aircable_read, port); | 354 | priv->port = port; |
355 | INIT_WORK(&priv->rx_work, aircable_read); | ||
353 | 356 | ||
354 | usb_set_serial_port_data(serial->port[0], priv); | 357 | usb_set_serial_port_data(serial->port[0], priv); |
355 | 358 | ||
@@ -516,7 +519,7 @@ static void aircable_read_bulk_callback(struct urb *urb) | |||
516 | package_length - shift); | 519 | package_length - shift); |
517 | } | 520 | } |
518 | } | 521 | } |
519 | aircable_read(port); | 522 | aircable_read(&priv->rx_work); |
520 | } | 523 | } |
521 | 524 | ||
522 | /* Schedule the next read _if_ we are still open */ | 525 | /* 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 5e3ac281a2f8..83d0e21145b0 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 89ce2775be15..72e4d48f51e9 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) { |
@@ -1640,17 +1642,18 @@ static void ftdi_read_bulk_callback (struct urb *urb) | |||
1640 | priv->rx_bytes += countread; | 1642 | priv->rx_bytes += countread; |
1641 | spin_unlock_irqrestore(&priv->rx_lock, flags); | 1643 | spin_unlock_irqrestore(&priv->rx_lock, flags); |
1642 | 1644 | ||
1643 | ftdi_process_read(port); | 1645 | ftdi_process_read(&priv->rx_work.work); |
1644 | 1646 | ||
1645 | } /* ftdi_read_bulk_callback */ | 1647 | } /* ftdi_read_bulk_callback */ |
1646 | 1648 | ||
1647 | 1649 | ||
1648 | static void ftdi_process_read (void *param) | 1650 | static void ftdi_process_read (struct work_struct *work) |
1649 | { /* ftdi_process_read */ | 1651 | { /* ftdi_process_read */ |
1650 | struct usb_serial_port *port = (struct usb_serial_port*)param; | 1652 | struct ftdi_private *priv = |
1653 | container_of(work, struct ftdi_private, rx_work.work); | ||
1654 | struct usb_serial_port *port = priv->port; | ||
1651 | struct urb *urb; | 1655 | struct urb *urb; |
1652 | struct tty_struct *tty; | 1656 | struct tty_struct *tty; |
1653 | struct ftdi_private *priv; | ||
1654 | char error_flag; | 1657 | char error_flag; |
1655 | unsigned char *data; | 1658 | unsigned char *data; |
1656 | 1659 | ||
@@ -2179,7 +2182,7 @@ static void ftdi_unthrottle (struct usb_serial_port *port) | |||
2179 | spin_unlock_irqrestore(&priv->rx_lock, flags); | 2182 | spin_unlock_irqrestore(&priv->rx_lock, flags); |
2180 | 2183 | ||
2181 | if (actually_throttled) | 2184 | if (actually_throttled) |
2182 | schedule_work(&priv->rx_work); | 2185 | schedule_delayed_work(&priv->rx_work, 0); |
2183 | } | 2186 | } |
2184 | 2187 | ||
2185 | static int __init ftdi_init (void) | 2188 | 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 c1257d5292f5..3d5072f14b8d 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; |
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 302174b8e477..31f476a64790 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c | |||
@@ -383,9 +383,9 @@ static void fbcon_update_softback(struct vc_data *vc) | |||
383 | softback_top = 0; | 383 | softback_top = 0; |
384 | } | 384 | } |
385 | 385 | ||
386 | static void fb_flashcursor(void *private) | 386 | static void fb_flashcursor(struct work_struct *work) |
387 | { | 387 | { |
388 | struct fb_info *info = private; | 388 | struct fb_info *info = container_of(work, struct fb_info, queue); |
389 | struct fbcon_ops *ops = info->fbcon_par; | 389 | struct fbcon_ops *ops = info->fbcon_par; |
390 | struct display *p; | 390 | struct display *p; |
391 | struct vc_data *vc = NULL; | 391 | struct vc_data *vc = NULL; |
@@ -442,7 +442,7 @@ static void fbcon_add_cursor_timer(struct fb_info *info) | |||
442 | if ((!info->queue.func || info->queue.func == fb_flashcursor) && | 442 | if ((!info->queue.func || info->queue.func == fb_flashcursor) && |
443 | !(ops->flags & FBCON_FLAGS_CURSOR_TIMER)) { | 443 | !(ops->flags & FBCON_FLAGS_CURSOR_TIMER)) { |
444 | if (!info->queue.func) | 444 | if (!info->queue.func) |
445 | INIT_WORK(&info->queue, fb_flashcursor, info); | 445 | INIT_WORK(&info->queue, fb_flashcursor); |
446 | 446 | ||
447 | init_timer(&ops->cursor_timer); | 447 | init_timer(&ops->cursor_timer); |
448 | ops->cursor_timer.function = cursor_timer_handler; | 448 | ops->cursor_timer.function = cursor_timer_handler; |
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index 8a8ae55a7403..38eb0b69c2d7 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c | |||
@@ -964,9 +964,10 @@ static void set_ctrlr_state(struct pxafb_info *fbi, u_int state) | |||
964 | * Our LCD controller task (which is called when we blank or unblank) | 964 | * Our LCD controller task (which is called when we blank or unblank) |
965 | * via keventd. | 965 | * via keventd. |
966 | */ | 966 | */ |
967 | static void pxafb_task(void *dummy) | 967 | static void pxafb_task(struct work_struct *work) |
968 | { | 968 | { |
969 | struct pxafb_info *fbi = dummy; | 969 | struct pxafb_info *fbi = |
970 | container_of(work, struct pxafb_info, task); | ||
970 | u_int state = xchg(&fbi->task_state, -1); | 971 | u_int state = xchg(&fbi->task_state, -1); |
971 | 972 | ||
972 | set_ctrlr_state(fbi, state); | 973 | set_ctrlr_state(fbi, state); |
@@ -1159,7 +1160,7 @@ static struct pxafb_info * __init pxafb_init_fbinfo(struct device *dev) | |||
1159 | } | 1160 | } |
1160 | 1161 | ||
1161 | init_waitqueue_head(&fbi->ctrlr_wait); | 1162 | init_waitqueue_head(&fbi->ctrlr_wait); |
1162 | INIT_WORK(&fbi->task, pxafb_task, fbi); | 1163 | INIT_WORK(&fbi->task, pxafb_task); |
1163 | init_MUTEX(&fbi->ctrlr_sem); | 1164 | init_MUTEX(&fbi->ctrlr_sem); |
1164 | 1165 | ||
1165 | return fbi; | 1166 | return fbi; |