Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/net: wan/lmc: 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: Allen Pais <allen.lkml@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Kees Cook and committed by
David S. Miller
605ea2f9 e2009be0

+5 -5
+5 -5
drivers/net/wan/lmc/lmc_main.c
··· 99 99 static void lmc_softreset(lmc_softc_t * const); 100 100 static void lmc_running_reset(struct net_device *dev); 101 101 static int lmc_ifdown(struct net_device * const); 102 - static void lmc_watchdog(unsigned long data); 102 + static void lmc_watchdog(struct timer_list *t); 103 103 static void lmc_reset(lmc_softc_t * const sc); 104 104 static void lmc_dec_reset(lmc_softc_t * const sc); 105 105 static void lmc_driver_timeout(struct net_device *dev); ··· 636 636 637 637 638 638 /* the watchdog process that cruises around */ 639 - static void lmc_watchdog (unsigned long data) /*fold00*/ 639 + static void lmc_watchdog(struct timer_list *t) /*fold00*/ 640 640 { 641 - struct net_device *dev = (struct net_device *)data; 642 - lmc_softc_t *sc = dev_to_sc(dev); 641 + lmc_softc_t *sc = from_timer(sc, t, timer); 642 + struct net_device *dev = sc->lmc_device; 643 643 int link_status; 644 644 u32 ticks; 645 645 unsigned long flags; ··· 1084 1084 * Setup a timer for the watchdog on probe, and start it running. 1085 1085 * Since lmc_ok == 0, it will be a NOP for now. 1086 1086 */ 1087 - setup_timer(&sc->timer, lmc_watchdog, (unsigned long)dev); 1087 + timer_setup(&sc->timer, lmc_watchdog, 0); 1088 1088 sc->timer.expires = jiffies + HZ; 1089 1089 add_timer (&sc->timer); 1090 1090