aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2010-11-15 15:57:51 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-11-16 17:03:41 -0500
commitfcc4a01eb8661226e80632327673f67bf6a5840b (patch)
treedc05c200ccfac2daad6d1efe413ae6fa92f1638d
parent6ddf27cdbc218a412d7e993fdc08e30eec2042ce (diff)
USB: use the runtime-PM autosuspend implementation
This patch (as1428) converts USB over to the new runtime-PM core autosuspend framework. One slightly awkward aspect of the conversion is that USB devices will now have two suspend-delay attributes: the old power/autosuspend file and the new power/autosuspend_delay_ms file. One expresses the delay time in seconds and the other in milliseconds, but otherwise they do the same thing. The old attribute can be deprecated and then removed eventually. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--Documentation/usb/power-management.txt113
-rw-r--r--drivers/usb/core/driver.c77
-rw-r--r--drivers/usb/core/hub.c1
-rw-r--r--drivers/usb/core/quirks.c6
-rw-r--r--drivers/usb/core/sysfs.c34
-rw-r--r--drivers/usb/core/usb.c3
-rw-r--r--drivers/usb/core/usb.h2
-rw-r--r--include/linux/usb.h2
8 files changed, 71 insertions, 167 deletions
diff --git a/Documentation/usb/power-management.txt b/Documentation/usb/power-management.txt
index b29d8e56cf28..c9ffa9ced7ee 100644
--- a/Documentation/usb/power-management.txt
+++ b/Documentation/usb/power-management.txt
@@ -2,7 +2,7 @@
2 2
3 Alan Stern <stern@rowland.harvard.edu> 3 Alan Stern <stern@rowland.harvard.edu>
4 4
5 December 11, 2009 5 October 28, 2010
6 6
7 7
8 8
@@ -107,9 +107,14 @@ allowed to issue dynamic suspends.
107The user interface for controlling dynamic PM is located in the power/ 107The user interface for controlling dynamic PM is located in the power/
108subdirectory of each USB device's sysfs directory, that is, in 108subdirectory of each USB device's sysfs directory, that is, in
109/sys/bus/usb/devices/.../power/ where "..." is the device's ID. The 109/sys/bus/usb/devices/.../power/ where "..." is the device's ID. The
110relevant attribute files are: wakeup, control, and autosuspend. 110relevant attribute files are: wakeup, control, and
111(There may also be a file named "level"; this file was deprecated 111autosuspend_delay_ms. (There may also be a file named "level"; this
112as of the 2.6.35 kernel and replaced by the "control" file.) 112file was deprecated as of the 2.6.35 kernel and replaced by the
113"control" file. In 2.6.38 the "autosuspend" file will be deprecated
114and replaced by the "autosuspend_delay_ms" file. The only difference
115is that the newer file expresses the delay in milliseconds whereas the
116older file uses seconds. Confusingly, both files are present in 2.6.37
117but only "autosuspend" works.)
113 118
114 power/wakeup 119 power/wakeup
115 120
@@ -140,33 +145,36 @@ as of the 2.6.35 kernel and replaced by the "control" file.)
140 suspended and autoresume was not allowed. This 145 suspended and autoresume was not allowed. This
141 setting is no longer supported.) 146 setting is no longer supported.)
142 147
143 power/autosuspend 148 power/autosuspend_delay_ms
144 149
145 This file contains an integer value, which is the 150 This file contains an integer value, which is the
146 number of seconds the device should remain idle before 151 number of milliseconds the device should remain idle
147 the kernel will autosuspend it (the idle-delay time). 152 before the kernel will autosuspend it (the idle-delay
148 The default is 2. 0 means to autosuspend as soon as 153 time). The default is 2000. 0 means to autosuspend
149 the device becomes idle, and negative values mean 154 as soon as the device becomes idle, and negative
150 never to autosuspend. You can write a number to the 155 values mean never to autosuspend. You can write a
151 file to change the autosuspend idle-delay time. 156 number to the file to change the autosuspend
152 157 idle-delay time.
153Writing "-1" to power/autosuspend and writing "on" to power/control do 158
154essentially the same thing -- they both prevent the device from being 159Writing "-1" to power/autosuspend_delay_ms and writing "on" to
155autosuspended. Yes, this is a redundancy in the API. 160power/control do essentially the same thing -- they both prevent the
161device from being autosuspended. Yes, this is a redundancy in the
162API.
156 163
157(In 2.6.21 writing "0" to power/autosuspend would prevent the device 164(In 2.6.21 writing "0" to power/autosuspend would prevent the device
158from being autosuspended; the behavior was changed in 2.6.22. The 165from being autosuspended; the behavior was changed in 2.6.22. The
159power/autosuspend attribute did not exist prior to 2.6.21, and the 166power/autosuspend attribute did not exist prior to 2.6.21, and the
160power/level attribute did not exist prior to 2.6.22. power/control 167power/level attribute did not exist prior to 2.6.22. power/control
161was added in 2.6.34.) 168was added in 2.6.34, and power/autosuspend_delay_ms was added in
1692.6.37 but did not become functional until 2.6.38.)
162 170
163 171
164 Changing the default idle-delay time 172 Changing the default idle-delay time
165 ------------------------------------ 173 ------------------------------------
166 174
167The default autosuspend idle-delay time is controlled by a module 175The default autosuspend idle-delay time (in seconds) is controlled by
168parameter in usbcore. You can specify the value when usbcore is 176a module parameter in usbcore. You can specify the value when usbcore
169loaded. For example, to set it to 5 seconds instead of 2 you would 177is loaded. For example, to set it to 5 seconds instead of 2 you would
170do: 178do:
171 179
172 modprobe usbcore autosuspend=5 180 modprobe usbcore autosuspend=5
@@ -234,25 +242,23 @@ every device.
234 242
235If a driver knows that its device has proper suspend/resume support, 243If a driver knows that its device has proper suspend/resume support,
236it can enable autosuspend all by itself. For example, the video 244it can enable autosuspend all by itself. For example, the video
237driver for a laptop's webcam might do this, since these devices are 245driver for a laptop's webcam might do this (in recent kernels they
238rarely used and so should normally be autosuspended. 246do), since these devices are rarely used and so should normally be
247autosuspended.
239 248
240Sometimes it turns out that even when a device does work okay with 249Sometimes it turns out that even when a device does work okay with
241autosuspend there are still problems. For example, there are 250autosuspend there are still problems. For example, the usbhid driver,
242experimental patches adding autosuspend support to the usbhid driver, 251which manages keyboards and mice, has autosuspend support. Tests with
243which manages keyboards and mice, among other things. Tests with a 252a number of keyboards show that typing on a suspended keyboard, while
244number of keyboards showed that typing on a suspended keyboard, while 253causing the keyboard to do a remote wakeup all right, will nonetheless
245causing the keyboard to do a remote wakeup all right, would 254frequently result in lost keystrokes. Tests with mice show that some
246nonetheless frequently result in lost keystrokes. Tests with mice 255of them will issue a remote-wakeup request in response to button
247showed that some of them would issue a remote-wakeup request in 256presses but not to motion, and some in response to neither.
248response to button presses but not to motion, and some in response to
249neither.
250 257
251The kernel will not prevent you from enabling autosuspend on devices 258The kernel will not prevent you from enabling autosuspend on devices
252that can't handle it. It is even possible in theory to damage a 259that can't handle it. It is even possible in theory to damage a
253device by suspending it at the wrong time -- for example, suspending a 260device by suspending it at the wrong time. (Highly unlikely, but
254USB hard disk might cause it to spin down without parking the heads. 261possible.) Take care.
255(Highly unlikely, but possible.) Take care.
256 262
257 263
258 The driver interface for Power Management 264 The driver interface for Power Management
@@ -336,10 +342,6 @@ autosuspend the interface's device. When the usage counter is = 0
336then the interface is considered to be idle, and the kernel may 342then the interface is considered to be idle, and the kernel may
337autosuspend the device. 343autosuspend the device.
338 344
339(There is a similar usage counter field in struct usb_device,
340associated with the device itself rather than any of its interfaces.
341This counter is used only by the USB core.)
342
343Drivers need not be concerned about balancing changes to the usage 345Drivers need not be concerned about balancing changes to the usage
344counter; the USB core will undo any remaining "get"s when a driver 346counter; the USB core will undo any remaining "get"s when a driver
345is unbound from its interface. As a corollary, drivers must not call 347is unbound from its interface. As a corollary, drivers must not call
@@ -409,11 +411,11 @@ during autosuspend. For example, there's not much point
409autosuspending a keyboard if the user can't cause the keyboard to do a 411autosuspending a keyboard if the user can't cause the keyboard to do a
410remote wakeup by typing on it. If the driver sets 412remote wakeup by typing on it. If the driver sets
411intf->needs_remote_wakeup to 1, the kernel won't autosuspend the 413intf->needs_remote_wakeup to 1, the kernel won't autosuspend the
412device if remote wakeup isn't available or has been disabled through 414device if remote wakeup isn't available. (If the device is already
413the power/wakeup attribute. (If the device is already autosuspended, 415autosuspended, though, setting this flag won't cause the kernel to
414though, setting this flag won't cause the kernel to autoresume it. 416autoresume it. Normally a driver would set this flag in its probe
415Normally a driver would set this flag in its probe method, at which 417method, at which time the device is guaranteed not to be
416time the device is guaranteed not to be autosuspended.) 418autosuspended.)
417 419
418If a driver does its I/O asynchronously in interrupt context, it 420If a driver does its I/O asynchronously in interrupt context, it
419should call usb_autopm_get_interface_async() before starting output and 421should call usb_autopm_get_interface_async() before starting output and
@@ -422,20 +424,19 @@ it receives an input event, it should call
422 424
423 usb_mark_last_busy(struct usb_device *udev); 425 usb_mark_last_busy(struct usb_device *udev);
424 426
425in the event handler. This sets udev->last_busy to the current time. 427in the event handler. This tells the PM core that the device was just
426udev->last_busy is the field used for idle-delay calculations; 428busy and therefore the next autosuspend idle-delay expiration should
427updating it will cause any pending autosuspend to be moved back. Most 429be pushed back. Many of the usb_autopm_* routines also make this call,
428of the usb_autopm_* routines will also set the last_busy field to the 430so drivers need to worry only when interrupt-driven input arrives.
429current time.
430 431
431Asynchronous operation is always subject to races. For example, a 432Asynchronous operation is always subject to races. For example, a
432driver may call one of the usb_autopm_*_interface_async() routines at 433driver may call the usb_autopm_get_interface_async() routine at a time
433a time when the core has just finished deciding the device has been 434when the core has just finished deciding the device has been idle for
434idle for long enough but not yet gotten around to calling the driver's 435long enough but not yet gotten around to calling the driver's suspend
435suspend method. The suspend method must be responsible for 436method. The suspend method must be responsible for synchronizing with
436synchronizing with the output request routine and the URB completion 437the I/O request routine and the URB completion handler; it should
437handler; it should cause autosuspends to fail with -EBUSY if the 438cause autosuspends to fail with -EBUSY if the driver needs to use the
438driver needs to use the device. 439device.
439 440
440External suspend calls should never be allowed to fail in this way, 441External suspend calls should never be allowed to fail in this way,
441only autosuspend calls. The driver can tell them apart by checking 442only autosuspend calls. The driver can tell them apart by checking
@@ -472,7 +473,9 @@ Firstly, a device may already be autosuspended when a system suspend
472occurs. Since system suspends are supposed to be as transparent as 473occurs. Since system suspends are supposed to be as transparent as
473possible, the device should remain suspended following the system 474possible, the device should remain suspended following the system
474resume. But this theory may not work out well in practice; over time 475resume. But this theory may not work out well in practice; over time
475the kernel's behavior in this regard has changed. 476the kernel's behavior in this regard has changed. As of 2.6.37 the
477policy is to resume all devices during a system resume and let them
478handle their own runtime suspends afterward.
476 479
477Secondly, a dynamic power-management event may occur as a system 480Secondly, a dynamic power-management event may occur as a system
478suspend is underway. The window for this is short, since system 481suspend is underway. The window for this is short, since system
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 0a63e968c683..43c25c29ac1f 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1397,32 +1397,7 @@ void usb_autosuspend_device(struct usb_device *udev)
1397 int status; 1397 int status;
1398 1398
1399 usb_mark_last_busy(udev); 1399 usb_mark_last_busy(udev);
1400 status = pm_runtime_put_sync(&udev->dev); 1400 status = pm_runtime_put_sync_autosuspend(&udev->dev);
1401 dev_vdbg(&udev->dev, "%s: cnt %d -> %d\n",
1402 __func__, atomic_read(&udev->dev.power.usage_count),
1403 status);
1404}
1405
1406/**
1407 * usb_try_autosuspend_device - attempt an autosuspend of a USB device and its interfaces
1408 * @udev: the usb_device to autosuspend
1409 *
1410 * This routine should be called when a core subsystem thinks @udev may
1411 * be ready to autosuspend.
1412 *
1413 * @udev's usage counter left unchanged. If it is 0 and all the interfaces
1414 * are inactive then an autosuspend will be attempted. The attempt may
1415 * fail or be delayed.
1416 *
1417 * The caller must hold @udev's device lock.
1418 *
1419 * This routine can run only in process context.
1420 */
1421void usb_try_autosuspend_device(struct usb_device *udev)
1422{
1423 int status;
1424
1425 status = pm_runtime_idle(&udev->dev);
1426 dev_vdbg(&udev->dev, "%s: cnt %d -> %d\n", 1401 dev_vdbg(&udev->dev, "%s: cnt %d -> %d\n",
1427 __func__, atomic_read(&udev->dev.power.usage_count), 1402 __func__, atomic_read(&udev->dev.power.usage_count),
1428 status); 1403 status);
@@ -1508,32 +1483,11 @@ EXPORT_SYMBOL_GPL(usb_autopm_put_interface);
1508void usb_autopm_put_interface_async(struct usb_interface *intf) 1483void usb_autopm_put_interface_async(struct usb_interface *intf)
1509{ 1484{
1510 struct usb_device *udev = interface_to_usbdev(intf); 1485 struct usb_device *udev = interface_to_usbdev(intf);
1511 unsigned long last_busy; 1486 int status;
1512 int status = 0;
1513 1487
1514 last_busy = udev->dev.power.last_busy;
1515 usb_mark_last_busy(udev); 1488 usb_mark_last_busy(udev);
1516 atomic_dec(&intf->pm_usage_cnt); 1489 atomic_dec(&intf->pm_usage_cnt);
1517 pm_runtime_put_noidle(&intf->dev); 1490 status = pm_runtime_put(&intf->dev);
1518
1519 if (udev->dev.power.runtime_auto) {
1520 /* Optimization: Don't schedule a delayed autosuspend if
1521 * the timer is already running and the expiration time
1522 * wouldn't change.
1523 *
1524 * We have to use the interface's timer. Attempts to
1525 * schedule a suspend for the device would fail because
1526 * the interface is still active.
1527 */
1528 if (intf->dev.power.timer_expires == 0 ||
1529 round_jiffies_up(last_busy) !=
1530 round_jiffies_up(jiffies)) {
1531 status = pm_schedule_suspend(&intf->dev,
1532 jiffies_to_msecs(
1533 round_jiffies_up_relative(
1534 udev->autosuspend_delay)));
1535 }
1536 }
1537 dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n", 1491 dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n",
1538 __func__, atomic_read(&intf->dev.power.usage_count), 1492 __func__, atomic_read(&intf->dev.power.usage_count),
1539 status); 1493 status);
@@ -1651,7 +1605,6 @@ static int autosuspend_check(struct usb_device *udev)
1651{ 1605{
1652 int w, i; 1606 int w, i;
1653 struct usb_interface *intf; 1607 struct usb_interface *intf;
1654 unsigned long suspend_time, j;
1655 1608
1656 /* Fail if autosuspend is disabled, or any interfaces are in use, or 1609 /* Fail if autosuspend is disabled, or any interfaces are in use, or
1657 * any interface drivers require remote wakeup but it isn't available. 1610 * any interface drivers require remote wakeup but it isn't available.
@@ -1691,17 +1644,6 @@ static int autosuspend_check(struct usb_device *udev)
1691 return -EOPNOTSUPP; 1644 return -EOPNOTSUPP;
1692 } 1645 }
1693 udev->do_remote_wakeup = w; 1646 udev->do_remote_wakeup = w;
1694
1695 /* If everything is okay but the device hasn't been idle for long
1696 * enough, queue a delayed autosuspend request.
1697 */
1698 j = ACCESS_ONCE(jiffies);
1699 suspend_time = udev->dev.power.last_busy + udev->autosuspend_delay;
1700 if (time_before(j, suspend_time)) {
1701 pm_schedule_suspend(&udev->dev, jiffies_to_msecs(
1702 round_jiffies_up_relative(suspend_time - j)));
1703 return -EAGAIN;
1704 }
1705 return 0; 1647 return 0;
1706} 1648}
1707 1649
@@ -1719,17 +1661,8 @@ static int usb_runtime_suspend(struct device *dev)
1719 1661
1720 status = usb_suspend_both(udev, PMSG_AUTO_SUSPEND); 1662 status = usb_suspend_both(udev, PMSG_AUTO_SUSPEND);
1721 1663
1722 /* If an interface fails the suspend, adjust the last_busy
1723 * time so that we don't get another suspend attempt right
1724 * away.
1725 */
1726 if (status) {
1727 udev->dev.power.last_busy = jiffies +
1728 (udev->autosuspend_delay == 0 ? HZ/2 : 0);
1729 }
1730
1731 /* Prevent the parent from suspending immediately after */ 1664 /* Prevent the parent from suspending immediately after */
1732 else if (udev->parent) 1665 if (status == 0 && udev->parent)
1733 usb_mark_last_busy(udev->parent); 1666 usb_mark_last_busy(udev->parent);
1734 1667
1735 return status; 1668 return status;
@@ -1756,7 +1689,7 @@ static int usb_runtime_idle(struct device *dev)
1756 * autosuspend checks. 1689 * autosuspend checks.
1757 */ 1690 */
1758 if (autosuspend_check(udev) == 0) 1691 if (autosuspend_check(udev) == 0)
1759 pm_runtime_suspend(dev); 1692 pm_runtime_autosuspend(dev);
1760 return 0; 1693 return 0;
1761} 1694}
1762 1695
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 7c2405eccc4b..fdb62ca10d86 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1803,6 +1803,7 @@ int usb_new_device(struct usb_device *udev)
1803 1803
1804 /* Tell the runtime-PM framework the device is active */ 1804 /* Tell the runtime-PM framework the device is active */
1805 pm_runtime_set_active(&udev->dev); 1805 pm_runtime_set_active(&udev->dev);
1806 pm_runtime_use_autosuspend(&udev->dev);
1806 pm_runtime_enable(&udev->dev); 1807 pm_runtime_enable(&udev->dev);
1807 1808
1808 err = usb_enumerate_device(udev); /* Read descriptors */ 1809 err = usb_enumerate_device(udev); /* Read descriptors */
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index 25719da45e33..e3531da16137 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -124,12 +124,6 @@ void usb_detect_quirks(struct usb_device *udev)
124 */ 124 */
125 usb_disable_autosuspend(udev); 125 usb_disable_autosuspend(udev);
126 126
127 /* Autosuspend can also be disabled if the initial autosuspend_delay
128 * is negative.
129 */
130 if (udev->autosuspend_delay < 0)
131 usb_autoresume_device(udev);
132
133#endif 127#endif
134 128
135 /* For the present, all devices default to USB-PERSIST enabled */ 129 /* For the present, all devices default to USB-PERSIST enabled */
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
index 9561e087907d..6781c369ce2d 100644
--- a/drivers/usb/core/sysfs.c
+++ b/drivers/usb/core/sysfs.c
@@ -334,44 +334,20 @@ static DEVICE_ATTR(active_duration, S_IRUGO, show_active_duration, NULL);
334static ssize_t 334static ssize_t
335show_autosuspend(struct device *dev, struct device_attribute *attr, char *buf) 335show_autosuspend(struct device *dev, struct device_attribute *attr, char *buf)
336{ 336{
337 struct usb_device *udev = to_usb_device(dev); 337 return sprintf(buf, "%d\n", dev->power.autosuspend_delay / 1000);
338
339 return sprintf(buf, "%d\n", udev->autosuspend_delay / HZ);
340} 338}
341 339
342static ssize_t 340static ssize_t
343set_autosuspend(struct device *dev, struct device_attribute *attr, 341set_autosuspend(struct device *dev, struct device_attribute *attr,
344 const char *buf, size_t count) 342 const char *buf, size_t count)
345{ 343{
346 struct usb_device *udev = to_usb_device(dev); 344 int value;
347 int value, old_delay;
348 int rc;
349 345
350 if (sscanf(buf, "%d", &value) != 1 || value >= INT_MAX/HZ || 346 if (sscanf(buf, "%d", &value) != 1 || value >= INT_MAX/1000 ||
351 value <= - INT_MAX/HZ) 347 value <= -INT_MAX/1000)
352 return -EINVAL; 348 return -EINVAL;
353 value *= HZ;
354
355 usb_lock_device(udev);
356 old_delay = udev->autosuspend_delay;
357 udev->autosuspend_delay = value;
358
359 if (old_delay < 0) { /* Autosuspend wasn't allowed */
360 if (value >= 0)
361 usb_autosuspend_device(udev);
362 } else { /* Autosuspend was allowed */
363 if (value < 0) {
364 rc = usb_autoresume_device(udev);
365 if (rc < 0) {
366 count = rc;
367 udev->autosuspend_delay = old_delay;
368 }
369 } else {
370 usb_try_autosuspend_device(udev);
371 }
372 }
373 349
374 usb_unlock_device(udev); 350 pm_runtime_set_autosuspend_delay(dev, value * 1000);
375 return count; 351 return count;
376} 352}
377 353
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index fdd4130fbb7d..079cb57bab4f 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -445,7 +445,8 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,
445 INIT_LIST_HEAD(&dev->filelist); 445 INIT_LIST_HEAD(&dev->filelist);
446 446
447#ifdef CONFIG_PM 447#ifdef CONFIG_PM
448 dev->autosuspend_delay = usb_autosuspend_delay * HZ; 448 pm_runtime_set_autosuspend_delay(&dev->dev,
449 usb_autosuspend_delay * 1000);
449 dev->connect_time = jiffies; 450 dev->connect_time = jiffies;
450 dev->active_duration = -jiffies; 451 dev->active_duration = -jiffies;
451#endif 452#endif
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
index cd882203ad34..b975450f403e 100644
--- a/drivers/usb/core/usb.h
+++ b/drivers/usb/core/usb.h
@@ -75,14 +75,12 @@ static inline int usb_port_resume(struct usb_device *udev, pm_message_t msg)
75#ifdef CONFIG_USB_SUSPEND 75#ifdef CONFIG_USB_SUSPEND
76 76
77extern void usb_autosuspend_device(struct usb_device *udev); 77extern void usb_autosuspend_device(struct usb_device *udev);
78extern void usb_try_autosuspend_device(struct usb_device *udev);
79extern int usb_autoresume_device(struct usb_device *udev); 78extern int usb_autoresume_device(struct usb_device *udev);
80extern int usb_remote_wakeup(struct usb_device *dev); 79extern int usb_remote_wakeup(struct usb_device *dev);
81 80
82#else 81#else
83 82
84#define usb_autosuspend_device(udev) do {} while (0) 83#define usb_autosuspend_device(udev) do {} while (0)
85#define usb_try_autosuspend_device(udev) do {} while (0)
86static inline int usb_autoresume_device(struct usb_device *udev) 84static inline int usb_autoresume_device(struct usb_device *udev)
87{ 85{
88 return 0; 86 return 0;
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 7d22b3340a7f..5ee2223af08c 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -408,7 +408,6 @@ struct usb_tt;
408 * @quirks: quirks of the whole device 408 * @quirks: quirks of the whole device
409 * @urbnum: number of URBs submitted for the whole device 409 * @urbnum: number of URBs submitted for the whole device
410 * @active_duration: total time device is not suspended 410 * @active_duration: total time device is not suspended
411 * @autosuspend_delay: in jiffies
412 * @connect_time: time device was first connected 411 * @connect_time: time device was first connected
413 * @do_remote_wakeup: remote wakeup should be enabled 412 * @do_remote_wakeup: remote wakeup should be enabled
414 * @reset_resume: needs reset instead of resume 413 * @reset_resume: needs reset instead of resume
@@ -481,7 +480,6 @@ struct usb_device {
481 unsigned long active_duration; 480 unsigned long active_duration;
482 481
483#ifdef CONFIG_PM 482#ifdef CONFIG_PM
484 int autosuspend_delay;
485 unsigned long connect_time; 483 unsigned long connect_time;
486 484
487 unsigned do_remote_wakeup:1; 485 unsigned do_remote_wakeup:1;