]> err.no Git - linux-2.6/commitdiff
USB: serial: cyberjack: clean up urb->status usage
authorGreg Kroah-Hartman <gregkh@suse.de>
Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 12 Jul 2007 23:34:32 +0000 (16:34 -0700)
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: <support@reiner-sct.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/cyberjack.c

index 4167753ed31fc3efa401bb1366c4e1991e04358b..4353df92487f528256ca27bb8169d287d3f85b63 100644 (file)
@@ -305,12 +305,13 @@ static void cyberjack_read_int_callback( struct urb *urb )
        struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
        struct cyberjack_private *priv = usb_get_serial_port_data(port);
        unsigned char *data = urb->transfer_buffer;
+       int status = urb->status;
        int result;
 
        dbg("%s - port %d", __FUNCTION__, port->number);
 
        /* the urb might have been killed. */
-       if (urb->status)
+       if (status)
                return;
 
        usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
@@ -365,12 +366,14 @@ static void cyberjack_read_bulk_callback (struct urb *urb)
        unsigned char *data = urb->transfer_buffer;
        short todo;
        int result;
+       int status = urb->status;
 
        dbg("%s - port %d", __FUNCTION__, port->number);
-       
+
        usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
-       if (urb->status) {
-               dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
+       if (status) {
+               dbg("%s - nonzero read bulk status received: %d",
+                   __FUNCTION__, status);
                return;
        }
 
@@ -411,12 +414,14 @@ static void cyberjack_write_bulk_callback (struct urb *urb)
 {
        struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
        struct cyberjack_private *priv = usb_get_serial_port_data(port);
+       int status = urb->status;
 
        dbg("%s - port %d", __FUNCTION__, port->number);
 
        port->write_urb_busy = 0;
-       if (urb->status) {
-               dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
+       if (status) {
+               dbg("%s - nonzero write bulk status received: %d",
+                   __FUNCTION__, status);
                return;
        }