summaryrefslogtreecommitdiff
path: root/drivers/usb/core/message.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/core/message.c')
-rw-r--r--drivers/usb/core/message.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index fccd1952bad3..149aa8bfb1fe 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -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,7 +1542,7 @@ 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)) {