vserver 1.9.3
[linux-2.6.git] / drivers / usb / serial / keyspan_pda.c
index 36d8e6a..cd441d7 100644 (file)
 #include <asm/uaccess.h>
 #include <linux/usb.h>
 
-#ifdef CONFIG_USB_SERIAL_DEBUG
-       static int debug = 1;
-#else
-       static int debug;
-#endif
-
+static int debug;
 
 struct ezusb_hex_record {
        __u16 address;
@@ -191,13 +186,7 @@ static void keyspan_pda_wakeup_write( struct usb_serial_port *port )
        wake_up_interruptible( &port->write_wait );
 
        /* wake up line discipline */
-       if( (tty->flags & (1 << TTY_DO_WRITE_WAKEUP))
-       && tty->ldisc.write_wakeup )
-               (tty->ldisc.write_wakeup)(tty);
-
-       /* wake up other tty processes */
-       wake_up_interruptible( &tty->write_wait );
-       /* For 2.2.16 backport -- wake_up_interruptible( &tty->poll_wait ); */
+       tty_wakeup(tty);
 }
 
 static void keyspan_pda_request_unthrottle( struct usb_serial *serial )
@@ -226,8 +215,7 @@ static void keyspan_pda_request_unthrottle( struct usb_serial *serial )
 static void keyspan_pda_rx_interrupt (struct urb *urb, struct pt_regs *regs)
 {
        struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
-       struct usb_serial *serial;
-               struct tty_struct *tty;
+               struct tty_struct *tty = port->tty;
        unsigned char *data = urb->transfer_buffer;
        int i;
        int status;
@@ -249,22 +237,11 @@ static void keyspan_pda_rx_interrupt (struct urb *urb, struct pt_regs *regs)
                goto exit;
        }
 
-       
-       if (port_paranoia_check (port, "keyspan_pda_rx_interrupt")) {
-               return;
-       }
-
-       serial = port->serial;
-       if (serial_paranoia_check (serial, "keyspan_pda_rx_interrupt")) {
-               return;
-       }
-       
        /* see if the message is data or a status interrupt */
        switch (data[0]) {
        case 0:
                /* rest of message is rx data */
                if (urb->actual_length) {
-                       tty = serial->port[0]->tty;
                        for (i = 1; i < urb->actual_length ; ++i) {
                                tty_insert_flip_char(tty, data[i], 0);
                        }
@@ -278,7 +255,6 @@ static void keyspan_pda_rx_interrupt (struct urb *urb, struct pt_regs *regs)
                case 1: /* modemline change */
                        break;
                case 2: /* tx unthrottle interrupt */
-                       tty = serial->port[0]->tty;
                        priv->tx_throttled = 0;
                        /* queue up a wakeup at scheduler time */
                        schedule_work(&priv->wakeup_work);
@@ -633,20 +609,10 @@ exit:
 static void keyspan_pda_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
 {
        struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
-       struct usb_serial *serial;
        struct keyspan_pda_private *priv;
 
        priv = usb_get_serial_port_data(port);
 
-       if (port_paranoia_check (port, "keyspan_pda_rx_interrupt")) {
-               return;
-       }
-
-       serial = port->serial;
-       if (serial_paranoia_check (serial, "keyspan_pda_rx_interrupt")) {
-               return;
-       }
-       
        /* queue up a wakeup at scheduler time */
        schedule_work(&priv->wakeup_work);
 }
@@ -804,7 +770,7 @@ static int keyspan_pda_startup (struct usb_serial *serial)
        usb_set_serial_port_data(serial->port[0], priv);
        init_waitqueue_head(&serial->port[0]->write_wait);
        INIT_WORK(&priv->wakeup_work, (void *)keyspan_pda_wakeup_write,
-                       (void *)(&serial->port[0]));
+                       (void *)(serial->port[0]));
        INIT_WORK(&priv->unthrottle_work,
                        (void *)keyspan_pda_request_unthrottle,
                        (void *)(serial));
@@ -932,6 +898,6 @@ MODULE_AUTHOR( DRIVER_AUTHOR );
 MODULE_DESCRIPTION( DRIVER_DESC );
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");