Skip to content

Commit

Permalink
drivers: net: spider_net: use setup_timer() helper.
Browse files Browse the repository at this point in the history
Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Allen Pais authored and davem330 committed Sep 21, 2017
1 parent 18df06c commit e998092
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions drivers/net/ethernet/toshiba/spider_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -2256,16 +2256,14 @@ spider_net_setup_netdev(struct spider_net_card *card)

pci_set_drvdata(card->pdev, netdev);

init_timer(&card->tx_timer);
card->tx_timer.function =
(void (*)(unsigned long)) spider_net_cleanup_tx_ring;
card->tx_timer.data = (unsigned long) card;
setup_timer(&card->tx_timer,
(void(*)(unsigned long))spider_net_cleanup_tx_ring,
(unsigned long)card);
netdev->irq = card->pdev->irq;

card->aneg_count = 0;
init_timer(&card->aneg_timer);
card->aneg_timer.function = spider_net_link_phy;
card->aneg_timer.data = (unsigned long) card;
setup_timer(&card->aneg_timer, spider_net_link_phy,
(unsigned long)card);

netif_napi_add(netdev, &card->napi,
spider_net_poll, SPIDER_NET_NAPI_WEIGHT);
Expand Down

0 comments on commit e998092

Please sign in to comment.