aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/core/driver.c')
-rw-r--r--drivers/usb/core/driver.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index a6bd53ace03..d7a4401ef01 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1742,9 +1742,8 @@ static int usb_runtime_suspend(struct device *dev)
1742 } 1742 }
1743 1743
1744 /* Prevent the parent from suspending immediately after */ 1744 /* Prevent the parent from suspending immediately after */
1745 else if (udev->parent) { 1745 else if (udev->parent)
1746 udev->parent->last_busy = jiffies; 1746 udev->parent->last_busy = jiffies;
1747 }
1748 } 1747 }
1749 1748
1750 /* Runtime suspend for a USB interface doesn't mean anything. */ 1749 /* Runtime suspend for a USB interface doesn't mean anything. */
@@ -1786,21 +1785,19 @@ static int usb_runtime_idle(struct device *dev)
1786 return 0; 1785 return 0;
1787} 1786}
1788 1787
1789static struct dev_pm_ops usb_bus_pm_ops = { 1788static const struct dev_pm_ops usb_bus_pm_ops = {
1790 .runtime_suspend = usb_runtime_suspend, 1789 .runtime_suspend = usb_runtime_suspend,
1791 .runtime_resume = usb_runtime_resume, 1790 .runtime_resume = usb_runtime_resume,
1792 .runtime_idle = usb_runtime_idle, 1791 .runtime_idle = usb_runtime_idle,
1793}; 1792};
1794 1793
1795#else
1796
1797#define usb_bus_pm_ops (*(struct dev_pm_ops *) NULL)
1798
1799#endif /* CONFIG_USB_SUSPEND */ 1794#endif /* CONFIG_USB_SUSPEND */
1800 1795
1801struct bus_type usb_bus_type = { 1796struct bus_type usb_bus_type = {
1802 .name = "usb", 1797 .name = "usb",
1803 .match = usb_device_match, 1798 .match = usb_device_match,
1804 .uevent = usb_uevent, 1799 .uevent = usb_uevent,
1800#ifdef CONFIG_USB_SUSPEND
1805 .pm = &usb_bus_pm_ops, 1801 .pm = &usb_bus_pm_ops,
1802#endif
1806}; 1803};