]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drivers: net: can: usb: use setup_timer() helper.
authorAllen Pais <allen.lkml@gmail.com>
Thu, 21 Sep 2017 17:04:56 +0000 (22:34 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Sep 2017 18:44:42 +0000 (11:44 -0700)
Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/can/usb/peak_usb/pcan_usb.c

index 838545ce468d1bc9af34b8d451107f966fa5972f..7e10dbdded28630edfa59bba0e510258736e6268 100644 (file)
@@ -798,9 +798,8 @@ static int pcan_usb_init(struct peak_usb_device *dev)
        int err;
 
        /* initialize a timer needed to wait for hardware restart */
-       init_timer(&pdev->restart_timer);
-       pdev->restart_timer.function = pcan_usb_restart;
-       pdev->restart_timer.data = (unsigned long)dev;
+       setup_timer(&pdev->restart_timer, pcan_usb_restart,
+                   (unsigned long)dev);
 
        /*
         * explicit use of dev_xxx() instead of netdev_xxx() here: