Commit 0fb0aa18 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: serial: ftdi_sio: 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: Kuba Ober <kuba@mareimbrium.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 335202f4
...@@ -1576,14 +1576,15 @@ static void ftdi_write_bulk_callback (struct urb *urb) ...@@ -1576,14 +1576,15 @@ static void ftdi_write_bulk_callback (struct urb *urb)
struct ftdi_private *priv; struct ftdi_private *priv;
int data_offset; /* will be 1 for the SIO and 0 otherwise */ int data_offset; /* will be 1 for the SIO and 0 otherwise */
unsigned long countback; unsigned long countback;
int status = urb->status;
/* 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);
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (urb->status) { if (status) {
dbg("nonzero write bulk status received: %d", urb->status); dbg("nonzero write bulk status received: %d", status);
return; return;
} }
...@@ -1659,6 +1660,7 @@ static void ftdi_read_bulk_callback (struct urb *urb) ...@@ -1659,6 +1660,7 @@ static void ftdi_read_bulk_callback (struct urb *urb)
struct ftdi_private *priv; struct ftdi_private *priv;
unsigned long countread; unsigned long countread;
unsigned long flags; unsigned long flags;
int status = urb->status;
if (urb->number_of_packets > 0) { if (urb->number_of_packets > 0) {
err("%s transfer_buffer_length %d actual_length %d number of packets %d",__FUNCTION__, err("%s transfer_buffer_length %d actual_length %d number of packets %d",__FUNCTION__,
...@@ -1687,9 +1689,10 @@ static void ftdi_read_bulk_callback (struct urb *urb) ...@@ -1687,9 +1689,10 @@ static void ftdi_read_bulk_callback (struct urb *urb)
err("%s - Not my urb!", __FUNCTION__); err("%s - Not my urb!", __FUNCTION__);
} }
if (urb->status) { if (status) {
/* This will happen at close every time so it is a dbg not an err */ /* This will happen at close every time so it is a dbg not an err */
dbg("(this is ok on close) nonzero read bulk status received: %d", urb->status); dbg("(this is ok on close) nonzero read bulk status received: "
"%d", status);
return; return;
} }
......
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