diff options
author | Nishanth Aravamudan <nacc@us.ibm.com> | 2005-06-25 23:59:33 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-26 01:25:10 +0200 |
commit | 6a72c7ba2e6df945484d7a85d7a82237270957fd (patch) | |
tree | dd7e38b01a73e8d0c5a56b3f786700c842c1b1a3 /drivers/serial/68328serial.c | |
parent | [PATCH] serial/68360serial: replace schedule_timeout() with msleep_interrupti... (diff) | |
download | linux-6a72c7ba2e6df945484d7a85d7a82237270957fd.tar.xz linux-6a72c7ba2e6df945484d7a85d7a82237270957fd.zip |
[PATCH] serial/68328serial: replace schedule_timeout() with msleep_interruptible()
Use msleep_interruptible() instead of schedule_timeout() in send_break() to
guarantee the task delays as expected. Change @duration's units to
milliseconds, and modify arguments in callers appropriately.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/serial/68328serial.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/serial/68328serial.c b/drivers/serial/68328serial.c index db92a0ceda79..feb8e73fc1c9 100644 --- a/drivers/serial/68328serial.c +++ b/drivers/serial/68328serial.c @@ -992,18 +992,17 @@ static int get_lsr_info(struct m68k_serial * info, unsigned int *value) /* * This routine sends a break character out the serial port. */ -static void send_break( struct m68k_serial * info, int duration) +static void send_break(struct m68k_serial * info, unsigned int duration) { m68328_uart *uart = &uart_addr[info->line]; unsigned long flags; if (!info->port) return; - set_current_state(TASK_INTERRUPTIBLE); save_flags(flags); cli(); #ifdef USE_INTS uart->utx.w |= UTX_SEND_BREAK; - schedule_timeout(duration); + msleep_interruptible(duration); uart->utx.w &= ~UTX_SEND_BREAK; #endif restore_flags(flags); @@ -1033,14 +1032,14 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file, return retval; tty_wait_until_sent(tty, 0); if (!arg) - send_break(info, HZ/4); /* 1/4 second */ + send_break(info, 250); /* 1/4 second */ return 0; case TCSBRKP: /* support for POSIX tcsendbreak() */ retval = tty_check_change(tty); if (retval) return retval; tty_wait_until_sent(tty, 0); - send_break(info, arg ? arg*(HZ/10) : HZ/4); + send_break(info, arg ? arg*(100) : 250); return 0; case TIOCGSOFTCAR: error = put_user(C_CLOCAL(tty) ? 1 : 0, |