USB: serial: mos7840: 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:35 +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: Paul Schroeder <pschroeder@uplogix.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/mos7840.c

index 36620c651079ccb4b20e8bde21e0f2df6581c226..a6678826452fa7f6e427c3689ea278718a3906b8 100644 (file)
@@ -434,6 +434,7 @@ static void mos7840_control_callback(struct urb *urb)
        struct moschip_port *mos7840_port;
        __u8 regval = 0x0;
        int result = 0;
+       int status = urb->status;
 
        if (!urb) {
                dbg("%s", "Invalid Pointer !!!!:\n");
@@ -442,7 +443,7 @@ static void mos7840_control_callback(struct urb *urb)
 
        mos7840_port = (struct moschip_port *)urb->context;
 
-       switch (urb->status) {
+       switch (status) {
        case 0:
                /* success */
                break;
@@ -451,11 +452,11 @@ static void mos7840_control_callback(struct urb *urb)
        case -ESHUTDOWN:
                /* this urb is terminated, clean up */
                dbg("%s - urb shutting down with status: %d", __FUNCTION__,
-                   urb->status);
+                   status);
                return;
        default:
                dbg("%s - nonzero urb status received: %d", __FUNCTION__,
-                   urb->status);
+                   status);
                goto exit;
        }
 
@@ -521,6 +522,7 @@ static void mos7840_interrupt_callback(struct urb *urb)
        __u8 sp[5], st;
        int i, rv = 0;
        __u16 wval, wreg = 0;
+       int status = urb->status;
 
        dbg("%s", " : Entering\n");
        if (!urb) {
@@ -528,7 +530,7 @@ static void mos7840_interrupt_callback(struct urb *urb)
                return;
        }
 
-       switch (urb->status) {
+       switch (status) {
        case 0:
                /* success */
                break;
@@ -537,11 +539,11 @@ static void mos7840_interrupt_callback(struct urb *urb)
        case -ESHUTDOWN:
                /* this urb is terminated, clean up */
                dbg("%s - urb shutting down with status: %d", __FUNCTION__,
-                   urb->status);
+                   status);
                return;
        default:
                dbg("%s - nonzero urb status received: %d", __FUNCTION__,
-                   urb->status);
+                   status);
                goto exit;
        }
 
@@ -666,20 +668,21 @@ static struct usb_serial *mos7840_get_usb_serial(struct usb_serial_port *port,
 
 static void mos7840_bulk_in_callback(struct urb *urb)
 {
-       int status;
+       int retval;
        unsigned char *data;
        struct usb_serial *serial;
        struct usb_serial_port *port;
        struct moschip_port *mos7840_port;
        struct tty_struct *tty;
+       int status = urb->status;
 
        if (!urb) {
                dbg("%s", "Invalid Pointer !!!!:\n");
                return;
        }
 
-       if (urb->status) {
-               dbg("nonzero read bulk status received: %d", urb->status);
+       if (status) {
+               dbg("nonzero read bulk status received: %d", status);
                return;
        }
 
@@ -729,11 +732,11 @@ static void mos7840_bulk_in_callback(struct urb *urb)
 
        mos7840_port->read_urb->dev = serial->dev;
 
-       status = usb_submit_urb(mos7840_port->read_urb, GFP_ATOMIC);
+       retval = usb_submit_urb(mos7840_port->read_urb, GFP_ATOMIC);
 
-       if (status) {
-               dbg(" usb_submit_urb(read bulk) failed, status = %d",
-                status);
+       if (retval) {
+               dbg(" usb_submit_urb(read bulk) failed, retval = %d",
+                retval);
        }
 }
 
@@ -747,6 +750,7 @@ static void mos7840_bulk_out_data_callback(struct urb *urb)
 {
        struct moschip_port *mos7840_port;
        struct tty_struct *tty;
+       int status = urb->status;
        int i;
 
        if (!urb) {
@@ -764,8 +768,8 @@ static void mos7840_bulk_out_data_callback(struct urb *urb)
        }
        spin_unlock(&mos7840_port->pool_lock);
 
-       if (urb->status) {
-               dbg("nonzero write bulk status received:%d\n", urb->status);
+       if (status) {
+               dbg("nonzero write bulk status received:%d\n", status);
                return;
        }