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

drivers/net: wan/sdla: 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: Tobias Klauser <tklauser@distanz.ch>
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
032cfd66 605ea2f9

+6 -7
+5 -7
drivers/net/wan/sdla.c
··· 927 927 return IRQ_HANDLED; 928 928 } 929 929 930 - static void sdla_poll(unsigned long device) 930 + static void sdla_poll(struct timer_list *t) 931 931 { 932 - struct net_device *dev; 933 - struct frad_local *flp; 934 - 935 - dev = (struct net_device *) device; 936 - flp = netdev_priv(dev); 932 + struct frad_local *flp = from_timer(flp, t, timer); 933 + struct net_device *dev = flp->dev; 937 934 938 935 if (sdla_byte(dev, SDLA_502_RCV_BUF)) 939 936 sdla_receive(dev); ··· 1613 1616 flp->assoc = sdla_assoc; 1614 1617 flp->deassoc = sdla_deassoc; 1615 1618 flp->dlci_conf = sdla_dlci_conf; 1619 + flp->dev = dev; 1616 1620 1617 - setup_timer(&flp->timer, sdla_poll, (unsigned long)dev); 1621 + timer_setup(&flp->timer, sdla_poll, 0); 1618 1622 flp->timer.expires = 1; 1619 1623 } 1620 1624
+1
include/linux/if_frad.h
··· 83 83 84 84 /* fields that are used by the Sangoma SDLA cards */ 85 85 struct timer_list timer; 86 + struct net_device *dev; 86 87 int type; /* adapter type */ 87 88 int state; /* state of the S502/8 control latch */ 88 89 int buffer; /* current buffer for S508 firmware */