vserver 1.9.5.x5
[linux-2.6.git] / drivers / usb / misc / auerswald.c
index c4bebda..d656592 100644 (file)
@@ -516,7 +516,7 @@ static void auerchain_unlink_all (pauerchain_t acp)
                 urbp = acep->urbp;
                 urbp->transfer_flags &= ~URB_ASYNC_UNLINK;
                 dbg ("unlink active urb");
-                usb_unlink_urb (urbp);
+                usb_kill_urb (urbp);
         }
 }
 
@@ -1123,16 +1123,16 @@ static void auerswald_int_free (pauerswald_t cp)
 static int auerswald_int_open (pauerswald_t cp)
 {
         int ret;
-       struct usb_endpoint_descriptor *ep;
+       struct usb_host_endpoint *ep;
        int irqsize;
        dbg ("auerswald_int_open");
 
-       ep = usb_epnum_to_ep_desc (cp->usbdev, USB_DIR_IN | AU_IRQENDP);
+       ep = cp->usbdev->ep_in[AU_IRQENDP];
        if (!ep) {
                ret = -EFAULT;
                goto intoend;
        }
-       irqsize = ep->wMaxPacketSize;
+       irqsize = le16_to_cpu(ep->desc.wMaxPacketSize);
        cp->irqsize = irqsize;
 
        /* allocate the urb and data buffer */
@@ -1151,7 +1151,9 @@ static int auerswald_int_open (pauerswald_t cp)
                 }
         }
         /* setup urb */
-        usb_fill_int_urb (cp->inturbp, cp->usbdev, usb_rcvintpipe (cp->usbdev,AU_IRQENDP), cp->intbufp, irqsize, auerswald_int_complete, cp, ep->bInterval);
+        usb_fill_int_urb (cp->inturbp, cp->usbdev,
+                       usb_rcvintpipe (cp->usbdev,AU_IRQENDP), cp->intbufp,
+                       irqsize, auerswald_int_complete, cp, ep->desc.bInterval);
         /* start the urb */
        cp->inturbp->status = 0;        /* needed! */
        ret = usb_submit_urb (cp->inturbp, GFP_KERNEL);
@@ -1171,22 +1173,16 @@ intoend:
    endpoint. This function returns 0 if successful or an error code.
    NOTE: no mutex please!
 */
-static int auerswald_int_release (pauerswald_t cp)
+static void auerswald_int_release (pauerswald_t cp)
 {
-        int ret = 0;
         dbg ("auerswald_int_release");
 
         /* stop the int endpoint */
-        if (cp->inturbp) {
-                ret = usb_unlink_urb (cp->inturbp);
-                if (ret)
-                       dbg ("nonzero int unlink result received: %d", ret);
-        }
+        if (cp->inturbp)
+                usb_kill_urb (cp->inturbp);
 
         /* deallocate memory */
         auerswald_int_free (cp);
-
-        return ret;
 }
 
 /* --------------------------------------------------------------------- */
@@ -1935,11 +1931,8 @@ static int auerswald_probe (struct usb_interface *intf,
        int ret;
 
        dbg ("probe: vendor id 0x%x, device id 0x%x",
-            usbdev->descriptor.idVendor, usbdev->descriptor.idProduct);
-
-       /* See if the device offered us matches that we can accept */
-       if (usbdev->descriptor.idVendor != ID_AUERSWALD)
-               return -ENODEV;
+            le16_to_cpu(usbdev->descriptor.idVendor),
+            le16_to_cpu(usbdev->descriptor.idProduct));
 
         /* we use only the first -and only- interface */
         if (intf->altsetting->desc.bInterfaceNumber != 0)
@@ -1973,7 +1966,7 @@ static int auerswald_probe (struct usb_interface *intf,
        cp->dtindex = intf->minor;
 
        /* Get the usb version of the device */
-       cp->version = cp->usbdev->descriptor.bcdDevice;
+       cp->version = le16_to_cpu(cp->usbdev->descriptor.bcdDevice);
        dbg ("Version is %X", cp->version);
 
        /* allow some time to settle the device */