Pull misc-for-upstream into release branch
[pandora-kernel.git] / drivers / usb / core / message.c
index 85b1cd1..8aca357 100644 (file)
@@ -17,7 +17,7 @@
 #include "hcd.h"       /* for usbcore internals */
 #include "usb.h"
 
-static void usb_api_blocking_completion(struct urb *urb, struct pt_regs *regs)
+static void usb_api_blocking_completion(struct urb *urb)
 {
        complete((struct completion *)urb->context);
 }
@@ -246,7 +246,7 @@ static void sg_clean (struct usb_sg_request *io)
        io->dev = NULL;
 }
 
-static void sg_complete (struct urb *urb, struct pt_regs *regs)
+static void sg_complete (struct urb *urb)
 {
        struct usb_sg_request   *io = urb->context;
 
@@ -488,7 +488,7 @@ void usb_sg_wait (struct usb_sg_request *io)
                int     retval;
 
                io->urbs [i]->dev = io->dev;
-               retval = usb_submit_urb (io->urbs [i], SLAB_ATOMIC);
+               retval = usb_submit_urb (io->urbs [i], GFP_ATOMIC);
 
                /* after we submit, let completions or cancelations fire;
                 * we handshake using io->status.
@@ -764,7 +764,7 @@ int usb_string(struct usb_device *dev, int index, char *buf, size_t size)
                        err = -EINVAL;
                        goto errout;
                } else {
-                       dev->have_langid = -1;
+                       dev->have_langid = 1;
                        dev->string_langid = tbuf[2] | (tbuf[3]<< 8);
                                /* always use the first langid listed */
                        dev_dbg (&dev->dev, "default language 0x%04x\n",
@@ -828,10 +828,7 @@ char *usb_cache_string(struct usb_device *udev, int index)
  * Context: !in_interrupt ()
  *
  * Updates the copy of the device descriptor stored in the device structure,
- * which dedicates space for this purpose.  Note that several fields are
- * converted to the host CPU's byte order:  the USB version (bcdUSB), and
- * vendors product and version fields (idVendor, idProduct, and bcdDevice).
- * That lets device drivers compare against non-byteswapped constants.
+ * which dedicates space for this purpose.
  *
  * Not exported, only for use by the core.  If drivers really want to read
  * the device descriptor directly, they can call usb_get_descriptor() with
@@ -1401,7 +1398,7 @@ free_interfaces:
        }
 
        /* Wake up the device so we can send it the Set-Config request */
-       ret = usb_autoresume_device(dev, 1);
+       ret = usb_autoresume_device(dev);
        if (ret)
                goto free_interfaces;
 
@@ -1424,7 +1421,7 @@ free_interfaces:
        dev->actconfig = cp;
        if (!cp) {
                usb_set_device_state(dev, USB_STATE_ADDRESS);
-               usb_autosuspend_device(dev, 1);
+               usb_autosuspend_device(dev);
                goto free_interfaces;
        }
        usb_set_device_state(dev, USB_STATE_CONFIGURED);
@@ -1493,7 +1490,7 @@ free_interfaces:
                usb_create_sysfs_intf_files (intf);
        }
 
-       usb_autosuspend_device(dev, 1);
+       usb_autosuspend_device(dev);
        return 0;
 }
 
@@ -1504,9 +1501,10 @@ struct set_config_request {
 };
 
 /* Worker routine for usb_driver_set_configuration() */
-static void driver_set_config_work(void *_req)
+static void driver_set_config_work(struct work_struct *work)
 {
-       struct set_config_request *req = _req;
+       struct set_config_request *req =
+               container_of(work, struct set_config_request, work);
 
        usb_lock_device(req->udev);
        usb_set_configuration(req->udev, req->config);
@@ -1544,14 +1542,10 @@ int usb_driver_set_configuration(struct usb_device *udev, int config)
                return -ENOMEM;
        req->udev = udev;
        req->config = config;
-       INIT_WORK(&req->work, driver_set_config_work, req);
+       INIT_WORK(&req->work, driver_set_config_work);
 
        usb_get_dev(udev);
-       if (!schedule_work(&req->work)) {
-               usb_put_dev(udev);
-               kfree(req);
-               return -EINVAL;
-       }
+       schedule_work(&req->work);
        return 0;
 }
 EXPORT_SYMBOL_GPL(usb_driver_set_configuration);