OSDN Git Service

drivers: net: slip: use setup_timer() helper.
authorAllen Pais <allen.lkml@gmail.com>
Thu, 21 Sep 2017 17:04:40 +0000 (22:34 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Sep 2017 18:44:40 +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/slip/slip.c

index 436dd78..eb8a189 100644 (file)
@@ -763,12 +763,8 @@ static struct slip *sl_alloc(dev_t line)
        sl->mode        = SL_MODE_DEFAULT;
 #ifdef CONFIG_SLIP_SMART
        /* initialize timer_list struct */
-       init_timer(&sl->keepalive_timer);
-       sl->keepalive_timer.data = (unsigned long)sl;
-       sl->keepalive_timer.function = sl_keepalive;
-       init_timer(&sl->outfill_timer);
-       sl->outfill_timer.data = (unsigned long)sl;
-       sl->outfill_timer.function = sl_outfill;
+       setup_timer(&sl->keepalive_timer, sl_keepalive, (unsigned long)sl);
+       setup_timer(&sl->outfill_timer, sl_outfill, (unsigned long)sl);
 #endif
        slip_devs[i] = dev;
        return sl;