]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/usb/serial/safe_serial.c
USB: Typo: "USB_SAFE_PADDED" -> "USB_SERIAL_SAFE_PADDED".
[karo-tx-linux.git] / drivers / usb / serial / safe_serial.c
index 789771ecdb11013a168ffc5fa0157474ab4538dc..51669b7622bb8fdeaf80bdfd29017603d58ec5cb 100644 (file)
 #include <linux/usb/serial.h>
 
 
-#ifndef CONFIG_USB_SAFE_PADDED
-#define CONFIG_USB_SAFE_PADDED 0
+#ifndef CONFIG_USB_SERIAL_SAFE_PADDED
+#define CONFIG_USB_SERIAL_SAFE_PADDED 0
 #endif
 
 static int debug;
 static int safe = 1;
-static int padded = CONFIG_USB_SAFE_PADDED;
+static int padded = CONFIG_USB_SERIAL_SAFE_PADDED;
 
 #define DRIVER_VERSION "v0.0b"
 #define DRIVER_AUTHOR "sl@lineo.com, tbr@lineo.com"
@@ -204,18 +204,20 @@ static __u16 __inline__ fcs_compute10 (unsigned char *sp, int len, __u16 fcs)
        return fcs;
 }
 
-static void safe_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
+static void safe_read_bulk_callback (struct urb *urb)
 {
        struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
        unsigned char *data = urb->transfer_buffer;
        unsigned char length = urb->actual_length;
        int i;
        int result;
+       int status = urb->status;
 
        dbg ("%s", __FUNCTION__);
 
-       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;
        }
 
@@ -298,14 +300,14 @@ static int safe_write (struct usb_serial_port *port, const unsigned char *buf, i
                dbg ("%s - write request of 0 bytes", __FUNCTION__);
                return (0);
        }
-       spin_lock(&port->lock);
+       spin_lock_bh(&port->lock);
        if (port->write_urb_busy) {
-               spin_unlock(&port->lock);
+               spin_unlock_bh(&port->lock);
                dbg("%s - already writing", __FUNCTION__);
                return 0;
        }
        port->write_urb_busy = 1;
-       spin_unlock(&port->lock);
+       spin_unlock_bh(&port->lock);
 
        packet_length = port->bulk_out_size;    // get max packetsize
 
@@ -402,6 +404,7 @@ static struct usb_serial_driver safe_device = {
                .name =         "safe_serial",
        },
        .id_table =             id_table,
+       .usb_driver =           &safe_driver,
        .num_interrupt_in =     NUM_DONT_CARE,
        .num_bulk_in =          NUM_DONT_CARE,
        .num_bulk_out =         NUM_DONT_CARE,