static int mxser_open(struct tty_struct *tty, struct file *filp)
{
struct mxser_port *info;
- int line;
+ int line = tty->index;
- line = tty->index;
- if (line == MXSER_PORTS)
- return 0;
info = &mxser_boards[line / MXSER_PORTS_PER_BOARD].ports[line % MXSER_PORTS_PER_BOARD];
if (!info->ioaddr)
return -ENODEV;
struct mxser_port *info = tty->driver_data;
struct tty_port *port = &info->port;
- if (tty->index == MXSER_PORTS || info == NULL)
+ if (info == NULL)
return;
if (tty_port_close_start(port, tty, filp) == 0)
return;
struct tty_port *port = &info->port;
unsigned int closing_wait, close_delay;
- if (tty->index == MXSER_PORTS)
- return -ENOTTY;
-
mutex_lock(&port->mutex);
close_delay = jiffies_to_msecs(info->port.close_delay) / 10;
unsigned int flags, close_delay, closing_wait;
int retval = 0;
- if (tty->index == MXSER_PORTS)
- return -ENOTTY;
if (tty_io_error(tty))
return -EIO;
unsigned char control, status;
unsigned long flags;
-
- if (tty->index == MXSER_PORTS)
- return -ENOIOCTLCMD;
if (tty_io_error(tty))
return -EIO;
struct mxser_port *info = tty->driver_data;
unsigned long flags;
-
- if (tty->index == MXSER_PORTS)
- return -ENOIOCTLCMD;
if (tty_io_error(tty))
return -EIO;
unsigned long flags;
void __user *argp = (void __user *)arg;
- if (tty->index == MXSER_PORTS)
- return -ENOTTY;
-
if (cmd == MOXA_SET_OP_MODE || cmd == MOXA_GET_OP_MODE) {
int p;
unsigned long opmode;
{
int retval;
- mxvar_sdriver = alloc_tty_driver(MXSER_PORTS + 1);
+ mxvar_sdriver = alloc_tty_driver(MXSER_PORTS);
if (!mxvar_sdriver)
return -ENOMEM;