set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(timeout); 
schedule_timeout_interruptible(timeout); 
static void cypress_close(struct usb_serial_port *port, struct file * filp){	struct cypress_private *priv = usb_get_serial_port_data(port);	unsigned int c_cflag;	unsigned long flags;	int bps;	long timeout;	wait_queue_t wait;	dbg("%s - port %d", __FUNCTION__, port->number);	/* wait for data to drain from buffer */	spin_lock_irqsave(&priv->lock, flags);	timeout = CYPRESS_CLOSING_WAIT;	init_waitqueue_entry(&wait, current);	add_wait_queue(&port->tty->write_wait, &wait);	for (;;) {		set_current_state(TASK_INTERRUPTIBLE);		if (cypress_buf_data_avail(priv->buf) == 0		|| timeout == 0 || signal_pending(current)		|| !usb_get_intfdata(port->serial->interface))			break;		spin_unlock_irqrestore(&priv->lock, flags);		timeout = schedule_timeout(timeout);		spin_lock_irqsave(&priv->lock, flags);	}	set_current_state(TASK_RUNNING);	remove_wait_queue(&port->tty->write_wait, &wait);	/* clear out any remaining data in the buffer */	cypress_buf_clear(priv->buf);	spin_unlock_irqrestore(&priv->lock, flags);		/* wait for characters to drain from device */	bps = tty_get_baud_rate(port->tty);	if (bps > 1200)		timeout = max((HZ*2560)/bps,HZ/10);	else		timeout = 2*HZ;	set_current_state(TASK_INTERRUPTIBLE);	schedule_timeout(timeout);	dbg("%s - stopping urbs", __FUNCTION__);	usb_kill_urb (port->interrupt_in_urb);	usb_kill_urb (port->interrupt_out_urb);	if (port->tty) {		c_cflag = port->tty->termios->c_cflag;		if (c_cflag & HUPCL) {			/* drop dtr and rts */			priv = usb_get_serial_port_data(port);			spin_lock_irqsave(&priv->lock, flags);			priv->line_control = 0;			priv->cmd_ctrl = 1;			spin_unlock_irqrestore(&priv->lock, flags);			cypress_write(port, NULL, 0);		}	}	if (stats)		dev_info (&port->dev, "Statistics: %d Bytes In | %d Bytes Out | %d Commands Issued\n",		          priv->bytes_in, priv->bytes_out, priv->cmd_count);} /* cypress_close */
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/22c438632850c0d6257b45c90afed0cea6953afc/cypress_m8.c/clean/drivers/usb/serial/cypress_m8.c