aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/68328serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial/68328serial.c')
-rw-r--r--drivers/tty/serial/68328serial.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c
index 0c50f2e1ae01..e9fd13ec52a8 100644
--- a/drivers/tty/serial/68328serial.c
+++ b/drivers/tty/serial/68328serial.c
@@ -120,8 +120,6 @@ struct m68k_serial {
120 struct tty_struct *tty; 120 struct tty_struct *tty;
121 int custom_divisor; 121 int custom_divisor;
122 int x_char; /* xon/xoff character */ 122 int x_char; /* xon/xoff character */
123 int close_delay;
124 unsigned short closing_wait;
125 int line; 123 int line;
126 unsigned char *xmit_buf; 124 unsigned char *xmit_buf;
127 int xmit_head; 125 int xmit_head;
@@ -828,8 +826,8 @@ static int get_serial_info(struct m68k_serial * info,
828 tmp.irq = info->irq; 826 tmp.irq = info->irq;
829 tmp.flags = info->flags; 827 tmp.flags = info->flags;
830 tmp.baud_base = info->baud_base; 828 tmp.baud_base = info->baud_base;
831 tmp.close_delay = info->close_delay; 829 tmp.close_delay = info->tport.close_delay;
832 tmp.closing_wait = info->closing_wait; 830 tmp.closing_wait = info->tport.closing_wait;
833 tmp.custom_divisor = info->custom_divisor; 831 tmp.custom_divisor = info->custom_divisor;
834 if (copy_to_user(retinfo, &tmp, sizeof(*retinfo))) 832 if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
835 return -EFAULT; 833 return -EFAULT;
@@ -840,6 +838,7 @@ static int get_serial_info(struct m68k_serial * info,
840static int set_serial_info(struct m68k_serial * info, 838static int set_serial_info(struct m68k_serial * info,
841 struct serial_struct * new_info) 839 struct serial_struct * new_info)
842{ 840{
841 struct tty_port *port = &info->tport;
843 struct serial_struct new_serial; 842 struct serial_struct new_serial;
844 struct m68k_serial old_info; 843 struct m68k_serial old_info;
845 int retval = 0; 844 int retval = 0;
@@ -853,7 +852,7 @@ static int set_serial_info(struct m68k_serial * info,
853 if (!capable(CAP_SYS_ADMIN)) { 852 if (!capable(CAP_SYS_ADMIN)) {
854 if ((new_serial.baud_base != info->baud_base) || 853 if ((new_serial.baud_base != info->baud_base) ||
855 (new_serial.type != info->type) || 854 (new_serial.type != info->type) ||
856 (new_serial.close_delay != info->close_delay) || 855 (new_serial.close_delay != port->close_delay) ||
857 ((new_serial.flags & ~ASYNC_USR_MASK) != 856 ((new_serial.flags & ~ASYNC_USR_MASK) !=
858 (info->flags & ~ASYNC_USR_MASK))) 857 (info->flags & ~ASYNC_USR_MASK)))
859 return -EPERM; 858 return -EPERM;
@@ -863,7 +862,7 @@ static int set_serial_info(struct m68k_serial * info,
863 goto check_and_exit; 862 goto check_and_exit;
864 } 863 }
865 864
866 if (info->tport.count > 1) 865 if (port->count > 1)
867 return -EBUSY; 866 return -EBUSY;
868 867
869 /* 868 /*
@@ -875,8 +874,8 @@ static int set_serial_info(struct m68k_serial * info,
875 info->flags = ((info->flags & ~ASYNC_FLAGS) | 874 info->flags = ((info->flags & ~ASYNC_FLAGS) |
876 (new_serial.flags & ASYNC_FLAGS)); 875 (new_serial.flags & ASYNC_FLAGS));
877 info->type = new_serial.type; 876 info->type = new_serial.type;
878 info->close_delay = new_serial.close_delay; 877 port->close_delay = new_serial.close_delay;
879 info->closing_wait = new_serial.closing_wait; 878 port->closing_wait = new_serial.closing_wait;
880 879
881check_and_exit: 880check_and_exit:
882 retval = startup(info); 881 retval = startup(info);
@@ -1048,8 +1047,8 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
1048 * the line discipline to only process XON/XOFF characters. 1047 * the line discipline to only process XON/XOFF characters.
1049 */ 1048 */
1050 tty->closing = 1; 1049 tty->closing = 1;
1051 if (info->closing_wait != ASYNC_CLOSING_WAIT_NONE) 1050 if (port->closing_wait != ASYNC_CLOSING_WAIT_NONE)
1052 tty_wait_until_sent(tty, info->closing_wait); 1051 tty_wait_until_sent(tty, port->closing_wait);
1053 /* 1052 /*
1054 * At this point we stop accepting input. To do this, we 1053 * At this point we stop accepting input. To do this, we
1055 * disable the receive line status interrupts, and tell the 1054 * disable the receive line status interrupts, and tell the
@@ -1078,9 +1077,8 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
1078 } 1077 }
1079#endif 1078#endif
1080 if (port->blocked_open) { 1079 if (port->blocked_open) {
1081 if (info->close_delay) { 1080 if (port->close_delay)
1082 msleep_interruptible(jiffies_to_msecs(info->close_delay)); 1081 msleep_interruptible(jiffies_to_msecs(port->close_delay));
1083 }
1084 wake_up_interruptible(&port->open_wait); 1082 wake_up_interruptible(&port->open_wait);
1085 } 1083 }
1086 info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); 1084 info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
@@ -1296,8 +1294,6 @@ rs68328_init(void)
1296 info->tty = NULL; 1294 info->tty = NULL;
1297 info->irq = uart_irqs[i]; 1295 info->irq = uart_irqs[i];
1298 info->custom_divisor = 16; 1296 info->custom_divisor = 16;
1299 info->close_delay = 50;
1300 info->closing_wait = 3000;
1301 info->x_char = 0; 1297 info->x_char = 0;
1302 info->line = i; 1298 info->line = i;
1303 info->is_cons = 1; /* Means shortcuts work */ 1299 info->is_cons = 1; /* Means shortcuts work */