diff options
author | Tejun Heo <tj@kernel.org> | 2011-01-24 11:54:12 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-02-03 17:12:25 -0500 |
commit | 0a1f1a0b626d79071ee9fe91b7fcd28be6332677 (patch) | |
tree | 1768ee10aff61d245d9289c11092baf477ae845d /drivers/tty/tty_ldisc.c | |
parent | 78841462d72fe7038cb7ea48adecc6fc395f2dc5 (diff) |
tty_ldisc: don't use flush_scheduled_work()
flush_scheduled_work() is scheduled to be deprecated. Explicitly sync
flush the used work items instead. Note that before this change,
flush_scheduled_work() wouldn't have properly flushed tty->buf.work if
it were on timer.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/tty/tty_ldisc.c')
-rw-r--r-- | drivers/tty/tty_ldisc.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c index 4214d58276f7..c42f402db9ba 100644 --- a/drivers/tty/tty_ldisc.c +++ b/drivers/tty/tty_ldisc.c | |||
@@ -535,6 +535,19 @@ static int tty_ldisc_halt(struct tty_struct *tty) | |||
535 | } | 535 | } |
536 | 536 | ||
537 | /** | 537 | /** |
538 | * tty_ldisc_flush_works - flush all works of a tty | ||
539 | * @tty: tty device to flush works for | ||
540 | * | ||
541 | * Sync flush all works belonging to @tty. | ||
542 | */ | ||
543 | static void tty_ldisc_flush_works(struct tty_struct *tty) | ||
544 | { | ||
545 | flush_work_sync(&tty->hangup_work); | ||
546 | flush_work_sync(&tty->SAK_work); | ||
547 | flush_delayed_work_sync(&tty->buf.work); | ||
548 | } | ||
549 | |||
550 | /** | ||
538 | * tty_ldisc_wait_idle - wait for the ldisc to become idle | 551 | * tty_ldisc_wait_idle - wait for the ldisc to become idle |
539 | * @tty: tty to wait for | 552 | * @tty: tty to wait for |
540 | * | 553 | * |
@@ -653,7 +666,7 @@ int tty_set_ldisc(struct tty_struct *tty, int ldisc) | |||
653 | 666 | ||
654 | mutex_unlock(&tty->ldisc_mutex); | 667 | mutex_unlock(&tty->ldisc_mutex); |
655 | 668 | ||
656 | flush_scheduled_work(); | 669 | tty_ldisc_flush_works(tty); |
657 | 670 | ||
658 | retval = tty_ldisc_wait_idle(tty); | 671 | retval = tty_ldisc_wait_idle(tty); |
659 | 672 | ||
@@ -905,7 +918,7 @@ void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty) | |||
905 | 918 | ||
906 | tty_unlock(); | 919 | tty_unlock(); |
907 | tty_ldisc_halt(tty); | 920 | tty_ldisc_halt(tty); |
908 | flush_scheduled_work(); | 921 | tty_ldisc_flush_works(tty); |
909 | tty_lock(); | 922 | tty_lock(); |
910 | 923 | ||
911 | mutex_lock(&tty->ldisc_mutex); | 924 | mutex_lock(&tty->ldisc_mutex); |