aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/core')
-rw-r--r--drivers/usb/core/hcd.c4
-rw-r--r--drivers/usb/core/hub.c18
-rw-r--r--drivers/usb/core/usb.c2
3 files changed, 12 insertions, 12 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 79422a3b07bc..12ecdb03ee5f 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -782,7 +782,7 @@ static int usb_register_bus(struct usb_bus *bus)
782 return -E2BIG; 782 return -E2BIG;
783 } 783 }
784 784
785 bus->class_dev = class_device_create(usb_host_class, MKDEV(0,0), bus->controller, "usb%d", busnum); 785 bus->class_dev = class_device_create(usb_host_class, MKDEV(0,0), bus->controller, "usb_host%d", busnum);
786 if (IS_ERR(bus->class_dev)) { 786 if (IS_ERR(bus->class_dev)) {
787 clear_bit(busnum, busmap.busmap); 787 clear_bit(busnum, busmap.busmap);
788 up(&usb_bus_list_lock); 788 up(&usb_bus_list_lock);
@@ -1669,7 +1669,7 @@ struct usb_hcd *usb_create_hcd (const struct hc_driver *driver,
1669{ 1669{
1670 struct usb_hcd *hcd; 1670 struct usb_hcd *hcd;
1671 1671
1672 hcd = kcalloc(1, sizeof(*hcd) + driver->hcd_priv_size, GFP_KERNEL); 1672 hcd = kzalloc(sizeof(*hcd) + driver->hcd_priv_size, GFP_KERNEL);
1673 if (!hcd) { 1673 if (!hcd) {
1674 dev_dbg (dev, "hcd alloc failed\n"); 1674 dev_dbg (dev, "hcd alloc failed\n");
1675 return NULL; 1675 return NULL;
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index c3e46d24a37e..c9412daff682 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1570,7 +1570,7 @@ static int __usb_suspend_device (struct usb_device *udev, int port1,
1570 struct usb_driver *driver; 1570 struct usb_driver *driver;
1571 1571
1572 intf = udev->actconfig->interface[i]; 1572 intf = udev->actconfig->interface[i];
1573 if (state <= intf->dev.power.power_state) 1573 if (state.event <= intf->dev.power.power_state.event)
1574 continue; 1574 continue;
1575 if (!intf->dev.driver) 1575 if (!intf->dev.driver)
1576 continue; 1576 continue;
@@ -1578,11 +1578,11 @@ static int __usb_suspend_device (struct usb_device *udev, int port1,
1578 1578
1579 if (driver->suspend) { 1579 if (driver->suspend) {
1580 status = driver->suspend(intf, state); 1580 status = driver->suspend(intf, state);
1581 if (intf->dev.power.power_state != state 1581 if (intf->dev.power.power_state.event != state.event
1582 || status) 1582 || status)
1583 dev_err(&intf->dev, 1583 dev_err(&intf->dev,
1584 "suspend %d fail, code %d\n", 1584 "suspend %d fail, code %d\n",
1585 state, status); 1585 state.event, status);
1586 } 1586 }
1587 1587
1588 /* only drivers with suspend() can ever resume(); 1588 /* only drivers with suspend() can ever resume();
@@ -1595,7 +1595,7 @@ static int __usb_suspend_device (struct usb_device *udev, int port1,
1595 * since we know every driver's probe/disconnect works 1595 * since we know every driver's probe/disconnect works
1596 * even for drivers that can't suspend. 1596 * even for drivers that can't suspend.
1597 */ 1597 */
1598 if (!driver->suspend || state > PM_SUSPEND_MEM) { 1598 if (!driver->suspend || state.event > PM_EVENT_FREEZE) {
1599#if 1 1599#if 1
1600 dev_warn(&intf->dev, "resume is unsafe!\n"); 1600 dev_warn(&intf->dev, "resume is unsafe!\n");
1601#else 1601#else
@@ -1616,7 +1616,7 @@ static int __usb_suspend_device (struct usb_device *udev, int port1,
1616 * policies (when HNP doesn't apply) once we have mechanisms to 1616 * policies (when HNP doesn't apply) once we have mechanisms to
1617 * turn power back on! (Likely not before 2.7...) 1617 * turn power back on! (Likely not before 2.7...)
1618 */ 1618 */
1619 if (state > PM_SUSPEND_MEM) { 1619 if (state.event > PM_EVENT_FREEZE) {
1620 dev_warn(&udev->dev, "no poweroff yet, suspending instead\n"); 1620 dev_warn(&udev->dev, "no poweroff yet, suspending instead\n");
1621 } 1621 }
1622 1622
@@ -1733,7 +1733,7 @@ static int finish_port_resume(struct usb_device *udev)
1733 struct usb_driver *driver; 1733 struct usb_driver *driver;
1734 1734
1735 intf = udev->actconfig->interface[i]; 1735 intf = udev->actconfig->interface[i];
1736 if (intf->dev.power.power_state == PMSG_ON) 1736 if (intf->dev.power.power_state.event == PM_EVENT_ON)
1737 continue; 1737 continue;
1738 if (!intf->dev.driver) { 1738 if (!intf->dev.driver) {
1739 /* FIXME maybe force to alt 0 */ 1739 /* FIXME maybe force to alt 0 */
@@ -1747,11 +1747,11 @@ static int finish_port_resume(struct usb_device *udev)
1747 1747
1748 /* can we do better than just logging errors? */ 1748 /* can we do better than just logging errors? */
1749 status = driver->resume(intf); 1749 status = driver->resume(intf);
1750 if (intf->dev.power.power_state != PMSG_ON 1750 if (intf->dev.power.power_state.event != PM_EVENT_ON
1751 || status) 1751 || status)
1752 dev_dbg(&intf->dev, 1752 dev_dbg(&intf->dev,
1753 "resume fail, state %d code %d\n", 1753 "resume fail, state %d code %d\n",
1754 intf->dev.power.power_state, status); 1754 intf->dev.power.power_state.event, status);
1755 } 1755 }
1756 status = 0; 1756 status = 0;
1757 1757
@@ -1934,7 +1934,7 @@ static int hub_resume(struct usb_interface *intf)
1934 unsigned port1; 1934 unsigned port1;
1935 int status; 1935 int status;
1936 1936
1937 if (intf->dev.power.power_state == PM_SUSPEND_ON) 1937 if (intf->dev.power.power_state.event == PM_EVENT_ON)
1938 return 0; 1938 return 0;
1939 1939
1940 for (port1 = 1; port1 <= hdev->maxchild; port1++) { 1940 for (port1 = 1; port1 <= hdev->maxchild; port1++) {
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 99c85d2f92da..2cddd8a00437 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -1400,7 +1400,7 @@ static int usb_generic_suspend(struct device *dev, pm_message_t message)
1400 driver = to_usb_driver(dev->driver); 1400 driver = to_usb_driver(dev->driver);
1401 1401
1402 /* there's only one USB suspend state */ 1402 /* there's only one USB suspend state */
1403 if (intf->dev.power.power_state) 1403 if (intf->dev.power.power_state.event)
1404 return 0; 1404 return 0;
1405 1405
1406 if (driver->suspend) 1406 if (driver->suspend)