linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / usb / serial / ir-usb.c
index 1b348df..a590104 100644 (file)
@@ -46,6 +46,7 @@
  *     initial version released.
  */
 
+#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
@@ -57,7 +58,7 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-#include <linux/usb/serial.h>
+#include "usb-serial.h"
 
 /*
  * Version Information
@@ -183,9 +184,10 @@ static struct irda_class_desc *irda_usb_find_class_desc(struct usb_device *dev,
        struct irda_class_desc *desc;
        int ret;
                
-       desc = kzalloc(sizeof (struct irda_class_desc), GFP_KERNEL);
+       desc = kmalloc(sizeof (struct irda_class_desc), GFP_KERNEL);
        if (desc == NULL) 
                return NULL;
+       memset(desc, 0, sizeof(struct irda_class_desc));
        
        ret = usb_control_msg(dev, usb_rcvctrlpipe(dev,0),
                        IU_REQ_GET_CLASS_DESC,
@@ -342,14 +344,14 @@ static int ir_write (struct usb_serial_port *port, const unsigned char *buf, int
        if (count == 0)
                return 0;
 
-       spin_lock_bh(&port->lock);
+       spin_lock(&port->lock);
        if (port->write_urb_busy) {
-               spin_unlock_bh(&port->lock);
+               spin_unlock(&port->lock);
                dbg("%s - already writing", __FUNCTION__);
                return 0;
        }
        port->write_urb_busy = 1;
-       spin_unlock_bh(&port->lock);
+       spin_unlock(&port->lock);
 
        transfer_buffer = port->write_urb->transfer_buffer;
        transfer_size = min(count, port->bulk_out_size - 1);
@@ -407,7 +409,7 @@ static void ir_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
                urb->actual_length,
                urb->transfer_buffer);
 
-       usb_serial_port_softint(port);
+       schedule_work(&port->work);
 }
 
 static void ir_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
@@ -452,7 +454,8 @@ static void ir_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
                        tty = port->tty;
 
                        /*
-                        *      FIXME: must not do this in IRQ context
+                        *      FIXME: must not do this in IRQ context,
+                        *      must honour TTY_DONT_FLIP
                         */
                        tty->ldisc.receive_buf(
                                tty,