Commit 9fdd2c89 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB: fix up usb-serial drivers now that port[] is an array of pointers.

parent 03d9ca5f
......@@ -189,8 +189,8 @@ static int belkin_sa_startup (struct usb_serial *serial)
priv->bad_flow_control = (dev->descriptor.bcdDevice <= 0x0206) ? 1 : 0;
info("bcdDevice: %04x, bfc: %d", dev->descriptor.bcdDevice, priv->bad_flow_control);
init_waitqueue_head(&serial->port->write_wait);
usb_set_serial_port_data(serial->port, priv);
init_waitqueue_head(&serial->port[0]->write_wait);
usb_set_serial_port_data(serial->port[0], priv);
return (0);
}
......@@ -206,7 +206,7 @@ static void belkin_sa_shutdown (struct usb_serial *serial)
/* stop reads and writes on all ports */
for (i=0; i < serial->num_ports; ++i) {
/* My special items, the standard routines free my urbs */
priv = usb_get_serial_port_data(&serial->port[i]);
priv = usb_get_serial_port_data(serial->port[i]);
if (priv)
kfree(priv);
}
......
......@@ -123,9 +123,9 @@ static int cyberjack_startup (struct usb_serial *serial)
priv->rdtodo = 0;
priv->wrfilled = 0;
priv->wrsent = 0;
usb_set_serial_port_data(serial->port, priv);
usb_set_serial_port_data(serial->port[0], priv);
init_waitqueue_head(&serial->port->write_wait);
init_waitqueue_head(&serial->port[0]->write_wait);
return( 0 );
}
......@@ -138,8 +138,8 @@ static void cyberjack_shutdown (struct usb_serial *serial)
for (i=0; i < serial->num_ports; ++i) {
/* My special items, the standard routines free my urbs */
kfree(usb_get_serial_port_data(&serial->port[i]));
usb_set_serial_port_data(&serial->port[i], NULL);
kfree(usb_get_serial_port_data(serial->port[i]));
usb_set_serial_port_data(serial->port[i], NULL);
}
}
......
......@@ -1675,7 +1675,7 @@ static int digi_startup_device( struct usb_serial *serial )
/* set USB_DISABLE_SPD flag for write bulk urbs */
for( i=0; i<serial->type->num_ports+1; i++ ) {
port = &serial->port[i];
port = serial->port[i];
port->write_urb->dev = port->serial->dev;
......@@ -1711,7 +1711,7 @@ dbg( "digi_startup: TOP" );
GFP_KERNEL );
if( priv == (struct digi_port *)0 ) {
while( --i >= 0 )
kfree( usb_get_serial_port_data(&serial->port[i]) );
kfree( usb_get_serial_port_data(serial->port[i]) );
return( 1 ); /* error */
}
......@@ -1734,9 +1734,9 @@ dbg( "digi_startup: TOP" );
(void *)(&serial->port[i]));
/* initialize write wait queue for this port */
init_waitqueue_head( &serial->port[i].write_wait );
init_waitqueue_head( &serial->port[i]->write_wait );
usb_set_serial_port_data(&serial->port[i], priv);
usb_set_serial_port_data(serial->port[i], priv);
}
/* allocate serial private structure */
......@@ -1744,14 +1744,14 @@ dbg( "digi_startup: TOP" );
GFP_KERNEL );
if( serial_priv == (struct digi_serial *)0 ) {
for( i=0; i<serial->type->num_ports+1; i++ )
kfree( usb_get_serial_port_data(&serial->port[i]) );
kfree( usb_get_serial_port_data(serial->port[i]) );
return( 1 ); /* error */
}
/* initialize serial private structure */
spin_lock_init( &serial_priv->ds_serial_lock );
serial_priv->ds_oob_port_num = serial->type->num_ports;
serial_priv->ds_oob_port = &serial->port[serial_priv->ds_oob_port_num];
serial_priv->ds_oob_port = serial->port[serial_priv->ds_oob_port_num];
serial_priv->ds_device_started = 0;
usb_set_serial_data(serial, serial_priv);
......@@ -1770,14 +1770,14 @@ dbg( "digi_shutdown: TOP, in_interrupt()=%ld", in_interrupt() );
/* stop reads and writes on all ports */
for( i=0; i<serial->type->num_ports+1; i++ ) {
usb_unlink_urb( serial->port[i].read_urb );
usb_unlink_urb( serial->port[i].write_urb );
usb_unlink_urb( serial->port[i]->read_urb );
usb_unlink_urb( serial->port[i]->write_urb );
}
/* free the private data structures for all ports */
/* number of regular ports + 1 for the out-of-band port */
for( i=0; i<serial->type->num_ports+1; i++ )
kfree( usb_get_serial_port_data(&serial->port[i]) );
kfree( usb_get_serial_port_data(serial->port[i]) );
kfree( usb_get_serial_data(serial) );
}
......@@ -1980,7 +1980,7 @@ opcode, line, status, val );
if( status != 0 || line >= serial->type->num_ports )
continue;
port = &serial->port[line];
port = serial->port[line];
if( port_paranoia_check( port, __FUNCTION__ )
|| (priv=usb_get_serial_port_data(port)) == NULL )
......
......@@ -981,7 +981,7 @@ static int set_serial_info(struct usb_serial_port * port, struct serial_struct *
/* Called from ftdi_SIO_startup, etc. */
static int ftdi_common_startup (struct usb_serial *serial)
{
struct usb_serial_port *port = &serial->port[0];
struct usb_serial_port *port = serial->port[0];
struct ftdi_private *priv;
dbg("%s",__FUNCTION__);
......@@ -1022,7 +1022,7 @@ static int ftdi_common_startup (struct usb_serial *serial)
port->bulk_out_buffer = NULL;
}
usb_set_serial_port_data(serial->port, priv);
usb_set_serial_port_data(serial->port[0], priv);
return (0);
}
......@@ -1042,7 +1042,7 @@ static int ftdi_SIO_startup (struct usb_serial *serial)
return (err);
}
priv = usb_get_serial_port_data(serial->port);
priv = usb_get_serial_port_data(serial->port[0]);
priv->chip_type = SIO;
priv->baud_base = 12000000 / 16;
priv->write_offset = 1;
......@@ -1063,7 +1063,7 @@ static int ftdi_8U232AM_startup (struct usb_serial *serial)
return (err);
}
priv = usb_get_serial_port_data(serial->port);
priv = usb_get_serial_port_data(serial->port[0]);
priv->chip_type = FT8U232AM;
priv->baud_base = 48000000 / 2; /* Would be / 16, but FTDI supports 0.125, 0.25 and 0.5 divisor fractions! */
......@@ -1083,7 +1083,7 @@ static int ftdi_FT232BM_startup (struct usb_serial *serial)
return (err);
}
priv = usb_get_serial_port_data(serial->port);
priv = usb_get_serial_port_data(serial->port[0]);
priv->chip_type = FT232BM;
priv->baud_base = 48000000 / 2; /* Would be / 16, but FT232BM supports multiple of 0.125 divisor fractions! */
......@@ -1103,7 +1103,7 @@ static int ftdi_USB_UIRT_startup (struct usb_serial *serial)
return (err);
}
priv = usb_get_serial_port_data(serial->port);
priv = usb_get_serial_port_data(serial->port[0]);
priv->flags |= ASYNC_SPD_CUST;
priv->custom_divisor = 77;
priv->force_baud = B38400;
......@@ -1124,7 +1124,7 @@ static int ftdi_HE_TIRA1_startup (struct usb_serial *serial)
return (err);
}
priv = usb_get_serial_port_data(serial->port);
priv = usb_get_serial_port_data(serial->port[0]);
priv->flags |= ASYNC_SPD_CUST;
priv->custom_divisor = 240;
priv->force_baud = B38400;
......@@ -1146,7 +1146,7 @@ static int ftdi_HE_TIRA1_startup (struct usb_serial *serial)
static void ftdi_shutdown (struct usb_serial *serial)
{ /* ftdi_shutdown */
struct usb_serial_port *port = serial->port;
struct usb_serial_port *port = serial->port[0];
struct ftdi_private *priv = usb_get_serial_port_data(port);
dbg("%s", __FUNCTION__);
......
......@@ -300,7 +300,7 @@ void usb_serial_generic_shutdown (struct usb_serial *serial)
/* stop reads and writes on all ports */
for (i=0; i < serial->num_ports; ++i) {
generic_cleanup (&serial->port[i]);
generic_cleanup(serial->port[i]);
}
}
......@@ -824,7 +824,7 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs)
while ((position < length) && (portNumber < edge_serial->serial->num_ports)) {
txCredits = data[position] | (data[position+1] << 8);
if (txCredits) {
port = &edge_serial->serial->port[portNumber];
port = edge_serial->serial->port[portNumber];
if (port_paranoia_check (port, __FUNCTION__) == 0) {
edge_port = usb_get_serial_port_data(port);
if (edge_port->open) {
......@@ -1031,7 +1031,7 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
return -ENODEV;
}
if (edge_serial->interrupt_in_buffer == NULL) {
struct usb_serial_port *port0 = &serial->port[0];
struct usb_serial_port *port0 = serial->port[0];
/* not set up yet, so do it now */
edge_serial->interrupt_in_buffer = port0->interrupt_in_buffer;
......@@ -2065,7 +2065,7 @@ static int process_rcvd_data (struct edgeport_serial *edge_serial, unsigned char
/* spit this data back into the tty driver if this port is open */
if (rxLen) {
port = &edge_serial->serial->port[edge_serial->rxPort];
port = edge_serial->serial->port[edge_serial->rxPort];
if (port_paranoia_check (port, __FUNCTION__) == 0) {
edge_port = usb_get_serial_port_data(port);
if (edge_port->open) {
......@@ -2118,7 +2118,7 @@ static void process_rcvd_status (struct edgeport_serial *edge_serial, __u8 byte2
__u8 code = edge_serial->rxStatusCode;
/* switch the port pointer to the one being currently talked about */
port = &edge_serial->serial->port[edge_serial->rxPort];
port = edge_serial->serial->port[edge_serial->rxPort];
if (port_paranoia_check (port, __FUNCTION__)) {
return;
}
......@@ -3018,8 +3018,8 @@ static int edge_startup (struct usb_serial *serial)
return -ENOMEM;
}
memset (edge_port, 0, sizeof(struct edgeport_port));
edge_port->port = &serial->port[i];
usb_set_serial_port_data(&serial->port[i], edge_port);
edge_port->port = serial->port[i];
usb_set_serial_port_data(serial->port[i], edge_port);
}
return 0;
......@@ -3039,8 +3039,8 @@ static void edge_shutdown (struct usb_serial *serial)
/* stop reads and writes on all ports */
for (i=0; i < serial->num_ports; ++i) {
kfree (usb_get_serial_port_data(&serial->port[i]));
usb_set_serial_port_data(&serial->port[i], NULL);
kfree (usb_get_serial_port_data(serial->port[i]));
usb_set_serial_port_data(serial->port[i], NULL);
}
kfree (usb_get_serial_data(serial));
usb_set_serial_data(serial, NULL);
......
......@@ -924,7 +924,7 @@ static int TISendBulkTransferSync (struct usb_serial *serial, void *buffer, int
status = usb_bulk_msg (serial->dev,
usb_sndbulkpipe(serial->dev,
serial->port[0].bulk_out_endpointAddress),
serial->port[0]->bulk_out_endpointAddress),
buffer,
length,
num_sent,
......@@ -1682,7 +1682,7 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs)
function = TIUMP_GET_FUNC_FROM_CODE (data[0]);
dbg ("%s - port_number %d, function %d, info 0x%x",
__FUNCTION__, port_number, function, data[1]);
port = &edge_serial->serial->port[port_number];
port = edge_serial->serial->port[port_number];
if (port_paranoia_check (port, __FUNCTION__)) {
dbg ("%s - change found for port that is not present",
__FUNCTION__);
......@@ -1945,7 +1945,7 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
edge_serial = edge_port->edge_serial;
if (edge_serial->num_ports_open == 0) {
/* we are the first port to be opened, let's post the interrupt urb */
urb = edge_serial->serial->port[0].interrupt_in_urb;
urb = edge_serial->serial->port[0]->interrupt_in_urb;
if (!urb) {
dev_err (&port->dev, "%s - no interrupt urb present, exiting\n", __FUNCTION__);
return -EINVAL;
......@@ -2034,7 +2034,7 @@ static void edge_close (struct usb_serial_port *port, struct file * filp)
--edge_port->edge_serial->num_ports_open;
if (edge_port->edge_serial->num_ports_open <= 0) {
/* last port is now closed, let's shut down our interrupt urb */
usb_unlink_urb (serial->port[0].interrupt_in_urb);
usb_unlink_urb (serial->port[0]->interrupt_in_urb);
edge_port->edge_serial->num_ports_open = 0;
}
edge_port->close_pending = 0;
......@@ -2603,9 +2603,9 @@ static int edge_startup (struct usb_serial *serial)
return -ENOMEM;
}
memset (edge_port, 0, sizeof(struct edgeport_port));
edge_port->port = &serial->port[i];
edge_port->port = serial->port[i];
edge_port->edge_serial = edge_serial;
usb_set_serial_port_data(&serial->port[i], edge_port);
usb_set_serial_port_data(serial->port[i], edge_port);
}
return 0;
......@@ -2618,8 +2618,8 @@ static void edge_shutdown (struct usb_serial *serial)
dbg ("%s", __FUNCTION__);
for (i=0; i < serial->num_ports; ++i) {
kfree (usb_get_serial_port_data(&serial->port[i]));
usb_set_serial_port_data(&serial->port[i], NULL);
kfree (usb_get_serial_port_data(serial->port[i]));
usb_set_serial_port_data(serial->port[i], NULL);
}
kfree (usb_get_serial_data(serial));
usb_set_serial_data(serial, NULL);
......
......@@ -523,7 +523,7 @@ static void usa26_instat_callback(struct urb *urb, struct pt_regs *regs)
dbg ("%s - Unexpected port number %d", __FUNCTION__, msg->port);
goto exit;
}
port = &serial->port[msg->port];
port = serial->port[msg->port];
p_priv = usb_get_serial_port_data(port);
/* Update handshaking pin state information */
......@@ -658,7 +658,7 @@ static void usa28_instat_callback(struct urb *urb, struct pt_regs *regs)
dbg ("%s - Unexpected port number %d", __FUNCTION__, msg->port);
goto exit;
}
port = &serial->port[msg->port];
port = serial->port[msg->port];
p_priv = usb_get_serial_port_data(port);
/* Update handshaking pin state information */
......@@ -701,7 +701,7 @@ static void usa49_glocont_callback(struct urb *urb, struct pt_regs *regs)
serial = (struct usb_serial *) urb->context;
for (i = 0; i < serial->num_ports; ++i) {
port = &serial->port[i];
port = serial->port[i];
p_priv = usb_get_serial_port_data(port);
if (p_priv->resend_cont) {
......@@ -750,7 +750,7 @@ static void usa49_instat_callback(struct urb *urb, struct pt_regs *regs)
dbg ("%s - Unexpected port number %d", __FUNCTION__, msg->portNumber);
goto exit;
}
port = &serial->port[msg->portNumber];
port = serial->port[msg->portNumber];
p_priv = usb_get_serial_port_data(port);
/* Update handshaking pin state information */
......@@ -1188,7 +1188,7 @@ static void keyspan_setup_urbs(struct usb_serial *serial)
/* Setup endpoints for each port specific thing */
for (i = 0; i < d_details->num_ports; i ++) {
port = &serial->port[i];
port = serial->port[i];
p_priv = usb_get_serial_port_data(port);
/* Do indat endpoints first, once for each flip */
......@@ -1893,7 +1893,7 @@ static int keyspan_startup (struct usb_serial *serial)
/* Now setup per port private data */
for (i = 0; i < serial->num_ports; i++) {
port = &serial->port[i];
port = serial->port[i];
p_priv = kmalloc(sizeof(struct keyspan_port_private), GFP_KERNEL);
if (!p_priv) {
dbg("%s - kmalloc for keyspan_port_private (%d) failed!.", __FUNCTION__, i);
......@@ -1929,7 +1929,7 @@ static void keyspan_shutdown (struct usb_serial *serial)
stop_urb(s_priv->instat_urb);
stop_urb(s_priv->glocont_urb);
for (i = 0; i < serial->num_ports; ++i) {
port = &serial->port[i];
port = serial->port[i];
p_priv = usb_get_serial_port_data(port);
stop_urb(p_priv->inack_urb);
stop_urb(p_priv->outcont_urb);
......@@ -1945,7 +1945,7 @@ static void keyspan_shutdown (struct usb_serial *serial)
if (s_priv->glocont_urb)
usb_free_urb(s_priv->glocont_urb);
for (i = 0; i < serial->num_ports; ++i) {
port = &serial->port[i];
port = serial->port[i];
p_priv = usb_get_serial_port_data(port);
if (p_priv->inack_urb)
usb_free_urb(p_priv->inack_urb);
......@@ -1965,7 +1965,7 @@ static void keyspan_shutdown (struct usb_serial *serial)
/* dbg("Freeing port->private."); */
/* Now free per port private data */
for (i = 0; i < serial->num_ports; i++) {
port = &serial->port[i];
port = serial->port[i];
kfree(usb_get_serial_port_data(port));
}
}
......
......@@ -264,7 +264,7 @@ static void keyspan_pda_rx_interrupt (struct urb *urb, struct pt_regs *regs)
case 0:
/* rest of message is rx data */
if (urb->actual_length) {
tty = serial->port[0].tty;
tty = serial->port[0]->tty;
for (i = 1; i < urb->actual_length ; ++i) {
tty_insert_flip_char(tty, data[i], 0);
}
......@@ -278,7 +278,7 @@ static void keyspan_pda_rx_interrupt (struct urb *urb, struct pt_regs *regs)
case 1: /* modemline change */
break;
case 2: /* tx unthrottle interrupt */
tty = serial->port[0].tty;
tty = serial->port[0]->tty;
priv->tx_throttled = 0;
/* queue up a wakeup at scheduler time */
schedule_work(&priv->wakeup_work);
......@@ -801,8 +801,8 @@ static int keyspan_pda_startup (struct usb_serial *serial)
priv = kmalloc(sizeof(struct keyspan_pda_private), GFP_KERNEL);
if (!priv)
return (1); /* error */
usb_set_serial_port_data(&serial->port[0], priv);
init_waitqueue_head(&serial->port[0].write_wait);
usb_set_serial_port_data(serial->port[0], priv);
init_waitqueue_head(&serial->port[0]->write_wait);
INIT_WORK(&priv->wakeup_work, (void *)keyspan_pda_wakeup_write,
(void *)(&serial->port[0]));
INIT_WORK(&priv->unthrottle_work,
......@@ -815,7 +815,7 @@ static void keyspan_pda_shutdown (struct usb_serial *serial)
{
dbg("%s", __FUNCTION__);
kfree(usb_get_serial_port_data(&serial->port[0]));
kfree(usb_get_serial_port_data(serial->port[0]));
}
#ifdef KEYSPAN
......
......@@ -290,7 +290,7 @@ static int klsi_105_startup (struct usb_serial *serial)
priv->bytes_in = 0;
priv->bytes_out = 0;
usb_set_serial_port_data(&serial->port[i], priv);
usb_set_serial_port_data(serial->port[i], priv);
spin_lock_init (&priv->lock);
for (i=0; i<NUM_URBS; i++) {
......@@ -312,7 +312,7 @@ static int klsi_105_startup (struct usb_serial *serial)
}
/* priv->termios is left uninitalized until port opening */
init_waitqueue_head(&serial->port[i].write_wait);
init_waitqueue_head(&serial->port[i]->write_wait);
}
return (0);
......@@ -327,7 +327,7 @@ static void klsi_105_shutdown (struct usb_serial *serial)
/* stop reads and writes on all ports */
for (i=0; i < serial->num_ports; ++i) {
struct klsi_105_private *priv = usb_get_serial_port_data(&serial->port[i]);
struct klsi_105_private *priv = usb_get_serial_port_data(serial->port[i]);
unsigned long flags;
if (priv) {
......@@ -354,7 +354,7 @@ static void klsi_105_shutdown (struct usb_serial *serial)
spin_unlock_irqrestore (&priv->lock, flags);
kfree(priv);
usb_set_serial_port_data(&serial->port[i], NULL);
usb_set_serial_port_data(serial->port[i], NULL);
}
}
} /* klsi_105_shutdown */
......
......@@ -177,7 +177,7 @@ static int kobil_startup (struct usb_serial *serial)
printk(KERN_DEBUG "KOBIL KAAN SIM detected\n");
break;
}
usb_set_serial_port_data(serial->port, priv);
usb_set_serial_port_data(serial->port[0], priv);
// search for the necessary endpoints
pdev = serial->dev;
......@@ -206,14 +206,14 @@ static int kobil_startup (struct usb_serial *serial)
static void kobil_shutdown (struct usb_serial *serial)
{
int i;
dbg("%s - port %d", __FUNCTION__, serial->port->number);
dbg("%s - port %d", __FUNCTION__, serial->port[0]->number);
for (i=0; i < serial->num_ports; ++i) {
while (serial->port[i].open_count > 0) {
kobil_close (&serial->port[i], NULL);
while (serial->port[i]->open_count > 0) {
kobil_close (serial->port[i], NULL);
}
kfree(usb_get_serial_port_data(&serial->port[i]));
usb_set_serial_port_data(&serial->port[i], NULL);
kfree(usb_get_serial_port_data(serial->port[i]));
usb_set_serial_port_data(serial->port[i], NULL);
}
}
......
......@@ -320,9 +320,9 @@ static int mct_u232_startup (struct usb_serial *serial)
priv->control_state = 0;
priv->last_lsr = 0;
priv->last_msr = 0;
usb_set_serial_port_data(serial->port, priv);
usb_set_serial_port_data(serial->port[0], priv);
init_waitqueue_head(&serial->port->write_wait);
init_waitqueue_head(&serial->port[0]->write_wait);
return (0);
} /* mct_u232_startup */
......@@ -337,7 +337,7 @@ static void mct_u232_shutdown (struct usb_serial *serial)
for (i=0; i < serial->num_ports; ++i) {
/* My special items, the standard routines free my urbs */
priv = usb_get_serial_port_data(&serial->port[i]);
priv = usb_get_serial_port_data(serial->port[i]);
if (priv)
kfree(priv);
}
......@@ -393,7 +393,7 @@ static int mct_u232_open (struct usb_serial_port *port, struct file *filp)
{
/* Puh, that's dirty */
struct usb_serial_port *rport;
rport = &serial->port[1];
rport = serial->port[1];
rport->tty = port->tty;
usb_set_serial_port_data(rport, usb_get_serial_port_data(port));
port->read_urb = rport->interrupt_in_urb;
......
......@@ -170,7 +170,7 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp)
}
usb_set_serial_port_data(port, od);
wport = &serial->port[1];
wport = serial->port[1];
wport->tty = port->tty;
/* Start reading from the device */
......@@ -201,7 +201,7 @@ static void omninet_close (struct usb_serial_port *port, struct file * filp)
return;
if (serial->dev) {
wport = &serial->port[1];
wport = serial->port[1];
usb_unlink_urb (wport->write_urb);
usb_unlink_urb (port->read_urb);
}
......@@ -271,7 +271,7 @@ static void omninet_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
static int omninet_write (struct usb_serial_port *port, int from_user, const unsigned char *buf, int count)
{
struct usb_serial *serial = port->serial;
struct usb_serial_port *wport = &serial->port[1];
struct usb_serial_port *wport = serial->port[1];
struct omninet_data *od = usb_get_serial_port_data(port);
struct omninet_header *header = (struct omninet_header *) wport->write_urb->transfer_buffer;
......@@ -326,7 +326,7 @@ static int omninet_write (struct usb_serial_port *port, int from_user, const uns
static int omninet_write_room (struct usb_serial_port *port)
{
struct usb_serial *serial = port->serial;
struct usb_serial_port *wport = &serial->port[1];
struct usb_serial_port *wport = serial->port[1];
int room = 0; // Default: no room
......
......@@ -186,7 +186,7 @@ static int pl2303_startup (struct usb_serial *serial)
return -ENOMEM;
memset (priv, 0x00, sizeof (struct pl2303_private));
spin_lock_init(&priv->lock);
usb_set_serial_port_data(&serial->port[i], priv);
usb_set_serial_port_data(serial->port[i], priv);
}
return 0;
}
......@@ -592,8 +592,8 @@ static void pl2303_shutdown (struct usb_serial *serial)
dbg("%s", __FUNCTION__);
for (i = 0; i < serial->num_ports; ++i) {
kfree (usb_get_serial_port_data(&serial->port[i]));
usb_set_serial_port_data(&serial->port[i], NULL);
kfree (usb_get_serial_port_data(serial->port[i]));
usb_set_serial_port_data(serial->port[i], NULL);
}
}
......
......@@ -850,25 +850,25 @@ static int treo_attach (struct usb_serial *serial)
* "virtual serial port". So let's force the endpoints to be
* where we want them to be. */
for (i = serial->num_bulk_in; i < serial->num_ports; ++i) {
port = &serial->port[i];
port->read_urb = serial->port[0].read_urb;
port->bulk_in_endpointAddress = serial->port[0].bulk_in_endpointAddress;
port->bulk_in_buffer = serial->port[0].bulk_in_buffer;
port = serial->port[i];
port->read_urb = serial->port[0]->read_urb;
port->bulk_in_endpointAddress = serial->port[0]->bulk_in_endpointAddress;
port->bulk_in_buffer = serial->port[0]->bulk_in_buffer;
}
for (i = serial->num_bulk_out; i < serial->num_ports; ++i) {
port = &serial->port[i];
port->write_urb = serial->port[0].write_urb;
port->bulk_out_size = serial->port[0].bulk_out_size;
port->bulk_out_endpointAddress = serial->port[0].bulk_out_endpointAddress;
port->bulk_out_buffer = serial->port[0].bulk_out_buffer;
port = serial->port[i];
port->write_urb = serial->port[0]->write_urb;
port->bulk_out_size = serial->port[0]->bulk_out_size;
port->bulk_out_endpointAddress = serial->port[0]->bulk_out_endpointAddress;
port->bulk_out_buffer = serial->port[0]->bulk_out_buffer;
}
for (i = serial->num_interrupt_in; i < serial->num_ports; ++i) {
port = &serial->port[i];
port->interrupt_in_urb = serial->port[0].interrupt_in_urb;
port->interrupt_in_endpointAddress = serial->port[0].interrupt_in_endpointAddress;
port->interrupt_in_buffer = serial->port[0].interrupt_in_buffer;
port = serial->port[i];
port->interrupt_in_urb = serial->port[0]->interrupt_in_urb;
port->interrupt_in_endpointAddress = serial->port[0]->interrupt_in_endpointAddress;
port->interrupt_in_buffer = serial->port[0]->interrupt_in_buffer;
}
return 0;
......
......@@ -361,7 +361,7 @@ static int whiteheat_attach (struct usb_serial *serial)
struct whiteheat_urb_wrap *wrap;
struct list_head *tmp;
command_port = &serial->port[COMMAND_PORT];
command_port = serial->port[COMMAND_PORT];
pipe = usb_sndbulkpipe (serial->dev, command_port->bulk_out_endpointAddress);
/*
......@@ -400,7 +400,7 @@ static int whiteheat_attach (struct usb_serial *serial)
DRIVER_VERSION, hw_info->sw_major_rev, hw_info->sw_minor_rev);
for (i = 0; i < serial->num_ports; i++) {
port = &serial->port[i];
port = serial->port[i];
info = (struct whiteheat_private *)kmalloc(sizeof(struct whiteheat_private), GFP_KERNEL);
if (info == NULL) {
......@@ -496,7 +496,7 @@ static int whiteheat_attach (struct usb_serial *serial)
no_command_private:
for (i = serial->num_ports - 1; i >= 0; i--) {
port = &serial->port[i];
port = serial->port[i];
info = usb_get_serial_port_data(port);
for (j = urb_pool_size - 1; j >= 0; j--) {
tmp = list_first(&info->tx_urbs_free);
......@@ -543,11 +543,11 @@ static void whiteheat_shutdown (struct usb_serial *serial)
dbg("%s", __FUNCTION__);
/* free up our private data for our command port */
command_port = &serial->port[COMMAND_PORT];
command_port = serial->port[COMMAND_PORT];
kfree (usb_get_serial_port_data(command_port));
for (i = 0; i < serial->num_ports; i++) {
port = &serial->port[i];
port = serial->port[i];
info = usb_get_serial_port_data(port);
list_for_each_safe(tmp, tmp2, &info->rx_urbs_free) {
list_del(tmp);
......@@ -1119,7 +1119,7 @@ static int firm_send_command (struct usb_serial_port *port, __u8 command, __u8 *
dbg("%s - command %d", __FUNCTION__, command);
command_port = &port->serial->port[COMMAND_PORT];
command_port = port->serial->port[COMMAND_PORT];
command_info = usb_get_serial_port_data(command_port);
spin_lock_irqsave(&command_info->lock, flags);
command_info->command_finished = FALSE;
......@@ -1323,7 +1323,7 @@ static int start_command_port(struct usb_serial *serial)
unsigned long flags;
int retval = 0;
command_port = &serial->port[COMMAND_PORT];
command_port = serial->port[COMMAND_PORT];
command_info = usb_get_serial_port_data(command_port);
spin_lock_irqsave(&command_info->lock, flags);
if (!command_info->port_running) {
......@@ -1351,7 +1351,7 @@ static void stop_command_port(struct usb_serial *serial)
struct whiteheat_command_private *command_info;
unsigned long flags;
command_port = &serial->port[COMMAND_PORT];
command_port = serial->port[COMMAND_PORT];
command_info = usb_get_serial_port_data(command_port);
spin_lock_irqsave(&command_info->lock, flags);
command_info->port_running--;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment