diff options
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r-- | drivers/usb/core/hub.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 879b66e13370..21b99b4b4082 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1526,18 +1526,6 @@ static int hub_configure(struct usb_hub *hub, | |||
1526 | dev_dbg(hub_dev, "%umA bus power budget for each child\n", | 1526 | dev_dbg(hub_dev, "%umA bus power budget for each child\n", |
1527 | hub->mA_per_port); | 1527 | hub->mA_per_port); |
1528 | 1528 | ||
1529 | /* Update the HCD's internal representation of this hub before khubd | ||
1530 | * starts getting port status changes for devices under the hub. | ||
1531 | */ | ||
1532 | if (hcd->driver->update_hub_device) { | ||
1533 | ret = hcd->driver->update_hub_device(hcd, hdev, | ||
1534 | &hub->tt, GFP_KERNEL); | ||
1535 | if (ret < 0) { | ||
1536 | message = "can't update HCD hub info"; | ||
1537 | goto fail; | ||
1538 | } | ||
1539 | } | ||
1540 | |||
1541 | ret = hub_hub_status(hub, &hubstatus, &hubchange); | 1529 | ret = hub_hub_status(hub, &hubstatus, &hubchange); |
1542 | if (ret < 0) { | 1530 | if (ret < 0) { |
1543 | message = "can't get hub status"; | 1531 | message = "can't get hub status"; |
@@ -1589,10 +1577,28 @@ static int hub_configure(struct usb_hub *hub, | |||
1589 | } | 1577 | } |
1590 | } | 1578 | } |
1591 | hdev->maxchild = i; | 1579 | hdev->maxchild = i; |
1580 | for (i = 0; i < hdev->maxchild; i++) { | ||
1581 | struct usb_port *port_dev = hub->ports[i]; | ||
1582 | |||
1583 | pm_runtime_put(&port_dev->dev); | ||
1584 | } | ||
1585 | |||
1592 | mutex_unlock(&usb_port_peer_mutex); | 1586 | mutex_unlock(&usb_port_peer_mutex); |
1593 | if (ret < 0) | 1587 | if (ret < 0) |
1594 | goto fail; | 1588 | goto fail; |
1595 | 1589 | ||
1590 | /* Update the HCD's internal representation of this hub before khubd | ||
1591 | * starts getting port status changes for devices under the hub. | ||
1592 | */ | ||
1593 | if (hcd->driver->update_hub_device) { | ||
1594 | ret = hcd->driver->update_hub_device(hcd, hdev, | ||
1595 | &hub->tt, GFP_KERNEL); | ||
1596 | if (ret < 0) { | ||
1597 | message = "can't update HCD hub info"; | ||
1598 | goto fail; | ||
1599 | } | ||
1600 | } | ||
1601 | |||
1596 | usb_hub_adjust_deviceremovable(hdev, hub->descriptor); | 1602 | usb_hub_adjust_deviceremovable(hdev, hub->descriptor); |
1597 | 1603 | ||
1598 | hub_activate(hub, HUB_INIT); | 1604 | hub_activate(hub, HUB_INIT); |
@@ -3458,7 +3464,8 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg) | |||
3458 | struct usb_device *udev = port_dev->child; | 3464 | struct usb_device *udev = port_dev->child; |
3459 | 3465 | ||
3460 | if (udev && udev->can_submit) { | 3466 | if (udev && udev->can_submit) { |
3461 | dev_warn(&port_dev->dev, "not suspended yet\n"); | 3467 | dev_warn(&port_dev->dev, "device %s not suspended yet\n", |
3468 | dev_name(&udev->dev)); | ||
3462 | if (PMSG_IS_AUTO(msg)) | 3469 | if (PMSG_IS_AUTO(msg)) |
3463 | return -EBUSY; | 3470 | return -EBUSY; |
3464 | } | 3471 | } |