aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/cyclades.c9
-rw-r--r--drivers/char/drm/via_dmablit.c6
-rw-r--r--drivers/char/epca.c8
-rw-r--r--drivers/char/esp.c14
-rw-r--r--drivers/char/genrtc.c4
-rw-r--r--drivers/char/hvsi.c16
-rw-r--r--drivers/char/ip2/i2lib.c12
-rw-r--r--drivers/char/ip2/ip2main.c23
-rw-r--r--drivers/char/isicom.c12
-rw-r--r--drivers/char/istallion.c8
-rw-r--r--drivers/char/moxa.c8
-rw-r--r--drivers/char/mxser.c9
-rw-r--r--drivers/char/pcmcia/synclink_cs.c8
-rw-r--r--drivers/char/random.c6
-rw-r--r--drivers/char/riscom8.c12
-rw-r--r--drivers/char/serial167.c6
-rw-r--r--drivers/char/sonypi.c4
-rw-r--r--drivers/char/specialix.c14
-rw-r--r--drivers/char/stallion.c10
-rw-r--r--drivers/char/synclink.c9
-rw-r--r--drivers/char/synclink_gt.c10
-rw-r--r--drivers/char/synclinkmp.c8
-rw-r--r--drivers/char/sysrq.c4
-rw-r--r--drivers/char/tpm/tpm.c6
-rw-r--r--drivers/char/tty_io.c31
-rw-r--r--drivers/char/vt.c6
26 files changed, 137 insertions, 126 deletions
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 */
928static void 928static void
929do_softint(void *private_) 929do_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
502static void 502static void
503via_dmablit_workqueue(void *data) 503via_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 *,
200static int info_ioctl(struct tty_struct *, struct file *, 200static int info_ioctl(struct tty_struct *, struct file *,
201 unsigned int, unsigned long); 201 unsigned int, unsigned long);
202static void pc_set_termios(struct tty_struct *, struct termios *); 202static void pc_set_termios(struct tty_struct *, struct termios *);
203static void do_softint(void *); 203static void do_softint(struct work_struct *work);
204static void pc_stop(struct tty_struct *); 204static void pc_stop(struct tty_struct *);
205static void pc_start(struct tty_struct *); 205static void pc_start(struct tty_struct *);
206static void pc_throttle(struct tty_struct * tty); 206static 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
2569static void do_softint(void *private_) 2569static 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
726static void do_softint(void *private_) 726static 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 */
749static void do_serial_hangup(void *private_) 750static 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 */
105static void genrtc_troutine(void *data) 105static 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
71struct hvsi_struct { 71struct 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
747static void hvsi_handshaker(void *arg) 747static 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 */
954static void hvsi_write_worker(void *arg) 955static 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);
84static void serviceOutgoingFifo(i2eBordStrPtr); 84static 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
87static void do_input(void *); 87static void do_input(struct work_struct *);
88static void do_status(void *); 88static 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
191static void set_irq(int, int); 191static void set_irq(int, int);
192static void ip2_interrupt_bh(i2eBordStrPtr pB); 192static void ip2_interrupt_bh(struct work_struct *work);
193static irqreturn_t ip2_interrupt(int irq, void *dev_id); 193static irqreturn_t ip2_interrupt(int irq, void *dev_id);
194static void ip2_poll(unsigned long arg); 194static void ip2_poll(unsigned long arg);
195static inline void service_all_boards(void); 195static inline void service_all_boards(void);
196static void do_input(void *p); 196static void do_input(struct work_struct *);
197static void do_status(void *p); 197static void do_status(struct work_struct *);
198 198
199static void ip2_wait_until_sent(PTTY,int); 199static void ip2_wait_until_sent(PTTY,int);
200 200
@@ -918,7 +918,7 @@ ip2_init_board( int boardnum )
918 pCh++; 918 pCh++;
919 } 919 }
920ex_exit: 920ex_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
924err_release_region: 924err_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/******************************************************************************/
1137static void 1137static void
1138ip2_interrupt_bh(i2eBordStrPtr pB) 1138ip2_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
1248static void do_input(void *p) 1249static 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
1282static void do_status(void *p) 1283static 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
533static void isicom_bottomhalf(void *data) 533static 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 */
1477static void do_isicom_hangup(void *data) 1477static 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/istallion.c b/drivers/char/istallion.c
index ffdf9df1a67a..bd9195e17956 100644
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -663,7 +663,7 @@ static int stli_initopen(stlibrd_t *brdp, stliport_t *portp);
663static int stli_rawopen(stlibrd_t *brdp, stliport_t *portp, unsigned long arg, int wait); 663static int stli_rawopen(stlibrd_t *brdp, stliport_t *portp, unsigned long arg, int wait);
664static int stli_rawclose(stlibrd_t *brdp, stliport_t *portp, unsigned long arg, int wait); 664static int stli_rawclose(stlibrd_t *brdp, stliport_t *portp, unsigned long arg, int wait);
665static int stli_waitcarrier(stlibrd_t *brdp, stliport_t *portp, struct file *filp); 665static int stli_waitcarrier(stlibrd_t *brdp, stliport_t *portp, struct file *filp);
666static void stli_dohangup(void *arg); 666static void stli_dohangup(struct work_struct *);
667static int stli_setport(stliport_t *portp); 667static int stli_setport(stliport_t *portp);
668static int stli_cmdwait(stlibrd_t *brdp, stliport_t *portp, unsigned long cmd, void *arg, int size, int copyback); 668static int stli_cmdwait(stlibrd_t *brdp, stliport_t *portp, unsigned long cmd, void *arg, int size, int copyback);
669static void stli_sendcmd(stlibrd_t *brdp, stliport_t *portp, unsigned long cmd, void *arg, int size, int copyback); 669static void stli_sendcmd(stlibrd_t *brdp, stliport_t *portp, unsigned long cmd, void *arg, int size, int copyback);
@@ -1990,9 +1990,9 @@ static void stli_start(struct tty_struct *tty)
1990 * aren't that time critical). 1990 * aren't that time critical).
1991 */ 1991 */
1992 1992
1993static void stli_dohangup(void *arg) 1993static void stli_dohangup(struct work_struct *ugly_api)
1994{ 1994{
1995 stliport_t *portp = (stliport_t *) arg; 1995 stliport_t *portp = container_of(ugly_api, stliport_t, tqhangup);
1996 if (portp->tty != NULL) { 1996 if (portp->tty != NULL) {
1997 tty_hangup(portp->tty); 1997 tty_hangup(portp->tty);
1998 } 1998 }
@@ -2898,7 +2898,7 @@ static int stli_initports(stlibrd_t *brdp)
2898 portp->baud_base = STL_BAUDBASE; 2898 portp->baud_base = STL_BAUDBASE;
2899 portp->close_delay = STL_CLOSEDELAY; 2899 portp->close_delay = STL_CLOSEDELAY;
2900 portp->closing_wait = 30 * HZ; 2900 portp->closing_wait = 30 * HZ;
2901 INIT_WORK(&portp->tqhangup, stli_dohangup, portp); 2901 INIT_WORK(&portp->tqhangup, stli_dohangup);
2902 init_waitqueue_head(&portp->open_wait); 2902 init_waitqueue_head(&portp->open_wait);
2903 init_waitqueue_head(&portp->close_wait); 2903 init_waitqueue_head(&portp->close_wait);
2904 init_waitqueue_head(&portp->raw_wait); 2904 init_waitqueue_head(&portp->raw_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 */
225static void do_moxa_softint(void *); 225static void do_moxa_softint(struct work_struct *);
226static int moxa_open(struct tty_struct *, struct file *); 226static int moxa_open(struct tty_struct *, struct file *);
227static void moxa_close(struct tty_struct *, struct file *); 227static void moxa_close(struct tty_struct *, struct file *);
228static int moxa_write(struct tty_struct *, const unsigned char *, int); 228static 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)
509module_init(moxa_init); 509module_init(moxa_init);
510module_exit(moxa_exit); 510module_exit(moxa_exit);
511 511
512static void do_moxa_softint(void *private_) 512static 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); */
390static int mxser_get_ISA_conf(int, struct mxser_hwconf *); 390static int mxser_get_ISA_conf(int, struct mxser_hwconf *);
391static int mxser_get_PCI_conf(int, int, int, struct mxser_hwconf *); 391static int mxser_get_PCI_conf(int, int, int, struct mxser_hwconf *);
392static void mxser_do_softint(void *); 392static void mxser_do_softint(struct work_struct *);
393static int mxser_open(struct tty_struct *, struct file *); 393static int mxser_open(struct tty_struct *, struct file *);
394static void mxser_close(struct tty_struct *, struct file *); 394static void mxser_close(struct tty_struct *, struct file *);
395static int mxser_write(struct tty_struct *, const unsigned char *, int); 395static 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
920static void mxser_do_softint(void *private_) 920static 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 */
424static void bh_handler(void* Context); 424static void bh_handler(struct work_struct *work);
425static void bh_transmit(MGSLPC_INFO *info); 425static void bh_transmit(MGSLPC_INFO *info);
426static void bh_status(MGSLPC_INFO *info); 426static 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
838static void bh_handler(void* Context) 838static 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
1423static unsigned int ip_cnt; 1423static unsigned int ip_cnt;
1424 1424
1425static void rekey_seq_generator(void *private_); 1425static void rekey_seq_generator(struct work_struct *work);
1426 1426
1427static DECLARE_WORK(rekey_work, rekey_seq_generator, NULL); 1427static 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 */
1441static void rekey_seq_generator(void *private_) 1441static 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/riscom8.c b/drivers/char/riscom8.c
index 5ab32b38f45a..722dd3e74185 100644
--- a/drivers/char/riscom8.c
+++ b/drivers/char/riscom8.c
@@ -1516,9 +1516,9 @@ static void rc_start(struct tty_struct * tty)
1516 * do_rc_hangup() -> tty->hangup() -> rc_hangup() 1516 * do_rc_hangup() -> tty->hangup() -> rc_hangup()
1517 * 1517 *
1518 */ 1518 */
1519static void do_rc_hangup(void *private_) 1519static void do_rc_hangup(struct work_struct *ugly_api)
1520{ 1520{
1521 struct riscom_port *port = (struct riscom_port *) private_; 1521 struct riscom_port *port = container_of(ugly_api, struct riscom_port, tqueue_hangup);
1522 struct tty_struct *tty; 1522 struct tty_struct *tty;
1523 1523
1524 tty = port->tty; 1524 tty = port->tty;
@@ -1567,9 +1567,9 @@ static void rc_set_termios(struct tty_struct * tty, struct termios * old_termios
1567 } 1567 }
1568} 1568}
1569 1569
1570static void do_softint(void *private_) 1570static void do_softint(struct work_struct *ugly_api)
1571{ 1571{
1572 struct riscom_port *port = (struct riscom_port *) private_; 1572 struct riscom_port *port = container_of(ugly_api, struct riscom_port, tqueue);
1573 struct tty_struct *tty; 1573 struct tty_struct *tty;
1574 1574
1575 if(!(tty = port->tty)) 1575 if(!(tty = port->tty))
@@ -1632,8 +1632,8 @@ static inline int rc_init_drivers(void)
1632 memset(rc_port, 0, sizeof(rc_port)); 1632 memset(rc_port, 0, sizeof(rc_port));
1633 for (i = 0; i < RC_NPORT * RC_NBOARD; i++) { 1633 for (i = 0; i < RC_NPORT * RC_NBOARD; i++) {
1634 rc_port[i].magic = RISCOM8_MAGIC; 1634 rc_port[i].magic = RISCOM8_MAGIC;
1635 INIT_WORK(&rc_port[i].tqueue, do_softint, &rc_port[i]); 1635 INIT_WORK(&rc_port[i].tqueue, do_softint);
1636 INIT_WORK(&rc_port[i].tqueue_hangup, do_rc_hangup, &rc_port[i]); 1636 INIT_WORK(&rc_port[i].tqueue_hangup, do_rc_hangup);
1637 rc_port[i].close_delay = 50 * HZ/100; 1637 rc_port[i].close_delay = 50 * HZ/100;
1638 rc_port[i].closing_wait = 3000 * HZ/100; 1638 rc_port[i].closing_wait = 3000 * HZ/100;
1639 init_waitqueue_head(&rc_port[i].open_wait); 1639 init_waitqueue_head(&rc_port[i].open_wait);
diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c
index 3af7f0958c5d..9ba13af234be 100644
--- a/drivers/char/serial167.c
+++ b/drivers/char/serial167.c
@@ -706,9 +706,9 @@ cd2401_rx_interrupt(int irq, void *dev_id)
706 * had to poll every port to see if that port needed servicing. 706 * had to poll every port to see if that port needed servicing.
707 */ 707 */
708static void 708static void
709do_softint(void *private_) 709do_softint(struct work_struct *ugly_api)
710{ 710{
711 struct cyclades_port *info = (struct cyclades_port *) private_; 711 struct cyclades_port *info = container_of(ugly_api, struct cyclades_port, tqueue);
712 struct tty_struct *tty; 712 struct tty_struct *tty;
713 713
714 tty = info->tty; 714 tty = info->tty;
@@ -2273,7 +2273,7 @@ scrn[1] = '\0';
2273 info->blocked_open = 0; 2273 info->blocked_open = 0;
2274 info->default_threshold = 0; 2274 info->default_threshold = 0;
2275 info->default_timeout = 0; 2275 info->default_timeout = 0;
2276 INIT_WORK(&info->tqueue, do_softint, info); 2276 INIT_WORK(&info->tqueue, do_softint);
2277 init_waitqueue_head(&info->open_wait); 2277 init_waitqueue_head(&info->open_wait);
2278 init_waitqueue_head(&info->close_wait); 2278 init_waitqueue_head(&info->close_wait);
2279 /* info->session */ 2279 /* info->session */
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
768static void input_keyrelease(void *data) 768static 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 */
2264static void do_sx_hangup(void *private_) 2264static 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
2339static void do_softint(void *private_) 2340static 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/stallion.c b/drivers/char/stallion.c
index 522e88e395cc..5e2de62bce70 100644
--- a/drivers/char/stallion.c
+++ b/drivers/char/stallion.c
@@ -500,7 +500,7 @@ static int stl_echatintr(stlbrd_t *brdp);
500static int stl_echmcaintr(stlbrd_t *brdp); 500static int stl_echmcaintr(stlbrd_t *brdp);
501static int stl_echpciintr(stlbrd_t *brdp); 501static int stl_echpciintr(stlbrd_t *brdp);
502static int stl_echpci64intr(stlbrd_t *brdp); 502static int stl_echpci64intr(stlbrd_t *brdp);
503static void stl_offintr(void *private); 503static void stl_offintr(struct work_struct *);
504static stlbrd_t *stl_allocbrd(void); 504static stlbrd_t *stl_allocbrd(void);
505static stlport_t *stl_getport(int brdnr, int panelnr, int portnr); 505static stlport_t *stl_getport(int brdnr, int panelnr, int portnr);
506 506
@@ -2081,14 +2081,12 @@ static int stl_echpci64intr(stlbrd_t *brdp)
2081/* 2081/*
2082 * Service an off-level request for some channel. 2082 * Service an off-level request for some channel.
2083 */ 2083 */
2084static void stl_offintr(void *private) 2084static void stl_offintr(struct work_struct *work)
2085{ 2085{
2086 stlport_t *portp; 2086 stlport_t *portp = container_of(work, stlport_t, tqueue);
2087 struct tty_struct *tty; 2087 struct tty_struct *tty;
2088 unsigned int oldsigs; 2088 unsigned int oldsigs;
2089 2089
2090 portp = private;
2091
2092#ifdef DEBUG 2090#ifdef DEBUG
2093 printk("stl_offintr(portp=%x)\n", (int) portp); 2091 printk("stl_offintr(portp=%x)\n", (int) portp);
2094#endif 2092#endif
@@ -2156,7 +2154,7 @@ static int __init stl_initports(stlbrd_t *brdp, stlpanel_t *panelp)
2156 portp->baud_base = STL_BAUDBASE; 2154 portp->baud_base = STL_BAUDBASE;
2157 portp->close_delay = STL_CLOSEDELAY; 2155 portp->close_delay = STL_CLOSEDELAY;
2158 portp->closing_wait = 30 * HZ; 2156 portp->closing_wait = 30 * HZ;
2159 INIT_WORK(&portp->tqueue, stl_offintr, portp); 2157 INIT_WORK(&portp->tqueue, stl_offintr);
2160 init_waitqueue_head(&portp->open_wait); 2158 init_waitqueue_head(&portp->open_wait);
2161 init_waitqueue_head(&portp->close_wait); 2159 init_waitqueue_head(&portp->close_wait);
2162 portp->stats.brd = portp->brdnr; 2160 portp->stats.brd = portp->brdnr;
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 */
805static void mgsl_bh_handler(void* Context); 805static void mgsl_bh_handler(struct work_struct *work);
806static void mgsl_bh_receive(struct mgsl_struct *info); 806static void mgsl_bh_receive(struct mgsl_struct *info);
807static void mgsl_bh_transmit(struct mgsl_struct *info); 807static void mgsl_bh_transmit(struct mgsl_struct *info);
808static void mgsl_bh_status(struct mgsl_struct *info); 808static 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 */
1074static void mgsl_bh_handler(void* Context) 1074static 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);
485static void set_rate(struct slgt_info *info, u32 data_rate); 485static void set_rate(struct slgt_info *info, u32 data_rate);
486 486
487static int bh_action(struct slgt_info *info); 487static int bh_action(struct slgt_info *info);
488static void bh_handler(void* context); 488static void bh_handler(struct work_struct *work);
489static void bh_transmit(struct slgt_info *info); 489static void bh_transmit(struct slgt_info *info);
490static void isr_serial(struct slgt_info *info); 490static void isr_serial(struct slgt_info *info);
491static void isr_rdma(struct slgt_info *info); 491static 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 */
1881static void bh_handler(void* context) 1881static 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);
602static void set_rate(SLMP_INFO *info, u32 data_rate); 602static void set_rate(SLMP_INFO *info, u32 data_rate);
603 603
604static int bh_action(SLMP_INFO *info); 604static int bh_action(SLMP_INFO *info);
605static void bh_handler(void* Context); 605static void bh_handler(struct work_struct *work);
606static void bh_receive(SLMP_INFO *info); 606static void bh_receive(SLMP_INFO *info);
607static void bh_transmit(SLMP_INFO *info); 607static void bh_transmit(SLMP_INFO *info);
608static void bh_status(SLMP_INFO *info); 608static 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 */
2066void bh_handler(void* Context) 2066void 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
222static void moom_callback(void *ignored) 222static 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
228static DECLARE_WORK(moom_work, moom_callback, NULL); 228static DECLARE_WORK(moom_work, moom_callback);
229 229
230static void sysrq_handle_moom(int key, struct tty_struct *tty) 230static 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
328static void timeout_work(void *ptr) 328static 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 */
1277static void do_tty_hangup(void *data) 1277static 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}
1438EXPORT_SYMBOL(tty_vhangup); 1439EXPORT_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 */
3307static void __do_SAK(void *arg) 3308static 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
3409static void flush_to_ldisc(void *private_) 3411static 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);
155static void set_vesa_blanking(char __user *p); 155static void set_vesa_blanking(char __user *p);
156static void set_cursor(struct vc_data *vc); 156static void set_cursor(struct vc_data *vc);
157static void hide_cursor(struct vc_data *vc); 157static void hide_cursor(struct vc_data *vc);
158static void console_callback(void *ignored); 158static void console_callback(struct work_struct *ignored);
159static void blank_screen_t(unsigned long dummy); 159static void blank_screen_t(unsigned long dummy);
160static void set_palette(struct vc_data *vc); 160static 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 */
174static int blankinterval = 10*60*HZ; 174static int blankinterval = 10*60*HZ;
175static int vesa_off_interval; 175static int vesa_off_interval;
176 176
177static DECLARE_WORK(console_work, console_callback, NULL); 177static 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 */
2157static void console_callback(void *ignored) 2157static void console_callback(struct work_struct *ignored)
2158{ 2158{
2159 acquire_console_sem(); 2159 acquire_console_sem();
2160 2160