aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@snapgear.com>2007-03-06 20:28:13 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-06 21:08:38 -0500
commit28580df03e18c33dd29af83c23c1d52f3df320f1 (patch)
tree525132f2da71795e34e0d3f007d8a930b728fc79
parentebfcfef44e4a759dd08a4b5e28848787b5530c0c (diff)
[PATCH] m68knommu: fix work queues in mcfserial.c driver
Fix work queue code to support new model. Signed-off-by: Greg Ungerer <gerg@uclinux.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/serial/mcfserial.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/drivers/serial/mcfserial.c b/drivers/serial/mcfserial.c
index 4e2eb351f74e..99af084c7cec 100644
--- a/drivers/serial/mcfserial.c
+++ b/drivers/serial/mcfserial.c
@@ -425,15 +425,13 @@ irqreturn_t mcfrs_interrupt(int irq, void *dev_id)
425 * ------------------------------------------------------------------- 425 * -------------------------------------------------------------------
426 */ 426 */
427 427
428static void mcfrs_offintr(void *private) 428static void mcfrs_offintr(struct work_struct *work)
429{ 429{
430 struct mcf_serial *info = (struct mcf_serial *) private; 430 struct mcf_serial *info = container_of(work, struct mcf_serial, tqueue);
431 struct tty_struct *tty; 431 struct tty_struct *tty = info->tty;
432 432
433 tty = info->tty; 433 if (tty)
434 if (!tty) 434 tty_wakeup(tty);
435 return;
436 tty_wakeup(tty);
437} 435}
438 436
439 437
@@ -497,16 +495,13 @@ static void mcfrs_timer(void)
497 * do_serial_hangup() -> tty->hangup() -> mcfrs_hangup() 495 * do_serial_hangup() -> tty->hangup() -> mcfrs_hangup()
498 * 496 *
499 */ 497 */
500static void do_serial_hangup(void *private) 498static void do_serial_hangup(struct work_struct *work)
501{ 499{
502 struct mcf_serial *info = (struct mcf_serial *) private; 500 struct mcf_serial *info = container_of(work, struct mcf_serial, tqueue_hangup);
503 struct tty_struct *tty; 501 struct tty_struct *tty = info->tty;
504 502
505 tty = info->tty; 503 if (tty)
506 if (!tty) 504 tty_hangup(tty);
507 return;
508
509 tty_hangup(tty);
510} 505}
511 506
512static int startup(struct mcf_serial * info) 507static int startup(struct mcf_serial * info)
@@ -857,7 +852,7 @@ static void mcfrs_throttle(struct tty_struct * tty)
857#ifdef SERIAL_DEBUG_THROTTLE 852#ifdef SERIAL_DEBUG_THROTTLE
858 char buf[64]; 853 char buf[64];
859 854
860 printk("throttle %s: %d....\n", _tty_name(tty, buf), 855 printk("throttle %s: %d....\n", tty_name(tty, buf),
861 tty->ldisc.chars_in_buffer(tty)); 856 tty->ldisc.chars_in_buffer(tty));
862#endif 857#endif
863 858
@@ -876,7 +871,7 @@ static void mcfrs_unthrottle(struct tty_struct * tty)
876#ifdef SERIAL_DEBUG_THROTTLE 871#ifdef SERIAL_DEBUG_THROTTLE
877 char buf[64]; 872 char buf[64];
878 873
879 printk("unthrottle %s: %d....\n", _tty_name(tty, buf), 874 printk("unthrottle %s: %d....\n", tty_name(tty, buf),
880 tty->ldisc.chars_in_buffer(tty)); 875 tty->ldisc.chars_in_buffer(tty));
881#endif 876#endif
882 877
@@ -1790,8 +1785,8 @@ mcfrs_init(void)
1790 info->event = 0; 1785 info->event = 0;
1791 info->count = 0; 1786 info->count = 0;
1792 info->blocked_open = 0; 1787 info->blocked_open = 0;
1793 INIT_WORK(&info->tqueue, mcfrs_offintr, info); 1788 INIT_WORK(&info->tqueue, mcfrs_offintr);
1794 INIT_WORK(&info->tqueue_hangup, do_serial_hangup, info); 1789 INIT_WORK(&info->tqueue_hangup, do_serial_hangup);
1795 init_waitqueue_head(&info->open_wait); 1790 init_waitqueue_head(&info->open_wait);
1796 init_waitqueue_head(&info->close_wait); 1791 init_waitqueue_head(&info->close_wait);
1797 1792