/* This routine is called whenever a serial port is opened. It enables interrupts for a serial port, linking in its async structure into the IRQ chain. It also performs the serial-specific initialization for the tty structure.  */
static int mxser_open(struct tty_struct *tty, struct file *filp)
/* This routine is called whenever a serial port is opened. It enables interrupts for a serial port, linking in its async structure into the IRQ chain. It also performs the serial-specific initialization for the tty structure.  */
static int mxser_open(struct tty_struct *tty, struct file *filp)
{
	struct mxser_port *info;
	int line;
	line = tty->index;
	if (line == MXSER_PORTS)
		return 0;
	if (line < 0 || line > MXSER_PORTS)
		return -ENODEV;
	info = &mxser_boards[line / MXSER_PORTS_PER_BOARD].ports[line % MXSER_PORTS_PER_BOARD];
	if (!info->ioaddr)
		return -ENODEV;
	return tty_port_open(&info->port, tty, filp);
}