aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/message.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-16 18:04:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-16 18:04:26 -0400
commit971f115a50afbe409825c9f3399d5a3b9aca4381 (patch)
treecb42dc07a032e325f22b64d961587c081225c6d6 /drivers/usb/core/message.c
parent2e270d84223262a38d4755c61d55f5c73ea89e56 (diff)
parent500132a0f26ad7d9916102193cbc6c1b1becb373 (diff)
Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (172 commits) USB: Add support for SuperSpeed isoc endpoints xhci: Clean up cycle bit math used during stalls. xhci: Fix cycle bit calculation during stall handling. xhci: Update internal dequeue pointers after stalls. USB: Disable auto-suspend for USB 3.0 hubs. USB: Remove bogus USB_PORT_STAT_SUPER_SPEED symbol. xhci: Return canceled URBs immediately when host is halted. xhci: Fixes for suspend/resume of shared HCDs. xhci: Fix re-init on power loss after resume. xhci: Make roothub functions deal with device removal. xhci: Limit roothub ports to 15 USB3 & 31 USB2 ports. xhci: Return a USB 3.0 hub descriptor for USB3 roothub. xhci: Register second xHCI roothub. xhci: Change xhci_find_slot_id_by_port() API. xhci: Refactor bus suspend state into a struct. xhci: Index with a port array instead of PORTSC addresses. USB: Set usb_hcd->state and flags for shared roothubs. usb: Make core allocate resources per PCI-device. usb: Store bus type in usb_hcd, not in driver flags. usb: Change usb_hcd->bandwidth_mutex to a pointer. ...
Diffstat (limited to 'drivers/usb/core/message.c')
-rw-r--r--drivers/usb/core/message.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 832487423826..5701e857392b 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -1284,12 +1284,12 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
1284 /* Make sure we have enough bandwidth for this alternate interface. 1284 /* Make sure we have enough bandwidth for this alternate interface.
1285 * Remove the current alt setting and add the new alt setting. 1285 * Remove the current alt setting and add the new alt setting.
1286 */ 1286 */
1287 mutex_lock(&hcd->bandwidth_mutex); 1287 mutex_lock(hcd->bandwidth_mutex);
1288 ret = usb_hcd_alloc_bandwidth(dev, NULL, iface->cur_altsetting, alt); 1288 ret = usb_hcd_alloc_bandwidth(dev, NULL, iface->cur_altsetting, alt);
1289 if (ret < 0) { 1289 if (ret < 0) {
1290 dev_info(&dev->dev, "Not enough bandwidth for altsetting %d\n", 1290 dev_info(&dev->dev, "Not enough bandwidth for altsetting %d\n",
1291 alternate); 1291 alternate);
1292 mutex_unlock(&hcd->bandwidth_mutex); 1292 mutex_unlock(hcd->bandwidth_mutex);
1293 return ret; 1293 return ret;
1294 } 1294 }
1295 1295
@@ -1311,10 +1311,10 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
1311 } else if (ret < 0) { 1311 } else if (ret < 0) {
1312 /* Re-instate the old alt setting */ 1312 /* Re-instate the old alt setting */
1313 usb_hcd_alloc_bandwidth(dev, NULL, alt, iface->cur_altsetting); 1313 usb_hcd_alloc_bandwidth(dev, NULL, alt, iface->cur_altsetting);
1314 mutex_unlock(&hcd->bandwidth_mutex); 1314 mutex_unlock(hcd->bandwidth_mutex);
1315 return ret; 1315 return ret;
1316 } 1316 }
1317 mutex_unlock(&hcd->bandwidth_mutex); 1317 mutex_unlock(hcd->bandwidth_mutex);
1318 1318
1319 /* FIXME drivers shouldn't need to replicate/bugfix the logic here 1319 /* FIXME drivers shouldn't need to replicate/bugfix the logic here
1320 * when they implement async or easily-killable versions of this or 1320 * when they implement async or easily-killable versions of this or
@@ -1413,7 +1413,7 @@ int usb_reset_configuration(struct usb_device *dev)
1413 1413
1414 config = dev->actconfig; 1414 config = dev->actconfig;
1415 retval = 0; 1415 retval = 0;
1416 mutex_lock(&hcd->bandwidth_mutex); 1416 mutex_lock(hcd->bandwidth_mutex);
1417 /* Make sure we have enough bandwidth for each alternate setting 0 */ 1417 /* Make sure we have enough bandwidth for each alternate setting 0 */
1418 for (i = 0; i < config->desc.bNumInterfaces; i++) { 1418 for (i = 0; i < config->desc.bNumInterfaces; i++) {
1419 struct usb_interface *intf = config->interface[i]; 1419 struct usb_interface *intf = config->interface[i];
@@ -1442,7 +1442,7 @@ reset_old_alts:
1442 usb_hcd_alloc_bandwidth(dev, NULL, 1442 usb_hcd_alloc_bandwidth(dev, NULL,
1443 alt, intf->cur_altsetting); 1443 alt, intf->cur_altsetting);
1444 } 1444 }
1445 mutex_unlock(&hcd->bandwidth_mutex); 1445 mutex_unlock(hcd->bandwidth_mutex);
1446 return retval; 1446 return retval;
1447 } 1447 }
1448 retval = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 1448 retval = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
@@ -1451,7 +1451,7 @@ reset_old_alts:
1451 NULL, 0, USB_CTRL_SET_TIMEOUT); 1451 NULL, 0, USB_CTRL_SET_TIMEOUT);
1452 if (retval < 0) 1452 if (retval < 0)
1453 goto reset_old_alts; 1453 goto reset_old_alts;
1454 mutex_unlock(&hcd->bandwidth_mutex); 1454 mutex_unlock(hcd->bandwidth_mutex);
1455 1455
1456 /* re-init hc/hcd interface/endpoint state */ 1456 /* re-init hc/hcd interface/endpoint state */
1457 for (i = 0; i < config->desc.bNumInterfaces; i++) { 1457 for (i = 0; i < config->desc.bNumInterfaces; i++) {
@@ -1739,10 +1739,10 @@ free_interfaces:
1739 * host controller will not allow submissions to dropped endpoints. If 1739 * host controller will not allow submissions to dropped endpoints. If
1740 * this call fails, the device state is unchanged. 1740 * this call fails, the device state is unchanged.
1741 */ 1741 */
1742 mutex_lock(&hcd->bandwidth_mutex); 1742 mutex_lock(hcd->bandwidth_mutex);
1743 ret = usb_hcd_alloc_bandwidth(dev, cp, NULL, NULL); 1743 ret = usb_hcd_alloc_bandwidth(dev, cp, NULL, NULL);
1744 if (ret < 0) { 1744 if (ret < 0) {
1745 mutex_unlock(&hcd->bandwidth_mutex); 1745 mutex_unlock(hcd->bandwidth_mutex);
1746 usb_autosuspend_device(dev); 1746 usb_autosuspend_device(dev);
1747 goto free_interfaces; 1747 goto free_interfaces;
1748 } 1748 }
@@ -1761,11 +1761,11 @@ free_interfaces:
1761 if (!cp) { 1761 if (!cp) {
1762 usb_set_device_state(dev, USB_STATE_ADDRESS); 1762 usb_set_device_state(dev, USB_STATE_ADDRESS);
1763 usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL); 1763 usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL);
1764 mutex_unlock(&hcd->bandwidth_mutex); 1764 mutex_unlock(hcd->bandwidth_mutex);
1765 usb_autosuspend_device(dev); 1765 usb_autosuspend_device(dev);
1766 goto free_interfaces; 1766 goto free_interfaces;
1767 } 1767 }
1768 mutex_unlock(&hcd->bandwidth_mutex); 1768 mutex_unlock(hcd->bandwidth_mutex);
1769 usb_set_device_state(dev, USB_STATE_CONFIGURED); 1769 usb_set_device_state(dev, USB_STATE_CONFIGURED);
1770 1770
1771 /* Initialize the new interface structures and the 1771 /* Initialize the new interface structures and the