]> git.karo-electronics.de Git - linux-beck.git/commitdiff
xhci-mem: Use setup_timer
authorJulia Lawall <Julia.Lawall@lip6.fr>
Fri, 9 Jan 2015 14:06:30 +0000 (16:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jan 2015 18:05:47 +0000 (10:05 -0800)
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.

A simplified version of the semantic match that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression t,f,d;
@@

-init_timer(&t);
+setup_timer(&t,f,d);
-t.data = d;
-t.function = f;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-mem.c

index 5cb3d7a10017a3eea2ad55a2fe9f487e4472b891..e72265c06f52dc7f1a57d98d976d424661c28019 100644 (file)
@@ -833,9 +833,8 @@ void xhci_free_stream_info(struct xhci_hcd *xhci,
 static void xhci_init_endpoint_timer(struct xhci_hcd *xhci,
                struct xhci_virt_ep *ep)
 {
-       init_timer(&ep->stop_cmd_timer);
-       ep->stop_cmd_timer.data = (unsigned long) ep;
-       ep->stop_cmd_timer.function = xhci_stop_endpoint_command_watchdog;
+       setup_timer(&ep->stop_cmd_timer, xhci_stop_endpoint_command_watchdog,
+                   (unsigned long)ep);
        ep->xhci = xhci;
 }
 
@@ -2509,9 +2508,8 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
        xhci_print_ir_set(xhci, 0);
 
        /* init command timeout timer */
-       init_timer(&xhci->cmd_timer);
-       xhci->cmd_timer.data = (unsigned long) xhci;
-       xhci->cmd_timer.function = xhci_handle_command_timeout;
+       setup_timer(&xhci->cmd_timer, xhci_handle_command_timeout,
+                   (unsigned long)xhci);
 
        /*
         * XXX: Might need to set the Interrupter Moderation Register to