aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-06-15 18:44:13 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-12 19:34:36 -0400
commit05400013698776a71b1e401ceacf709bda3d1517 (patch)
tree81dc1319ef1445ff05053fc4120853de06c603d2 /drivers/usb/serial
parent38e8c910ff7a1aafe2923f085df0f74a60f9de3c (diff)
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: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/whiteheat.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index 8fd976d728ed..8611ee569613 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -974,10 +974,12 @@ static void whiteheat_unthrottle (struct usb_serial_port *port)
974 *****************************************************************************/ 974 *****************************************************************************/
975static void command_port_write_callback(struct urb *urb) 975static void command_port_write_callback(struct urb *urb)
976{ 976{
977 int status = urb->status;
978
977 dbg("%s", __FUNCTION__); 979 dbg("%s", __FUNCTION__);
978 980
979 if (urb->status) { 981 if (status) {
980 dbg ("nonzero urb status: %d", urb->status); 982 dbg("nonzero urb status: %d", status);
981 return; 983 return;
982 } 984 }
983} 985}
@@ -987,6 +989,7 @@ static void command_port_read_callback(struct urb *urb)
987{ 989{
988 struct usb_serial_port *command_port = (struct usb_serial_port *)urb->context; 990 struct usb_serial_port *command_port = (struct usb_serial_port *)urb->context;
989 struct whiteheat_command_private *command_info; 991 struct whiteheat_command_private *command_info;
992 int status = urb->status;
990 unsigned char *data = urb->transfer_buffer; 993 unsigned char *data = urb->transfer_buffer;
991 int result; 994 int result;
992 995
@@ -997,9 +1000,9 @@ static void command_port_read_callback(struct urb *urb)
997 dbg ("%s - command_info is NULL, exiting.", __FUNCTION__); 1000 dbg ("%s - command_info is NULL, exiting.", __FUNCTION__);
998 return; 1001 return;
999 } 1002 }
1000 if (urb->status) { 1003 if (status) {
1001 dbg("%s - nonzero urb status: %d", __FUNCTION__, urb->status); 1004 dbg("%s - nonzero urb status: %d", __FUNCTION__, status);
1002 if (urb->status != -ENOENT) 1005 if (status != -ENOENT)
1003 command_info->command_finished = WHITEHEAT_CMD_FAILURE; 1006 command_info->command_finished = WHITEHEAT_CMD_FAILURE;
1004 wake_up(&command_info->wait_command); 1007 wake_up(&command_info->wait_command);
1005 return; 1008 return;
@@ -1038,6 +1041,7 @@ static void whiteheat_read_callback(struct urb *urb)
1038 struct whiteheat_urb_wrap *wrap; 1041 struct whiteheat_urb_wrap *wrap;
1039 unsigned char *data = urb->transfer_buffer; 1042 unsigned char *data = urb->transfer_buffer;
1040 struct whiteheat_private *info = usb_get_serial_port_data(port); 1043 struct whiteheat_private *info = usb_get_serial_port_data(port);
1044 int status = urb->status;
1041 1045
1042 dbg("%s - port %d", __FUNCTION__, port->number); 1046 dbg("%s - port %d", __FUNCTION__, port->number);
1043 1047
@@ -1051,8 +1055,9 @@ static void whiteheat_read_callback(struct urb *urb)
1051 list_del(&wrap->list); 1055 list_del(&wrap->list);
1052 spin_unlock(&info->lock); 1056 spin_unlock(&info->lock);
1053 1057
1054 if (urb->status) { 1058 if (status) {
1055 dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status); 1059 dbg("%s - nonzero read bulk status received: %d",
1060 __FUNCTION__, status);
1056 spin_lock(&info->lock); 1061 spin_lock(&info->lock);
1057 list_add(&wrap->list, &info->rx_urbs_free); 1062 list_add(&wrap->list, &info->rx_urbs_free);
1058 spin_unlock(&info->lock); 1063 spin_unlock(&info->lock);
@@ -1079,6 +1084,7 @@ static void whiteheat_write_callback(struct urb *urb)
1079 struct usb_serial_port *port = (struct usb_serial_port *)urb->context; 1084 struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
1080 struct whiteheat_private *info = usb_get_serial_port_data(port); 1085 struct whiteheat_private *info = usb_get_serial_port_data(port);
1081 struct whiteheat_urb_wrap *wrap; 1086 struct whiteheat_urb_wrap *wrap;
1087 int status = urb->status;
1082 1088
1083 dbg("%s - port %d", __FUNCTION__, port->number); 1089 dbg("%s - port %d", __FUNCTION__, port->number);
1084 1090
@@ -1092,8 +1098,9 @@ static void whiteheat_write_callback(struct urb *urb)
1092 list_move(&wrap->list, &info->tx_urbs_free); 1098 list_move(&wrap->list, &info->tx_urbs_free);
1093 spin_unlock(&info->lock); 1099 spin_unlock(&info->lock);
1094 1100
1095 if (urb->status) { 1101 if (status) {
1096 dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status); 1102 dbg("%s - nonzero write bulk status received: %d",
1103 __FUNCTION__, status);
1097 return; 1104 return;
1098 } 1105 }
1099 1106