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

USB: serial: whiteheat: 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>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 38e8c910
...@@ -974,10 +974,12 @@ static void whiteheat_unthrottle (struct usb_serial_port *port) ...@@ -974,10 +974,12 @@ static void whiteheat_unthrottle (struct usb_serial_port *port)
*****************************************************************************/ *****************************************************************************/
static void command_port_write_callback(struct urb *urb) static void command_port_write_callback(struct urb *urb)
{ {
int status = urb->status;
dbg("%s", __FUNCTION__); dbg("%s", __FUNCTION__);
if (urb->status) { if (status) {
dbg ("nonzero urb status: %d", urb->status); dbg("nonzero urb status: %d", status);
return; return;
} }
} }
...@@ -987,6 +989,7 @@ static void command_port_read_callback(struct urb *urb) ...@@ -987,6 +989,7 @@ static void command_port_read_callback(struct urb *urb)
{ {
struct usb_serial_port *command_port = (struct usb_serial_port *)urb->context; struct usb_serial_port *command_port = (struct usb_serial_port *)urb->context;
struct whiteheat_command_private *command_info; struct whiteheat_command_private *command_info;
int status = urb->status;
unsigned char *data = urb->transfer_buffer; unsigned char *data = urb->transfer_buffer;
int result; int result;
...@@ -997,9 +1000,9 @@ static void command_port_read_callback(struct urb *urb) ...@@ -997,9 +1000,9 @@ static void command_port_read_callback(struct urb *urb)
dbg ("%s - command_info is NULL, exiting.", __FUNCTION__); dbg ("%s - command_info is NULL, exiting.", __FUNCTION__);
return; return;
} }
if (urb->status) { if (status) {
dbg("%s - nonzero urb status: %d", __FUNCTION__, urb->status); dbg("%s - nonzero urb status: %d", __FUNCTION__, status);
if (urb->status != -ENOENT) if (status != -ENOENT)
command_info->command_finished = WHITEHEAT_CMD_FAILURE; command_info->command_finished = WHITEHEAT_CMD_FAILURE;
wake_up(&command_info->wait_command); wake_up(&command_info->wait_command);
return; return;
...@@ -1038,6 +1041,7 @@ static void whiteheat_read_callback(struct urb *urb) ...@@ -1038,6 +1041,7 @@ static void whiteheat_read_callback(struct urb *urb)
struct whiteheat_urb_wrap *wrap; struct whiteheat_urb_wrap *wrap;
unsigned char *data = urb->transfer_buffer; unsigned char *data = urb->transfer_buffer;
struct whiteheat_private *info = usb_get_serial_port_data(port); struct whiteheat_private *info = usb_get_serial_port_data(port);
int status = urb->status;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
...@@ -1051,8 +1055,9 @@ static void whiteheat_read_callback(struct urb *urb) ...@@ -1051,8 +1055,9 @@ static void whiteheat_read_callback(struct urb *urb)
list_del(&wrap->list); list_del(&wrap->list);
spin_unlock(&info->lock); spin_unlock(&info->lock);
if (urb->status) { if (status) {
dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status); dbg("%s - nonzero read bulk status received: %d",
__FUNCTION__, status);
spin_lock(&info->lock); spin_lock(&info->lock);
list_add(&wrap->list, &info->rx_urbs_free); list_add(&wrap->list, &info->rx_urbs_free);
spin_unlock(&info->lock); spin_unlock(&info->lock);
...@@ -1079,6 +1084,7 @@ static void whiteheat_write_callback(struct urb *urb) ...@@ -1079,6 +1084,7 @@ static void whiteheat_write_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 whiteheat_private *info = usb_get_serial_port_data(port); struct whiteheat_private *info = usb_get_serial_port_data(port);
struct whiteheat_urb_wrap *wrap; struct whiteheat_urb_wrap *wrap;
int status = urb->status;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
...@@ -1092,8 +1098,9 @@ static void whiteheat_write_callback(struct urb *urb) ...@@ -1092,8 +1098,9 @@ static void whiteheat_write_callback(struct urb *urb)
list_move(&wrap->list, &info->tx_urbs_free); list_move(&wrap->list, &info->tx_urbs_free);
spin_unlock(&info->lock); spin_unlock(&info->lock);
if (urb->status) { if (status) {
dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status); dbg("%s - nonzero write bulk status received: %d",
__FUNCTION__, 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