if (info->close_delay) { set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(info->close_delay); } 
if (info->close_delay) schedule_timeout_interruptible(info->close_delay); 
rs_close(struct tty_struct *tty, struct file * filp){	struct e100_serial * info = (struct e100_serial *)tty->driver_data;	unsigned long flags;	if (!info)		return;	/* interrupts are disabled for this entire function */	save_flags(flags);	cli();	if (tty_hung_up_p(filp)) {		restore_flags(flags);		return;	}#ifdef SERIAL_DEBUG_OPEN	printk("[%d] rs_close ttyS%d, count = %d\n", current->pid,	       info->line, info->count);#endif	if ((tty->count == 1) && (info->count != 1)) {		/*		 * Uh, oh.  tty->count is 1, which means that the tty		 * structure will be freed.  Info->count should always		 * be one in these conditions.  If it's greater than		 * one, we've got real problems, since it means the		 * serial port won't be shutdown.		 */		printk(KERN_CRIT		       "rs_close: bad serial port count; tty->count is 1, "		       "info->count is %d\n", info->count);		info->count = 1;	}	if (--info->count < 0) {		printk(KERN_CRIT "rs_close: bad serial port count for ttyS%d: %d\n",		       info->line, info->count);		info->count = 0;	}	if (info->count) {		restore_flags(flags);		return;	}	info->flags |= ASYNC_CLOSING;	/*	 * Save the termios structure, since this port may have	 * separate termios for callout and dialin.	 */	if (info->flags & ASYNC_NORMAL_ACTIVE)		info->normal_termios = *tty->termios;	/*	 * Now we wait for the transmit buffer to clear; and we notify	 * the line discipline to only process XON/XOFF characters.	 */	tty->closing = 1;	if (info->closing_wait != ASYNC_CLOSING_WAIT_NONE)		tty_wait_until_sent(tty, info->closing_wait);	/*	 * At this point we stop accepting input.  To do this, we	 * disable the serial receiver and the DMA receive interrupt.	 */#ifdef SERIAL_HANDLE_EARLY_ERRORS	e100_disable_serial_data_irq(info);#endif#ifndef CONFIG_SVINTO_SIM	e100_disable_rx(info);	e100_disable_rx_irq(info);	if (info->flags & ASYNC_INITIALIZED) {		/*		 * Before we drop DTR, make sure the UART transmitter		 * has completely drained; this is especially		 * important as we have a transmit FIFO!		 */		rs_wait_until_sent(tty, HZ);	}#endif	shutdown(info);	if (tty->driver->flush_buffer)		tty->driver->flush_buffer(tty);	if (tty->ldisc.flush_buffer)		tty->ldisc.flush_buffer(tty);	tty->closing = 0;	info->event = 0;	info->tty = 0;	if (info->blocked_open) {		if (info->close_delay) {			set_current_state(TASK_INTERRUPTIBLE);			schedule_timeout(info->close_delay);		}		wake_up_interruptible(&info->open_wait);	}	info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);	wake_up_interruptible(&info->close_wait);	restore_flags(flags);	/* port closed */#if defined(CONFIG_ETRAX_RS485)	if (info->rs485.enabled) {		info->rs485.enabled = 0;#if defined(CONFIG_ETRAX_RS485_ON_PA)		*R_PORT_PA_DATA = port_pa_data_shadow &= ~(1 << rs485_pa_bit);#endif#if defined(CONFIG_ETRAX_RS485_ON_PORT_G)		REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow,			       rs485_port_g_bit, 0);#endif#if defined(CONFIG_ETRAX_RS485_LTC1387)		REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow,			       CONFIG_ETRAX_RS485_LTC1387_DXEN_PORT_G_BIT, 0);		REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow,			       CONFIG_ETRAX_RS485_LTC1387_RXEN_PORT_G_BIT, 0);#endif	}#endif}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/3c76bc5bfda308aa42d5f42fde8dc1931e45e8a6/crisv10.c/buggy/drivers/serial/crisv10.c