@@ -446,10 +446,8 @@ static void compliance_mode_recovery_timer_init(struct xhci_hcd *xhci)
xhci->port_status_u0 = 0;
timer_setup(&xhci->comp_mode_recovery_timer, compliance_mode_recovery,
0);
- xhci->comp_mode_recovery_timer.expires = jiffies +
- msecs_to_jiffies(COMP_MODE_RCVRY_MSECS);
-
- add_timer(&xhci->comp_mode_recovery_timer);
+ mod_timer(&xhci->comp_mode_recovery_timer, jiffies +
+ msecs_to_jiffies(COMP_MODE_RCVRY_MSECS));
xhci_dbg_trace(xhci, trace_xhci_dbg_quirks,
"Compliance mode recovery timer initialized");
}
@@ -1505,8 +1503,8 @@ static int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
goto done;
}
ep->ep_state |= EP_STOP_CMD_PENDING;
- ep->stop_cmd_timer.expires = jiffies + XHCI_STOP_EP_CMD_TIMEOUT;
- add_timer(&ep->stop_cmd_timer);
+ mod_timer(&ep->stop_cmd_timer, jiffies +
+ XHCI_STOP_EP_CMD_TIMEOUT);
xhci_queue_stop_endpoint(xhci, command, urb->dev->slot_id,
ep_index, 0);
xhci_ring_cmd_db(xhci);
Instead of initializing t->expires and calling add_timer(t) right after, we can rely on mod_timer(t, expires) to handle the details for us. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> --- drivers/usb/host/xhci.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)