Skip to content

Commit b973154

Browse files
Jan Koniarikdavem330
authored andcommitted
atm: idt77252, use setup_timer and mod_timer
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 <jan.koniarik@trustica.cz> Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Chas Williams <3chas3@gmail.com> Cc: <linux-atm-general@lists.sourceforge.net> Cc: <netdev@vger.kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 0c921a8 commit b973154

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

drivers/atm/idt77252.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2132,12 +2132,8 @@ idt77252_init_est(struct vc_map *vc, int pcr)
21322132

21332133
est->interval = 2; /* XXX: make this configurable */
21342134
est->ewma_log = 2; /* XXX: make this configurable */
2135-
init_timer(&est->timer);
2136-
est->timer.data = (unsigned long)vc;
2137-
est->timer.function = idt77252_est_timer;
2138-
2139-
est->timer.expires = jiffies + ((HZ / 4) << est->interval);
2140-
add_timer(&est->timer);
2135+
setup_timer(&est->timer, idt77252_est_timer, (unsigned long)vc);
2136+
mod_timer(&est->timer, jiffies + ((HZ / 4) << est->interval));
21412137

21422138
return est;
21432139
}
@@ -3638,9 +3634,7 @@ static int idt77252_init_one(struct pci_dev *pcidev,
36383634
spin_lock_init(&card->cmd_lock);
36393635
spin_lock_init(&card->tst_lock);
36403636

3641-
init_timer(&card->tst_timer);
3642-
card->tst_timer.data = (unsigned long)card;
3643-
card->tst_timer.function = tst_timer;
3637+
setup_timer(&card->tst_timer, tst_timer, (unsigned long)card);
36443638

36453639
/* Do the I/O remapping... */
36463640
card->membase = ioremap(membase, 1024);

0 commit comments

Comments
 (0)