diff options
author | Kees Cook <keescook@chromium.org> | 2017-10-26 22:54:38 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-28 19:09:49 +0900 |
commit | c6c52ba1514120db3ad2d36391ed37bafcfc43d7 (patch) | |
tree | 92154e5d57ad96d2e4c7ebc5371623092705565a /drivers/net/ethernet/amd/a2065.c | |
parent | c63144e4dda7967f2419fa3c2cc5db1228a7fccf (diff) | |
download | lwn-c6c52ba1514120db3ad2d36391ed37bafcfc43d7.tar.gz lwn-c6c52ba1514120db3ad2d36391ed37bafcfc43d7.zip |
drivers/net: amd: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Allen Pais <allen.lkml@gmail.com>
Cc: netdev@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/amd/a2065.c')
-rw-r--r-- | drivers/net/ethernet/amd/a2065.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/ethernet/amd/a2065.c b/drivers/net/ethernet/amd/a2065.c index 998d30e050a6..212fe72a190b 100644 --- a/drivers/net/ethernet/amd/a2065.c +++ b/drivers/net/ethernet/amd/a2065.c @@ -123,6 +123,7 @@ struct lance_private { int burst_sizes; /* ledma SBus burst sizes */ #endif struct timer_list multicast_timer; + struct net_device *dev; }; #define LANCE_ADDR(x) ((int)(x) & ~0xff000000) @@ -638,6 +639,13 @@ static void lance_set_multicast(struct net_device *dev) netif_wake_queue(dev); } +static void lance_set_multicast_retry(struct timer_list *t) +{ + struct lance_private *lp = from_timer(lp, t, multicast_timer); + + lance_set_multicast(lp->dev); +} + static int a2065_init_one(struct zorro_dev *z, const struct zorro_device_id *ent); static void a2065_remove_one(struct zorro_dev *z); @@ -728,14 +736,13 @@ static int a2065_init_one(struct zorro_dev *z, priv->lance_log_tx_bufs = LANCE_LOG_TX_BUFFERS; priv->rx_ring_mod_mask = RX_RING_MOD_MASK; priv->tx_ring_mod_mask = TX_RING_MOD_MASK; + priv->dev = dev; dev->netdev_ops = &lance_netdev_ops; dev->watchdog_timeo = 5*HZ; dev->dma = 0; - setup_timer(&priv->multicast_timer, - (void(*)(unsigned long))lance_set_multicast, - (unsigned long)dev); + timer_setup(&priv->multicast_timer, lance_set_multicast_retry, 0); err = register_netdev(dev); if (err) { |