]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/serial/navman.c
USB: serial: option: clean up urb->status usage
[linux-2.6-omap-h63xx.git] / drivers / usb / serial / navman.c
index ac3f8b5d2c495f931739eee3ee9d3509c694f44a..7f337c9aeb5fe9ba13c5c58dd2bf1b3f2c5e4052 100644 (file)
@@ -32,14 +32,15 @@ static struct usb_driver navman_driver = {
        .no_dynamic_id =        1,
 };
 
-static void navman_read_int_callback(struct urb *urb, struct pt_regs *regs)
+static void navman_read_int_callback(struct urb *urb)
 {
        struct usb_serial_port *port = urb->context;
        unsigned char *data = urb->transfer_buffer;
        struct tty_struct *tty;
+       int status = urb->status;
        int result;
 
-       switch (urb->status) {
+       switch (status) {
        case 0:
                /* success */
                break;
@@ -48,11 +49,11 @@ static void navman_read_int_callback(struct urb *urb, struct pt_regs *regs)
        case -ESHUTDOWN:
                /* this urb is terminated, clean up */
                dbg("%s - urb shutting down with status: %d",
-                   __FUNCTION__, urb->status);
+                   __FUNCTION__, status);
                return;
        default:
                dbg("%s - nonzero urb status received: %d",
-                   __FUNCTION__, urb->status);
+                   __FUNCTION__, status);
                goto exit;
        }
 
@@ -95,8 +96,7 @@ static void navman_close(struct usb_serial_port *port, struct file *filp)
 {
        dbg("%s - port %d", __FUNCTION__, port->number);
 
-       if (port->interrupt_in_urb)
-               usb_kill_urb(port->interrupt_in_urb);
+       usb_kill_urb(port->interrupt_in_urb);
 }
 
 static int navman_write(struct usb_serial_port *port,
@@ -120,6 +120,7 @@ static struct usb_serial_driver navman_device = {
                .name =         "navman",
        },
        .id_table =             id_table,
+       .usb_driver =           &navman_driver,
        .num_interrupt_in =     NUM_DONT_CARE,
        .num_bulk_in =          NUM_DONT_CARE,
        .num_bulk_out =         NUM_DONT_CARE,