aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/mxser.c
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@us.ibm.com>2005-09-10 03:27:30 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-10 13:06:38 -0400
commitda4cd8dfe18ee901b880f94ca0fa79d5cc1cd0eb (patch)
tree7f135b3c3d9450e3b489cd39af6085e338013613 /drivers/char/mxser.c
parent2ddee1b7a732dc96d479afaa7d0a26aa53990089 (diff)
[PATCH] drivers/char: fix-up schedule_timeout() usage
Use schedule_timeout_interruptible() instead of set_current_state()/schedule_timeout() to reduce kernel size. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/mxser.c')
-rw-r--r--drivers/char/mxser.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
index d0ef1ae41298..45d012d85e8c 100644
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -1058,8 +1058,7 @@ static void mxser_close(struct tty_struct *tty, struct file *filp)
1058 */ 1058 */
1059 timeout = jiffies + HZ; 1059 timeout = jiffies + HZ;
1060 while (!(inb(info->base + UART_LSR) & UART_LSR_TEMT)) { 1060 while (!(inb(info->base + UART_LSR) & UART_LSR_TEMT)) {
1061 set_current_state(TASK_INTERRUPTIBLE); 1061 schedule_timeout_interruptible(5);
1062 schedule_timeout(5);
1063 if (time_after(jiffies, timeout)) 1062 if (time_after(jiffies, timeout))
1064 break; 1063 break;
1065 } 1064 }
@@ -1080,10 +1079,8 @@ static void mxser_close(struct tty_struct *tty, struct file *filp)
1080 info->event = 0; 1079 info->event = 0;
1081 info->tty = NULL; 1080 info->tty = NULL;
1082 if (info->blocked_open) { 1081 if (info->blocked_open) {
1083 if (info->close_delay) { 1082 if (info->close_delay)
1084 set_current_state(TASK_INTERRUPTIBLE); 1083 schedule_timeout_interruptible(info->close_delay);
1085 schedule_timeout(info->close_delay);
1086 }
1087 wake_up_interruptible(&info->open_wait); 1084 wake_up_interruptible(&info->open_wait);
1088 } 1085 }
1089 1086
@@ -1801,8 +1798,7 @@ static void mxser_wait_until_sent(struct tty_struct *tty, int timeout)
1801#ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT 1798#ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT
1802 printk("lsr = %d (jiff=%lu)...", lsr, jiffies); 1799 printk("lsr = %d (jiff=%lu)...", lsr, jiffies);
1803#endif 1800#endif
1804 set_current_state(TASK_INTERRUPTIBLE); 1801 schedule_timeout_interruptible(char_time);
1805 schedule_timeout(char_time);
1806 if (signal_pending(current)) 1802 if (signal_pending(current))
1807 break; 1803 break;
1808 if (timeout && time_after(jiffies, orig_jiffies + timeout)) 1804 if (timeout && time_after(jiffies, orig_jiffies + timeout))