if (port->write_urb->status == -EINPROGRESS) { dbg ("%s - already writing", __FUNCTION__); 
spin_lock(&port->lock); if (port->write_urb_busy) { spin_unlock(&port->lock); dbg("%s - already writing", __FUNCTION__); 
static int ir_write (struct usb_serial_port *port, const unsigned char *buf, int count){	unsigned char *transfer_buffer;	int result;	int transfer_size;	dbg("%s - port = %d, count = %d", __FUNCTION__, port->number, count);	if (!port->tty) {		dev_err (&port->dev, "%s - no tty???\n", __FUNCTION__);		return 0;	}	if (count == 0)		return 0;	if (port->write_urb->status == -EINPROGRESS) {		dbg ("%s - already writing", __FUNCTION__);		return 0;	}	transfer_buffer = port->write_urb->transfer_buffer;	transfer_size = min(count, port->bulk_out_size - 1);	/*	 * The first byte of the packet we send to the device contains an	 * inband header which indicates an additional number of BOFs and	 * a baud rate change.	 *	 * See section 5.4.2.2 of the USB IrDA spec.	 */	*transfer_buffer = ir_xbof | ir_baud;	++transfer_buffer;	memcpy (transfer_buffer, buf, transfer_size);	usb_fill_bulk_urb (		port->write_urb,		port->serial->dev,		usb_sndbulkpipe(port->serial->dev,			port->bulk_out_endpointAddress),		port->write_urb->transfer_buffer,		transfer_size + 1,		ir_write_bulk_callback,		port);	port->write_urb->transfer_flags = URB_ZERO_PACKET;	result = usb_submit_urb (port->write_urb, GFP_ATOMIC);	if (result)		dev_err(&port->dev, "%s - failed submitting write urb, error %d\n", __FUNCTION__, result);	else		result = transfer_size;	return result;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/507ca9bc0476662f3463888d583864834eab1e11/ir-usb.c/clean/drivers/usb/serial/ir-usb.c