linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / usb / misc / legousbtower.c
index 06c4bfa..1336745 100644 (file)
@@ -271,19 +271,17 @@ static struct file_operations tower_fops = {
 
 /*
  * usb class driver info in order to get a minor number from the usb core,
- * and to have the device registered with devfs and the driver core
+ * and to have the device registered with the driver core
  */
 static struct usb_class_driver tower_class = {
-       .name =         "usb/legousbtower%d",
+       .name =         "legousbtower%d",
        .fops =         &tower_fops,
-       .mode =         S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH,
        .minor_base =   LEGO_USB_TOWER_MINOR_BASE,
 };
 
 
 /* usb specific object needed to register this driver with the usb subsystem */
 static struct usb_driver tower_driver = {
-       .owner =        THIS_MODULE,
        .name =         "legousbtower",
        .probe =        tower_probe,
        .disconnect =   tower_disconnect,
@@ -391,7 +389,7 @@ static int tower_open (struct inode *inode, struct file *file)
                                  0,
                                  &reset_reply,
                                  sizeof(reset_reply),
-                                 HZ);
+                                 1000);
        if (result < 0) {
                err("LEGO USB Tower reset control request failed");
                retval = result;
@@ -405,7 +403,7 @@ static int tower_open (struct inode *inode, struct file *file)
                          dev->udev,
                          usb_rcvintpipe(dev->udev, dev->interrupt_in_endpoint->bEndpointAddress),
                          dev->interrupt_in_buffer,
-                         dev->interrupt_in_endpoint->wMaxPacketSize,
+                         le16_to_cpu(dev->interrupt_in_endpoint->wMaxPacketSize),
                          tower_interrupt_in_callback,
                          dev,
                          dev->interrupt_in_interval);
@@ -505,12 +503,12 @@ static void tower_abort_transfers (struct lego_usb_tower *dev)
                dev->interrupt_in_running = 0;
                mb();
                if (dev->interrupt_in_urb != NULL && dev->udev) {
-                       usb_unlink_urb (dev->interrupt_in_urb);
+                       usb_kill_urb (dev->interrupt_in_urb);
                }
        }
        if (dev->interrupt_out_busy) {
                if (dev->interrupt_out_urb != NULL && dev->udev) {
-                       usb_unlink_urb (dev->interrupt_out_urb);
+                       usb_kill_urb (dev->interrupt_out_urb);
                }
        }
 
@@ -859,14 +857,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
                info ("udev is NULL.");
        }
 
-       /* See if the device offered us matches what we can accept */
-       if ((udev->descriptor.idVendor != LEGO_USB_TOWER_VENDOR_ID) ||
-           (udev->descriptor.idProduct != LEGO_USB_TOWER_PRODUCT_ID)) {
-               return -ENODEV;
-       }
-
-
-       /* allocate memory for our device state and intialize it */
+       /* allocate memory for our device state and initialize it */
 
        dev = kmalloc (sizeof(struct lego_usb_tower), GFP_KERNEL);
 
@@ -931,7 +922,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
                err("Couldn't allocate read_buffer");
                goto error;
        }
-       dev->interrupt_in_buffer = kmalloc (dev->interrupt_in_endpoint->wMaxPacketSize, GFP_KERNEL);
+       dev->interrupt_in_buffer = kmalloc (le16_to_cpu(dev->interrupt_in_endpoint->wMaxPacketSize), GFP_KERNEL);
        if (!dev->interrupt_in_buffer) {
                err("Couldn't allocate interrupt_in_buffer");
                goto error;
@@ -979,7 +970,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
                                  0,
                                  &get_version_reply,
                                  sizeof(get_version_reply),
-                                 HZ);
+                                 1000);
        if (result < 0) {
                err("LEGO USB Tower get version control request failed");
                retval = result;