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

USB: serial: io_ti: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Al Borchers <alborchers@steinerpoint.com>
Cc: Peter Berger <pberger@brimson.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 2a393f5f
...@@ -1719,13 +1719,14 @@ static void edge_interrupt_callback (struct urb *urb) ...@@ -1719,13 +1719,14 @@ static void edge_interrupt_callback (struct urb *urb)
int length = urb->actual_length; int length = urb->actual_length;
int port_number; int port_number;
int function; int function;
int status; int retval;
__u8 lsr; __u8 lsr;
__u8 msr; __u8 msr;
int status = urb->status;
dbg("%s", __FUNCTION__); dbg("%s", __FUNCTION__);
switch (urb->status) { switch (status) {
case 0: case 0:
/* success */ /* success */
break; break;
...@@ -1733,10 +1734,12 @@ static void edge_interrupt_callback (struct urb *urb) ...@@ -1733,10 +1734,12 @@ static void edge_interrupt_callback (struct urb *urb)
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
/* this urb is terminated, clean up */ /* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status); dbg("%s - urb shutting down with status: %d",
__FUNCTION__, status);
return; return;
default: default:
dev_err(&urb->dev->dev, "%s - nonzero urb status received: %d\n", __FUNCTION__, urb->status); dev_err(&urb->dev->dev, "%s - nonzero urb status received: "
"%d\n", __FUNCTION__, status);
goto exit; goto exit;
} }
...@@ -1794,10 +1797,10 @@ static void edge_interrupt_callback (struct urb *urb) ...@@ -1794,10 +1797,10 @@ static void edge_interrupt_callback (struct urb *urb)
} }
exit: exit:
status = usb_submit_urb (urb, GFP_ATOMIC); retval = usb_submit_urb (urb, GFP_ATOMIC);
if (status) if (retval)
dev_err (&urb->dev->dev, "%s - usb_submit_urb failed with result %d\n", dev_err (&urb->dev->dev, "%s - usb_submit_urb failed with result %d\n",
__FUNCTION__, status); __FUNCTION__, retval);
} }
static void edge_bulk_in_callback (struct urb *urb) static void edge_bulk_in_callback (struct urb *urb)
...@@ -1805,12 +1808,13 @@ static void edge_bulk_in_callback (struct urb *urb) ...@@ -1805,12 +1808,13 @@ static void edge_bulk_in_callback (struct urb *urb)
struct edgeport_port *edge_port = (struct edgeport_port *)urb->context; struct edgeport_port *edge_port = (struct edgeport_port *)urb->context;
unsigned char *data = urb->transfer_buffer; unsigned char *data = urb->transfer_buffer;
struct tty_struct *tty; struct tty_struct *tty;
int status = 0; int retval = 0;
int port_number; int port_number;
int status = urb->status;
dbg("%s", __FUNCTION__); dbg("%s", __FUNCTION__);
switch (urb->status) { switch (status) {
case 0: case 0:
/* success */ /* success */
break; break;
...@@ -1818,17 +1822,18 @@ static void edge_bulk_in_callback (struct urb *urb) ...@@ -1818,17 +1822,18 @@ static void edge_bulk_in_callback (struct urb *urb)
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
/* this urb is terminated, clean up */ /* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status); dbg("%s - urb shutting down with status: %d",
__FUNCTION__, status);
return; return;
default: default:
dev_err (&urb->dev->dev,"%s - nonzero read bulk status received: %d\n", dev_err (&urb->dev->dev,"%s - nonzero read bulk status received: %d\n",
__FUNCTION__, urb->status ); __FUNCTION__, status);
} }
if (urb->status == -EPIPE) if (status == -EPIPE)
goto exit; goto exit;
if (urb->status) { if (status) {
dev_err(&urb->dev->dev,"%s - stopping read!\n", __FUNCTION__); dev_err(&urb->dev->dev,"%s - stopping read!\n", __FUNCTION__);
return; return;
} }
...@@ -1862,14 +1867,14 @@ static void edge_bulk_in_callback (struct urb *urb) ...@@ -1862,14 +1867,14 @@ static void edge_bulk_in_callback (struct urb *urb)
spin_lock(&edge_port->ep_lock); spin_lock(&edge_port->ep_lock);
if (edge_port->ep_read_urb_state == EDGE_READ_URB_RUNNING) { if (edge_port->ep_read_urb_state == EDGE_READ_URB_RUNNING) {
urb->dev = edge_port->port->serial->dev; urb->dev = edge_port->port->serial->dev;
status = usb_submit_urb(urb, GFP_ATOMIC); retval = usb_submit_urb(urb, GFP_ATOMIC);
} else if (edge_port->ep_read_urb_state == EDGE_READ_URB_STOPPING) { } else if (edge_port->ep_read_urb_state == EDGE_READ_URB_STOPPING) {
edge_port->ep_read_urb_state = EDGE_READ_URB_STOPPED; edge_port->ep_read_urb_state = EDGE_READ_URB_STOPPED;
} }
spin_unlock(&edge_port->ep_lock); spin_unlock(&edge_port->ep_lock);
if (status) if (retval)
dev_err (&urb->dev->dev, "%s - usb_submit_urb failed with result %d\n", dev_err (&urb->dev->dev, "%s - usb_submit_urb failed with result %d\n",
__FUNCTION__, status); __FUNCTION__, retval);
} }
static void edge_tty_recv(struct device *dev, struct tty_struct *tty, unsigned char *data, int length) static void edge_tty_recv(struct device *dev, struct tty_struct *tty, unsigned char *data, int length)
...@@ -1896,12 +1901,13 @@ static void edge_bulk_out_callback (struct urb *urb) ...@@ -1896,12 +1901,13 @@ static void edge_bulk_out_callback (struct urb *urb)
{ {
struct usb_serial_port *port = (struct usb_serial_port *)urb->context; struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct edgeport_port *edge_port = usb_get_serial_port_data(port); struct edgeport_port *edge_port = usb_get_serial_port_data(port);
int status = urb->status;
dbg ("%s - port %d", __FUNCTION__, port->number); dbg ("%s - port %d", __FUNCTION__, port->number);
edge_port->ep_write_urb_in_use = 0; edge_port->ep_write_urb_in_use = 0;
switch (urb->status) { switch (status) {
case 0: case 0:
/* success */ /* success */
break; break;
...@@ -1909,11 +1915,12 @@ static void edge_bulk_out_callback (struct urb *urb) ...@@ -1909,11 +1915,12 @@ static void edge_bulk_out_callback (struct urb *urb)
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
/* this urb is terminated, clean up */ /* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status); dbg("%s - urb shutting down with status: %d",
__FUNCTION__, status);
return; return;
default: default:
dev_err (&urb->dev->dev,"%s - nonzero write bulk status received: %d\n", dev_err(&urb->dev->dev, "%s - nonzero write bulk status "
__FUNCTION__, urb->status); "received: %d\n", __FUNCTION__, status);
} }
/* send any buffered data */ /* send any buffered data */
......
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