diff options
author | Kees Cook <keescook@chromium.org> | 2017-10-27 07:54:38 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-28 12:09:49 +0200 |
commit | c6c52ba1514120db3ad2d36391ed37bafcfc43d7 (patch) | |
tree | 92154e5d57ad96d2e4c7ebc5371623092705565a /drivers/net/ethernet/amd/am79c961a.c | |
parent | drivers/net: 8390: Convert timers to use timer_setup() (diff) | |
download | linux-c6c52ba1514120db3ad2d36391ed37bafcfc43d7.tar.xz linux-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/am79c961a.c')
-rw-r--r-- | drivers/net/ethernet/amd/am79c961a.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/ethernet/amd/am79c961a.c b/drivers/net/ethernet/amd/am79c961a.c index 0612dbee00d2..01d132c02ff9 100644 --- a/drivers/net/ethernet/amd/am79c961a.c +++ b/drivers/net/ethernet/amd/am79c961a.c @@ -302,10 +302,10 @@ am79c961_init_for_open(struct net_device *dev) write_rreg (dev->base_addr, CSR0, CSR0_IENA|CSR0_STRT); } -static void am79c961_timer(unsigned long data) +static void am79c961_timer(struct timer_list *t) { - struct net_device *dev = (struct net_device *)data; - struct dev_priv *priv = netdev_priv(dev); + struct dev_priv *priv = from_timer(priv, t, timer); + struct net_device *dev = priv->dev; unsigned int lnkstat, carrier; unsigned long flags; @@ -728,7 +728,8 @@ static int am79c961_probe(struct platform_device *pdev) am79c961_banner(); spin_lock_init(&priv->chip_lock); - setup_timer(&priv->timer, am79c961_timer, (unsigned long)dev); + priv->dev = dev; + timer_setup(&priv->timer, am79c961_timer, 0); if (am79c961_hw_init(dev)) goto release; |