aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@us.ibm.com>2005-06-25 17:59:33 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-25 19:25:10 -0400
commit6a72c7ba2e6df945484d7a85d7a82237270957fd (patch)
treedd7e38b01a73e8d0c5a56b3f786700c842c1b1a3 /drivers
parent5d582b4ef6df853ca2da46135855cd6536c0205b (diff)
[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 'drivers')
-rw-r--r--drivers/serial/68328serial.c9
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)
992/* 992/*
993 * This routine sends a break character out the serial port. 993 * This routine sends a break character out the serial port.
994 */ 994 */
995static void send_break( struct m68k_serial * info, int duration) 995static void send_break(struct m68k_serial * info, unsigned int duration)
996{ 996{
997 m68328_uart *uart = &uart_addr[info->line]; 997 m68328_uart *uart = &uart_addr[info->line];
998 unsigned long flags; 998 unsigned long flags;
999 if (!info->port) 999 if (!info->port)
1000 return; 1000 return;
1001 set_current_state(TASK_INTERRUPTIBLE);
1002 save_flags(flags); 1001 save_flags(flags);
1003 cli(); 1002 cli();
1004#ifdef USE_INTS 1003#ifdef USE_INTS
1005 uart->utx.w |= UTX_SEND_BREAK; 1004 uart->utx.w |= UTX_SEND_BREAK;
1006 schedule_timeout(duration); 1005 msleep_interruptible(duration);
1007 uart->utx.w &= ~UTX_SEND_BREAK; 1006 uart->utx.w &= ~UTX_SEND_BREAK;
1008#endif 1007#endif
1009 restore_flags(flags); 1008 restore_flags(flags);
@@ -1033,14 +1032,14 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
1033 return retval; 1032 return retval;
1034 tty_wait_until_sent(tty, 0); 1033 tty_wait_until_sent(tty, 0);
1035 if (!arg) 1034 if (!arg)
1036 send_break(info, HZ/4); /* 1/4 second */ 1035 send_break(info, 250); /* 1/4 second */
1037 return 0; 1036 return 0;
1038 case TCSBRKP: /* support for POSIX tcsendbreak() */ 1037 case TCSBRKP: /* support for POSIX tcsendbreak() */
1039 retval = tty_check_change(tty); 1038 retval = tty_check_change(tty);
1040 if (retval) 1039 if (retval)
1041 return retval; 1040 return retval;
1042 tty_wait_until_sent(tty, 0); 1041 tty_wait_until_sent(tty, 0);
1043 send_break(info, arg ? arg*(HZ/10) : HZ/4); 1042 send_break(info, arg ? arg*(100) : 250);
1044 return 0; 1043 return 0;
1045 case TIOCGSOFTCAR: 1044 case TIOCGSOFTCAR:
1046 error = put_user(C_CLOCAL(tty) ? 1 : 0, 1045 error = put_user(C_CLOCAL(tty) ? 1 : 0,