Pull misc-for-upstream into release branch
[pandora-kernel.git] / drivers / usb / core / message.c
index 7729c07..8aca357 100644 (file)
@@ -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",
@@ -1398,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;
 
@@ -1421,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);
@@ -1490,7 +1490,7 @@ free_interfaces:
                usb_create_sysfs_intf_files (intf);
        }
 
-       usb_autosuspend_device(dev, 1);
+       usb_autosuspend_device(dev);
        return 0;
 }
 
@@ -1501,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);
@@ -1541,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);