aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/packetengines/yellowfin.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-10-26 22:55:34 -0700
committerDavid S. Miller <davem@davemloft.net>2017-10-28 19:09:49 +0900
commit8089c6f4777f394407d63e217314f934b85a7947 (patch)
treee24d794a9f397c1cbf6bbd7e2ab28d266bf7e5b0 /drivers/net/ethernet/packetengines/yellowfin.c
parentdrivers/net: natsemi: Convert timers to use timer_setup() (diff)
downloadlinux-dev-8089c6f4777f394407d63e217314f934b85a7947.tar.xz
linux-dev-8089c6f4777f394407d63e217314f934b85a7947.zip
drivers/net: packetengines: 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: "David S. Miller" <davem@davemloft.net> Cc: Allen Pais <allen.lkml@gmail.com> Cc: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn> Cc: Philippe Reynes <tremyfr@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/packetengines/yellowfin.c')
-rw-r--r--drivers/net/ethernet/packetengines/yellowfin.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/ethernet/packetengines/yellowfin.c b/drivers/net/ethernet/packetengines/yellowfin.c
index 33c241f52a71..54224d1822e3 100644
--- a/drivers/net/ethernet/packetengines/yellowfin.c
+++ b/drivers/net/ethernet/packetengines/yellowfin.c
@@ -343,7 +343,7 @@ static int mdio_read(void __iomem *ioaddr, int phy_id, int location);
static void mdio_write(void __iomem *ioaddr, int phy_id, int location, int value);
static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
static int yellowfin_open(struct net_device *dev);
-static void yellowfin_timer(unsigned long data);
+static void yellowfin_timer(struct timer_list *t);
static void yellowfin_tx_timeout(struct net_device *dev);
static int yellowfin_init_ring(struct net_device *dev);
static netdev_tx_t yellowfin_start_xmit(struct sk_buff *skb,
@@ -632,7 +632,7 @@ static int yellowfin_open(struct net_device *dev)
}
/* Set the timer to check for link beat. */
- setup_timer(&yp->timer, yellowfin_timer, (unsigned long)dev);
+ timer_setup(&yp->timer, yellowfin_timer, 0);
yp->timer.expires = jiffies + 3*HZ;
add_timer(&yp->timer);
out:
@@ -643,10 +643,10 @@ err_free_irq:
goto out;
}
-static void yellowfin_timer(unsigned long data)
+static void yellowfin_timer(struct timer_list *t)
{
- struct net_device *dev = (struct net_device *)data;
- struct yellowfin_private *yp = netdev_priv(dev);
+ struct yellowfin_private *yp = from_timer(yp, t, timer);
+ struct net_device *dev = pci_get_drvdata(yp->pci_dev);
void __iomem *ioaddr = yp->base;
int next_tick = 60*HZ;