atm: idt77252, use setup_timer and mod_timer
authorJan Koniarik <[email protected]>
Wed, 15 Feb 2017 15:59:35 +0000 (16:59 +0100)
committerDavid S. Miller <[email protected]>
Wed, 15 Feb 2017 18:24:53 +0000 (13:24 -0500)
Stop accessing timer struct members directly and use setup_timer and
mod_timer helpers intended for that use. It makes the code cleaner and
will allow for easier change of the timer struct internals.

Signed-off-by: Jan Koniarik <[email protected]>
Signed-off-by: Jiri Slaby <[email protected]>
Cc: Chas Williams <[email protected]>
Cc: <[email protected]>
Cc: <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
drivers/atm/idt77252.c

index 471ddfd93ea87b2d4da09b398bb6982b735036b8..5ec109533bb9129519e066fd2409af8c333eb8bc 100644 (file)
@@ -2132,12 +2132,8 @@ idt77252_init_est(struct vc_map *vc, int pcr)
 
        est->interval = 2;              /* XXX: make this configurable */
        est->ewma_log = 2;              /* XXX: make this configurable */
-       init_timer(&est->timer);
-       est->timer.data = (unsigned long)vc;
-       est->timer.function = idt77252_est_timer;
-
-       est->timer.expires = jiffies + ((HZ / 4) << est->interval);
-       add_timer(&est->timer);
+       setup_timer(&est->timer, idt77252_est_timer, (unsigned long)vc);
+       mod_timer(&est->timer, jiffies + ((HZ / 4) << est->interval));
 
        return est;
 }
@@ -3638,9 +3634,7 @@ static int idt77252_init_one(struct pci_dev *pcidev,
        spin_lock_init(&card->cmd_lock);
        spin_lock_init(&card->tst_lock);
 
-       init_timer(&card->tst_timer);
-       card->tst_timer.data = (unsigned long)card;
-       card->tst_timer.function = tst_timer;
+       setup_timer(&card->tst_timer, tst_timer, (unsigned long)card);
 
        /* Do the I/O remapping... */
        card->membase = ioremap(membase, 1024);