Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / usb / serial / belkin_sa.c
index bcf5601..4144777 100644 (file)
@@ -113,18 +113,20 @@ static struct usb_device_id id_table_combined [] = {
 MODULE_DEVICE_TABLE (usb, id_table_combined);
 
 static struct usb_driver belkin_driver = {
-       .owner =        THIS_MODULE,
        .name =         "belkin",
        .probe =        usb_serial_probe,
        .disconnect =   usb_serial_disconnect,
        .id_table =     id_table_combined,
+       .no_dynamic_id =        1,
 };
 
 /* All of the device info needed for the serial converters */
-static struct usb_serial_device_type belkin_device = {
-       .owner =                THIS_MODULE,
-       .name =                 "Belkin / Peracom / GoHubs USB Serial Adapter",
-       .short_name =           "belkin",
+static struct usb_serial_driver belkin_device = {
+       .driver = {
+               .owner =        THIS_MODULE,
+               .name =         "belkin",
+       },
+       .description =          "Belkin / Peracom / GoHubs USB Serial Adapter",
        .id_table =             id_table_combined,
        .num_interrupt_in =     1,
        .num_bulk_in =          1,
@@ -158,7 +160,7 @@ struct belkin_sa_private {
  * ***************************************************************************
  */
 
-#define WDR_TIMEOUT (HZ * 5 ) /* default urb timeout */
+#define WDR_TIMEOUT 5000 /* default urb timeout */
 
 /* assumes that struct usb_serial *serial is available */
 #define BSA_USB_CMD(c,v) usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), \
@@ -181,8 +183,8 @@ static int belkin_sa_startup (struct usb_serial *serial)
        priv->last_lsr = 0;
        priv->last_msr = 0;
        /* see comments at top of file */
-       priv->bad_flow_control = (dev->descriptor.bcdDevice <= 0x0206) ? 1 : 0;
-       info("bcdDevice: %04x, bfc: %d", dev->descriptor.bcdDevice, priv->bad_flow_control);
+       priv->bad_flow_control = (le16_to_cpu(dev->descriptor.bcdDevice) <= 0x0206) ? 1 : 0;
+       info("bcdDevice: %04x, bfc: %d", le16_to_cpu(dev->descriptor.bcdDevice), priv->bad_flow_control);
 
        init_waitqueue_head(&serial->port[0]->write_wait);
        usb_set_serial_port_data(serial->port[0], priv);
@@ -202,8 +204,7 @@ static void belkin_sa_shutdown (struct usb_serial *serial)
        for (i=0; i < serial->num_ports; ++i) {
                /* My special items, the standard routines free my urbs */
                priv = usb_get_serial_port_data(serial->port[i]);
-               if (priv)
-                       kfree(priv);
+               kfree(priv);
        }
 }
 
@@ -228,7 +229,7 @@ static int  belkin_sa_open (struct usb_serial_port *port, struct file *filp)
        port->interrupt_in_urb->dev = port->serial->dev;
        retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
        if (retval) {
-               usb_unlink_urb(port->read_urb);
+               usb_kill_urb(port->read_urb);
                err(" usb_submit_urb(read int) failed");
        }
 
@@ -242,9 +243,9 @@ static void belkin_sa_close (struct usb_serial_port *port, struct file *filp)
        dbg("%s port %d", __FUNCTION__, port->number);
 
        /* shutdown our bulk reads and writes */
-       usb_unlink_urb (port->write_urb);
-       usb_unlink_urb (port->read_urb);
-       usb_unlink_urb (port->interrupt_in_urb);
+       usb_kill_urb(port->write_urb);
+       usb_kill_urb(port->read_urb);
+       usb_kill_urb(port->interrupt_in_urb);
 } /* belkin_sa_close */
 
 
@@ -607,6 +608,7 @@ module_exit (belkin_sa_exit);
 
 MODULE_AUTHOR( DRIVER_AUTHOR );
 MODULE_DESCRIPTION( DRIVER_DESC );
+MODULE_VERSION( DRIVER_VERSION );
 MODULE_LICENSE("GPL");
 
 module_param(debug, bool, S_IRUGO | S_IWUSR);