/* This routine is called when the serial port gets closed. First, we wait for the last remaining data to be sent. Then, we unlink its async structure from the interrupt chain if necessary, and we free that IRQ if nothing is left in the chain.  */
static void mxser_close(struct tty_struct *tty, struct file *filp)
/* This routine is called when the serial port gets closed. First, we wait for the last remaining data to be sent. Then, we unlink its async structure from the interrupt chain if necessary, and we free that IRQ if nothing is left in the chain.  */
static void mxser_close(struct tty_struct *tty, struct file *filp)
{
	struct mxser_port *info = tty->driver_data;
	struct tty_port *port = &info->port;
	if (tty->index == MXSER_PORTS)
		return;
	if (tty_port_close_start(port, tty, filp) == 0)
		return;
	mutex_lock(&port->mutex);
	mxser_close_port(port);
	mxser_flush_buffer(tty);
	mxser_shutdown_port(port);
	clear_bit(ASYNCB_INITIALIZED, &port->flags);
	mutex_unlock(&port->mutex);	tty_port_close_end(port, tty);
	tty_port_tty_set(port, NULL);
}