Commit c63063e2 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: removed port_paranoia_check() call for usb serial drivers.

Pretty useless stuff.  If this was hiding anything real, we need to find out.
parent fd7f6a57
...@@ -246,9 +246,6 @@ static void belkin_sa_close (struct usb_serial_port *port, struct file *filp) ...@@ -246,9 +246,6 @@ static void belkin_sa_close (struct usb_serial_port *port, struct file *filp)
{ {
struct usb_serial *serial; struct usb_serial *serial;
if (port_paranoia_check (port, __FUNCTION__))
return;
serial = get_usb_serial (port, __FUNCTION__); serial = get_usb_serial (port, __FUNCTION__);
if (!serial) if (!serial)
return; return;
...@@ -288,9 +285,6 @@ static void belkin_sa_read_int_callback (struct urb *urb, struct pt_regs *regs) ...@@ -288,9 +285,6 @@ static void belkin_sa_read_int_callback (struct urb *urb, struct pt_regs *regs)
goto exit; goto exit;
} }
if (port_paranoia_check (port, __FUNCTION__))
return;
serial = port->serial; serial = port->serial;
if (serial_paranoia_check (serial, __FUNCTION__)) if (serial_paranoia_check (serial, __FUNCTION__))
......
...@@ -155,9 +155,6 @@ static int cyberjack_open (struct usb_serial_port *port, struct file *filp) ...@@ -155,9 +155,6 @@ static int cyberjack_open (struct usb_serial_port *port, struct file *filp)
unsigned long flags; unsigned long flags;
int result = 0; int result = 0;
if (port_paranoia_check (port, __FUNCTION__))
return -ENODEV;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
dbg("%s - usb_clear_halt", __FUNCTION__ ); dbg("%s - usb_clear_halt", __FUNCTION__ );
...@@ -325,9 +322,6 @@ static void cyberjack_read_int_callback( struct urb *urb, struct pt_regs *regs ) ...@@ -325,9 +322,6 @@ static void cyberjack_read_int_callback( struct urb *urb, struct pt_regs *regs )
unsigned char *data = urb->transfer_buffer; unsigned char *data = urb->transfer_buffer;
int result; int result;
if (port_paranoia_check (port, __FUNCTION__))
return;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
/* the urb might have been killed. */ /* the urb might have been killed. */
......
...@@ -1397,8 +1397,7 @@ dbg( "digi_write_bulk_callback: TOP, urb->status=%d", urb->status ); ...@@ -1397,8 +1397,7 @@ dbg( "digi_write_bulk_callback: TOP, urb->status=%d", urb->status );
} }
/* further sanity checks */ /* further sanity checks */
if( port_paranoia_check( port, __FUNCTION__ ) if (serial_paranoia_check(serial, __FUNCTION__))
|| serial_paranoia_check( serial, __FUNCTION__ ) )
return; return;
/* try to send any buffered data on this port, if it is open */ /* try to send any buffered data on this port, if it is open */
...@@ -1851,11 +1850,6 @@ static int digi_read_inb_callback( struct urb *urb ) ...@@ -1851,11 +1850,6 @@ static int digi_read_inb_callback( struct urb *urb )
unsigned char *data = ((unsigned char *)urb->transfer_buffer)+3; unsigned char *data = ((unsigned char *)urb->transfer_buffer)+3;
int flag,throttled; int flag,throttled;
/* sanity check */
if( port_paranoia_check( port, __FUNCTION__ ) )
return( -1 );
/* do not process callbacks on closed ports */ /* do not process callbacks on closed ports */
/* but do continue the read chain */ /* but do continue the read chain */
if( port->open_count == 0 ) if( port->open_count == 0 )
...@@ -1980,9 +1974,8 @@ opcode, line, status, val ); ...@@ -1980,9 +1974,8 @@ opcode, line, status, val );
port = serial->port[line]; port = serial->port[line];
if( port_paranoia_check( port, __FUNCTION__ ) if ((priv=usb_get_serial_port_data(port)) == NULL )
|| (priv=usb_get_serial_port_data(port)) == NULL ) return -1;
return( -1 );
if( opcode == DIGI_CMD_READ_INPUT_SIGNALS ) { if( opcode == DIGI_CMD_READ_INPUT_SIGNALS ) {
......
...@@ -157,9 +157,6 @@ static int empeg_open (struct usb_serial_port *port, struct file *filp) ...@@ -157,9 +157,6 @@ static int empeg_open (struct usb_serial_port *port, struct file *filp)
struct usb_serial *serial = port->serial; struct usb_serial *serial = port->serial;
int result = 0; int result = 0;
if (port_paranoia_check (port, __FUNCTION__))
return -ENODEV;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
/* Force default termio settings */ /* Force default termio settings */
...@@ -192,9 +189,6 @@ static void empeg_close (struct usb_serial_port *port, struct file * filp) ...@@ -192,9 +189,6 @@ static void empeg_close (struct usb_serial_port *port, struct file * filp)
{ {
struct usb_serial *serial; struct usb_serial *serial;
if (port_paranoia_check (port, __FUNCTION__))
return;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial (port, __FUNCTION__); serial = get_usb_serial (port, __FUNCTION__);
...@@ -353,9 +347,6 @@ static void empeg_write_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -353,9 +347,6 @@ static void empeg_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
{ {
struct usb_serial_port *port = (struct usb_serial_port *)urb->context; struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
if (port_paranoia_check (port, __FUNCTION__))
return;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (urb->status) { if (urb->status) {
...@@ -376,9 +367,6 @@ static void empeg_read_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -376,9 +367,6 @@ static void empeg_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
int i; int i;
int result; int result;
if (port_paranoia_check (port, __FUNCTION__))
return;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (!serial) { if (!serial) {
......
...@@ -1513,9 +1513,6 @@ static void ftdi_write_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -1513,9 +1513,6 @@ static void ftdi_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
/* free up the transfer buffer, as usb_free_urb() does not do this */ /* free up the transfer buffer, as usb_free_urb() does not do this */
kfree (urb->transfer_buffer); kfree (urb->transfer_buffer);
if (port_paranoia_check (port, __FUNCTION__))
return;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (urb->status) { if (urb->status) {
...@@ -1577,9 +1574,6 @@ static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -1577,9 +1574,6 @@ static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
dbg("%s", __FUNCTION__); dbg("%s", __FUNCTION__);
if (port_paranoia_check (port, __FUNCTION__)) {
return;
}
if (port->open_count <= 0) if (port->open_count <= 0)
return; return;
......
...@@ -83,9 +83,6 @@ int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp) ...@@ -83,9 +83,6 @@ int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp)
struct usb_serial *serial = port->serial; struct usb_serial *serial = port->serial;
int result = 0; int result = 0;
if (port_paranoia_check (port, __FUNCTION__))
return -ENODEV;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
/* force low_latency on so that our tty_push actually forces the data through, /* force low_latency on so that our tty_push actually forces the data through,
......
...@@ -825,7 +825,6 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs) ...@@ -825,7 +825,6 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs)
txCredits = data[position] | (data[position+1] << 8); txCredits = data[position] | (data[position+1] << 8);
if (txCredits) { 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); edge_port = usb_get_serial_port_data(port);
if (edge_port->open) { if (edge_port->open) {
edge_port->txCredits += txCredits; edge_port->txCredits += txCredits;
...@@ -839,7 +838,6 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs) ...@@ -839,7 +838,6 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs)
send_more_port_data(edge_serial, edge_port); send_more_port_data(edge_serial, edge_port);
} }
} }
}
position += 2; position += 2;
++portNumber; ++portNumber;
} }
...@@ -916,10 +914,6 @@ static void edge_bulk_out_data_callback (struct urb *urb, struct pt_regs *regs) ...@@ -916,10 +914,6 @@ static void edge_bulk_out_data_callback (struct urb *urb, struct pt_regs *regs)
dbg("%s", __FUNCTION__); dbg("%s", __FUNCTION__);
if (port_paranoia_check (edge_port->port, __FUNCTION__)) {
return;
}
if (urb->status) { if (urb->status) {
dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status); dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
} }
...@@ -969,10 +963,6 @@ static void edge_bulk_out_cmd_callback (struct urb *urb, struct pt_regs *regs) ...@@ -969,10 +963,6 @@ static void edge_bulk_out_cmd_callback (struct urb *urb, struct pt_regs *regs)
/* Free the command urb */ /* Free the command urb */
usb_free_urb (urb); usb_free_urb (urb);
if (port_paranoia_check (edge_port->port, __FUNCTION__)) {
return;
}
if (status) { if (status) {
dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, status); dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, status);
return; return;
...@@ -1009,9 +999,6 @@ static int edge_open (struct usb_serial_port *port, struct file * filp) ...@@ -1009,9 +999,6 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
int response; int response;
int timeout; int timeout;
if (port_paranoia_check (port, __FUNCTION__))
return -ENODEV;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (edge_port == NULL) if (edge_port == NULL)
...@@ -1245,9 +1232,6 @@ static void edge_close (struct usb_serial_port *port, struct file * filp) ...@@ -1245,9 +1232,6 @@ static void edge_close (struct usb_serial_port *port, struct file * filp)
struct edgeport_port *edge_port; struct edgeport_port *edge_port;
int status; int status;
if (port_paranoia_check (port, __FUNCTION__))
return;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial (port, __FUNCTION__); serial = get_usb_serial (port, __FUNCTION__);
...@@ -2071,7 +2055,6 @@ static int process_rcvd_data (struct edgeport_serial *edge_serial, unsigned char ...@@ -2071,7 +2055,6 @@ 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 */ /* spit this data back into the tty driver if this port is open */
if (rxLen) { 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); edge_port = usb_get_serial_port_data(port);
if (edge_port->open) { if (edge_port->open) {
tty = edge_port->port->tty; tty = edge_port->port->tty;
...@@ -2089,7 +2072,6 @@ static int process_rcvd_data (struct edgeport_serial *edge_serial, unsigned char ...@@ -2089,7 +2072,6 @@ static int process_rcvd_data (struct edgeport_serial *edge_serial, unsigned char
} }
edge_port->icount.rx += rxLen; edge_port->icount.rx += rxLen;
} }
}
buffer += rxLen; buffer += rxLen;
} }
...@@ -2124,9 +2106,6 @@ static void process_rcvd_status (struct edgeport_serial *edge_serial, __u8 byte2 ...@@ -2124,9 +2106,6 @@ static void process_rcvd_status (struct edgeport_serial *edge_serial, __u8 byte2
/* switch the port pointer to the one being currently talked about */ /* 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;
}
edge_port = usb_get_serial_port_data(port); edge_port = usb_get_serial_port_data(port);
if (edge_port == NULL) { if (edge_port == NULL) {
dev_err(&edge_serial->serial->dev->dev, "%s - edge_port == NULL for port %d\n", __FUNCTION__, edge_serial->rxPort); dev_err(&edge_serial->serial->dev->dev, "%s - edge_port == NULL for port %d\n", __FUNCTION__, edge_serial->rxPort);
......
...@@ -1685,11 +1685,6 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs) ...@@ -1685,11 +1685,6 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs)
dbg ("%s - port_number %d, function %d, info 0x%x", dbg ("%s - port_number %d, function %d, info 0x%x",
__FUNCTION__, port_number, function, data[1]); __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__);
return;
}
edge_port = usb_get_serial_port_data(port); edge_port = usb_get_serial_port_data(port);
if (!edge_port) { if (!edge_port) {
dbg ("%s - edge_port not found", __FUNCTION__); dbg ("%s - edge_port not found", __FUNCTION__);
...@@ -1744,9 +1739,6 @@ static void edge_bulk_in_callback (struct urb *urb, struct pt_regs *regs) ...@@ -1744,9 +1739,6 @@ static void edge_bulk_in_callback (struct urb *urb, struct pt_regs *regs)
dbg("%s", __FUNCTION__); dbg("%s", __FUNCTION__);
if (port_paranoia_check (edge_port->port, __FUNCTION__))
return;
if (urb->status) { if (urb->status) {
dbg ("%s - nonzero read bulk status received: %d", dbg ("%s - nonzero read bulk status received: %d",
__FUNCTION__, urb->status); __FUNCTION__, urb->status);
...@@ -1848,9 +1840,6 @@ static int edge_open (struct usb_serial_port *port, struct file * filp) ...@@ -1848,9 +1840,6 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
u16 open_settings; u16 open_settings;
u8 transaction_timeout; u8 transaction_timeout;
if (port_paranoia_check (port, __FUNCTION__))
return -ENODEV;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (edge_port == NULL) if (edge_port == NULL)
...@@ -1999,9 +1988,6 @@ static void edge_close (struct usb_serial_port *port, struct file * filp) ...@@ -1999,9 +1988,6 @@ static void edge_close (struct usb_serial_port *port, struct file * filp)
int port_number; int port_number;
int status; int status;
if (port_paranoia_check (port, __FUNCTION__))
return;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial (port, __FUNCTION__); serial = get_usb_serial (port, __FUNCTION__);
......
...@@ -181,10 +181,6 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) ...@@ -181,10 +181,6 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp)
int i, result = 0; int i, result = 0;
int retries = KP_RETRIES; int retries = KP_RETRIES;
if (port_paranoia_check(port, __FUNCTION__)) {
return -ENODEV;
}
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
bytes_in = 0; bytes_in = 0;
...@@ -291,10 +287,6 @@ static void ipaq_close(struct usb_serial_port *port, struct file *filp) ...@@ -291,10 +287,6 @@ static void ipaq_close(struct usb_serial_port *port, struct file *filp)
struct usb_serial *serial; struct usb_serial *serial;
struct ipaq_private *priv = usb_get_serial_port_data(port); struct ipaq_private *priv = usb_get_serial_port_data(port);
if (port_paranoia_check(port, __FUNCTION__)) {
return;
}
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial(port, __FUNCTION__); serial = get_usb_serial(port, __FUNCTION__);
...@@ -323,9 +315,6 @@ static void ipaq_read_bulk_callback(struct urb *urb, struct pt_regs *regs) ...@@ -323,9 +315,6 @@ static void ipaq_read_bulk_callback(struct urb *urb, struct pt_regs *regs)
unsigned char *data = urb->transfer_buffer; unsigned char *data = urb->transfer_buffer;
int i, result; int i, result;
if (port_paranoia_check(port, __FUNCTION__))
return;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (!serial) { if (!serial) {
...@@ -488,10 +477,6 @@ static void ipaq_write_bulk_callback(struct urb *urb, struct pt_regs *regs) ...@@ -488,10 +477,6 @@ static void ipaq_write_bulk_callback(struct urb *urb, struct pt_regs *regs)
unsigned long flags; unsigned long flags;
int result; int result;
if (port_paranoia_check (port, __FUNCTION__)) {
return;
}
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (urb->status) { if (urb->status) {
......
...@@ -283,9 +283,6 @@ static int ir_open (struct usb_serial_port *port, struct file *filp) ...@@ -283,9 +283,6 @@ static int ir_open (struct usb_serial_port *port, struct file *filp)
char *buffer; char *buffer;
int result = 0; int result = 0;
if (port_paranoia_check (port, __FUNCTION__))
return -ENODEV;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (buffer_size) { if (buffer_size) {
...@@ -330,9 +327,6 @@ static void ir_close (struct usb_serial_port *port, struct file * filp) ...@@ -330,9 +327,6 @@ static void ir_close (struct usb_serial_port *port, struct file * filp)
{ {
struct usb_serial *serial; struct usb_serial *serial;
if (port_paranoia_check (port, __FUNCTION__))
return;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial (port, __FUNCTION__); serial = get_usb_serial (port, __FUNCTION__);
...@@ -411,9 +405,6 @@ static void ir_write_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -411,9 +405,6 @@ static void ir_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
{ {
struct usb_serial_port *port = (struct usb_serial_port *)urb->context; struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
if (port_paranoia_check (port, __FUNCTION__))
return;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (urb->status) { if (urb->status) {
...@@ -438,9 +429,6 @@ static void ir_read_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -438,9 +429,6 @@ static void ir_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
unsigned char *data = urb->transfer_buffer; unsigned char *data = urb->transfer_buffer;
int result; int result;
if (port_paranoia_check (port, __FUNCTION__))
return;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (!serial) { if (!serial) {
......
...@@ -249,11 +249,6 @@ static void keyspan_pda_rx_interrupt (struct urb *urb, struct pt_regs *regs) ...@@ -249,11 +249,6 @@ static void keyspan_pda_rx_interrupt (struct urb *urb, struct pt_regs *regs)
goto exit; goto exit;
} }
if (port_paranoia_check (port, "keyspan_pda_rx_interrupt")) {
return;
}
serial = port->serial; serial = port->serial;
if (serial_paranoia_check (serial, "keyspan_pda_rx_interrupt")) { if (serial_paranoia_check (serial, "keyspan_pda_rx_interrupt")) {
return; return;
...@@ -638,10 +633,6 @@ static void keyspan_pda_write_bulk_callback (struct urb *urb, struct pt_regs *re ...@@ -638,10 +633,6 @@ static void keyspan_pda_write_bulk_callback (struct urb *urb, struct pt_regs *re
priv = usb_get_serial_port_data(port); priv = usb_get_serial_port_data(port);
if (port_paranoia_check (port, "keyspan_pda_rx_interrupt")) {
return;
}
serial = port->serial; serial = port->serial;
if (serial_paranoia_check (serial, "keyspan_pda_rx_interrupt")) { if (serial_paranoia_check (serial, "keyspan_pda_rx_interrupt")) {
return; return;
......
...@@ -230,9 +230,6 @@ static int kobil_open (struct usb_serial_port *port, struct file *filp) ...@@ -230,9 +230,6 @@ static int kobil_open (struct usb_serial_port *port, struct file *filp)
priv = usb_get_serial_port_data(port); priv = usb_get_serial_port_data(port);
priv->line_state = 0; priv->line_state = 0;
if (port_paranoia_check (port, __FUNCTION__))
return -ENODEV;
// someone sets the dev to 0 if the close method has been called // someone sets the dev to 0 if the close method has been called
port->interrupt_in_urb->dev = port->serial->dev; port->interrupt_in_urb->dev = port->serial->dev;
......
...@@ -156,9 +156,6 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp) ...@@ -156,9 +156,6 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp)
struct omninet_data *od; struct omninet_data *od;
int result = 0; int result = 0;
if (port_paranoia_check (port, __FUNCTION__))
return -ENODEV;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial (port, __FUNCTION__); serial = get_usb_serial (port, __FUNCTION__);
...@@ -193,9 +190,6 @@ static void omninet_close (struct usb_serial_port *port, struct file * filp) ...@@ -193,9 +190,6 @@ static void omninet_close (struct usb_serial_port *port, struct file * filp)
struct usb_serial_port *wport; struct usb_serial_port *wport;
struct omninet_data *od; struct omninet_data *od;
if (port_paranoia_check (port, __FUNCTION__))
return;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial (port, __FUNCTION__); serial = get_usb_serial (port, __FUNCTION__);
...@@ -348,11 +342,6 @@ static void omninet_write_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -348,11 +342,6 @@ static void omninet_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
// dbg("omninet_write_bulk_callback, port %0x\n", port); // dbg("omninet_write_bulk_callback, port %0x\n", port);
if (port_paranoia_check (port, __FUNCTION__)) {
return;
}
serial = port->serial; serial = port->serial;
if (serial_paranoia_check (serial, __FUNCTION__)) { if (serial_paranoia_check (serial, __FUNCTION__)) {
return; return;
......
...@@ -411,9 +411,6 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp) ...@@ -411,9 +411,6 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp)
unsigned char *buf; unsigned char *buf;
int result; int result;
if (port_paranoia_check (port, __FUNCTION__))
return -ENODEV;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
usb_clear_halt(serial->dev, port->write_urb->pipe); usb_clear_halt(serial->dev, port->write_urb->pipe);
...@@ -480,8 +477,6 @@ static void pl2303_close (struct usb_serial_port *port, struct file *filp) ...@@ -480,8 +477,6 @@ static void pl2303_close (struct usb_serial_port *port, struct file *filp)
unsigned int c_cflag; unsigned int c_cflag;
int result; int result;
if (port_paranoia_check (port, __FUNCTION__))
return;
serial = get_usb_serial (port, __FUNCTION__); serial = get_usb_serial (port, __FUNCTION__);
if (!serial) if (!serial)
return; return;
...@@ -723,9 +718,6 @@ static void pl2303_read_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -723,9 +718,6 @@ static void pl2303_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
u8 status; u8 status;
char tty_flag; char tty_flag;
if (port_paranoia_check (port, __FUNCTION__))
return;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (!serial) { if (!serial) {
...@@ -807,9 +799,6 @@ static void pl2303_write_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -807,9 +799,6 @@ static void pl2303_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
struct usb_serial_port *port = (struct usb_serial_port *) urb->context; struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
int result; int result;
if (port_paranoia_check (port, __FUNCTION__))
return;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (urb->status) { if (urb->status) {
......
/* /*
* USB Serial Converter driver * USB Serial Converter driver
* *
* Copyright (C) 1999 - 2003 * Copyright (C) 1999 - 2004
* Greg Kroah-Hartman (greg@kroah.com) * Greg Kroah-Hartman (greg@kroah.com)
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -309,27 +309,10 @@ static inline int serial_paranoia_check (struct usb_serial *serial, const char * ...@@ -309,27 +309,10 @@ static inline int serial_paranoia_check (struct usb_serial *serial, const char *
return 0; return 0;
} }
static inline int port_paranoia_check (struct usb_serial_port *port, const char *function)
{
if (!port) {
dbg("%s - port == NULL", function);
return -1;
}
if (!port->serial) {
dbg("%s - port->serial == NULL", function);
return -1;
}
return 0;
}
static inline struct usb_serial* get_usb_serial (struct usb_serial_port *port, const char *function) static inline struct usb_serial* get_usb_serial (struct usb_serial_port *port, const char *function)
{ {
/* if no port was specified, or it fails a paranoia check */ /* if no port was specified, or it fails a paranoia check */
if (!port || if (!port ||
port_paranoia_check (port, function) ||
serial_paranoia_check (port->serial, function)) { serial_paranoia_check (port->serial, function)) {
/* then say that we don't have a valid usb_serial thing, which will /* then say that we don't have a valid usb_serial thing, which will
* end up genrating -ENODEV return values */ * end up genrating -ENODEV return values */
......
...@@ -396,9 +396,6 @@ static int visor_open (struct usb_serial_port *port, struct file *filp) ...@@ -396,9 +396,6 @@ static int visor_open (struct usb_serial_port *port, struct file *filp)
struct usb_serial *serial = port->serial; struct usb_serial *serial = port->serial;
int result = 0; int result = 0;
if (port_paranoia_check (port, __FUNCTION__))
return -ENODEV;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (!port->read_urb) { if (!port->read_urb) {
...@@ -449,9 +446,6 @@ static void visor_close (struct usb_serial_port *port, struct file * filp) ...@@ -449,9 +446,6 @@ static void visor_close (struct usb_serial_port *port, struct file * filp)
struct usb_serial *serial; struct usb_serial *serial;
unsigned char *transfer_buffer; unsigned char *transfer_buffer;
if (port_paranoia_check (port, __FUNCTION__))
return;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial (port, __FUNCTION__); serial = get_usb_serial (port, __FUNCTION__);
...@@ -571,9 +565,6 @@ static void visor_write_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -571,9 +565,6 @@ static void visor_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
/* free up the transfer buffer, as usb_free_urb() does not do this */ /* free up the transfer buffer, as usb_free_urb() does not do this */
kfree (urb->transfer_buffer); kfree (urb->transfer_buffer);
if (port_paranoia_check (port, __FUNCTION__))
return;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (urb->status) if (urb->status)
...@@ -593,9 +584,6 @@ static void visor_read_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -593,9 +584,6 @@ static void visor_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
int i; int i;
int result; int result;
if (port_paranoia_check (port, __FUNCTION__))
return;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (!serial) { if (!serial) {
......
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