提交 4ec06d62 编写于 作者: A Alan Stern 提交者: Greg Kroah-Hartman

USB: utilize round_jiffies_up_relative()

This patch (as1178) uses the new round_jiffies_up_relative() routine
for setting the autosuspend delayed_work timer.  It's appropriate
since we don't care too much about the exact length of the delay, but
we don't want it to be too short (rounded down).
Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 3cb22d65
...@@ -1111,7 +1111,7 @@ static int autosuspend_check(struct usb_device *udev, int reschedule) ...@@ -1111,7 +1111,7 @@ static int autosuspend_check(struct usb_device *udev, int reschedule)
if (reschedule) { if (reschedule) {
if (!timer_pending(&udev->autosuspend.timer)) { if (!timer_pending(&udev->autosuspend.timer)) {
queue_delayed_work(ksuspend_usb_wq, &udev->autosuspend, queue_delayed_work(ksuspend_usb_wq, &udev->autosuspend,
round_jiffies_relative(suspend_time - j)); round_jiffies_up_relative(suspend_time - j));
} }
return -EAGAIN; return -EAGAIN;
} }
...@@ -1553,7 +1553,7 @@ void usb_autopm_put_interface_async(struct usb_interface *intf) ...@@ -1553,7 +1553,7 @@ void usb_autopm_put_interface_async(struct usb_interface *intf)
else if (intf->pm_usage_cnt <= 0 && else if (intf->pm_usage_cnt <= 0 &&
!timer_pending(&udev->autosuspend.timer)) { !timer_pending(&udev->autosuspend.timer)) {
queue_delayed_work(ksuspend_usb_wq, &udev->autosuspend, queue_delayed_work(ksuspend_usb_wq, &udev->autosuspend,
round_jiffies_relative( round_jiffies_up_relative(
udev->autosuspend_delay)); udev->autosuspend_delay));
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册