aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r--drivers/tty/serial/68328serial.c9
-rw-r--r--drivers/tty/serial/crisv10.c15
2 files changed, 5 insertions, 19 deletions
diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c
index a88ef9782a4f..7398390e7e65 100644
--- a/drivers/tty/serial/68328serial.c
+++ b/drivers/tty/serial/68328serial.c
@@ -1190,14 +1190,9 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
1190int rs_open(struct tty_struct *tty, struct file * filp) 1190int rs_open(struct tty_struct *tty, struct file * filp)
1191{ 1191{
1192 struct m68k_serial *info; 1192 struct m68k_serial *info;
1193 int retval, line; 1193 int retval;
1194
1195 line = tty->index;
1196
1197 if (line >= NR_PORTS || line < 0) /* we have exactly one */
1198 return -ENODEV;
1199 1194
1200 info = &m68k_soft[line]; 1195 info = &m68k_soft[tty->index];
1201 1196
1202 if (serial_paranoia_check(info, tty->name, "rs_open")) 1197 if (serial_paranoia_check(info, tty->name, "rs_open"))
1203 return -ENODEV; 1198 return -ENODEV;
diff --git a/drivers/tty/serial/crisv10.c b/drivers/tty/serial/crisv10.c
index 1dfba7b779c8..23d791696879 100644
--- a/drivers/tty/serial/crisv10.c
+++ b/drivers/tty/serial/crisv10.c
@@ -4105,20 +4105,11 @@ static int
4105rs_open(struct tty_struct *tty, struct file * filp) 4105rs_open(struct tty_struct *tty, struct file * filp)
4106{ 4106{
4107 struct e100_serial *info; 4107 struct e100_serial *info;
4108 int retval, line; 4108 int retval;
4109 unsigned long page; 4109 unsigned long page;
4110 int allocated_resources = 0; 4110 int allocated_resources = 0;
4111 4111
4112 /* find which port we want to open */ 4112 info = rs_table + tty->index;
4113 line = tty->index;
4114
4115 if (line < 0 || line >= NR_PORTS)
4116 return -ENODEV;
4117
4118 /* find the corresponding e100_serial struct in the table */
4119 info = rs_table + line;
4120
4121 /* don't allow the opening of ports that are not enabled in the HW config */
4122 if (!info->enabled) 4113 if (!info->enabled)
4123 return -ENODEV; 4114 return -ENODEV;
4124 4115
@@ -4131,7 +4122,7 @@ rs_open(struct tty_struct *tty, struct file * filp)
4131 tty->driver_data = info; 4122 tty->driver_data = info;
4132 info->port.tty = tty; 4123 info->port.tty = tty;
4133 4124
4134 info->port.tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; 4125 tty->low_latency = !!(info->flags & ASYNC_LOW_LATENCY);
4135 4126
4136 if (!tmp_buf) { 4127 if (!tmp_buf) {
4137 page = get_zeroed_page(GFP_KERNEL); 4128 page = get_zeroed_page(GFP_KERNEL);