net: usb: 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: Woojung Huh <woojung.huh@microchip.com> Cc: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Ben Hutchings <ben@decadent.org.uk> Cc: Philippe Reynes <tremyfr@gmail.com> Cc: Jarod Wilson <jarod@redhat.com> Cc: Arvind Yadav <arvind.yadav.cs@gmail.com> Cc: "Bjørn Mork" <bjorn@mork.no> Cc: "Stefan Brüns" <stefan.bruens@rwth-aachen.de> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: Greg Ungerer <gerg@linux-m68k.org> Cc: linux-usb@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
dfc5700494
commit
d28bb967aa
@@ -3516,11 +3516,9 @@ static const struct net_device_ops lan78xx_netdev_ops = {
|
||||
.ndo_vlan_rx_kill_vid = lan78xx_vlan_rx_kill_vid,
|
||||
};
|
||||
|
||||
static void lan78xx_stat_monitor(unsigned long param)
|
||||
static void lan78xx_stat_monitor(struct timer_list *t)
|
||||
{
|
||||
struct lan78xx_net *dev;
|
||||
|
||||
dev = (struct lan78xx_net *)param;
|
||||
struct lan78xx_net *dev = from_timer(dev, t, stat_monitor);
|
||||
|
||||
lan78xx_defer_kevent(dev, EVENT_STAT_UPDATE);
|
||||
}
|
||||
@@ -3571,10 +3569,8 @@ static int lan78xx_probe(struct usb_interface *intf,
|
||||
netdev->watchdog_timeo = TX_TIMEOUT_JIFFIES;
|
||||
netdev->ethtool_ops = &lan78xx_ethtool_ops;
|
||||
|
||||
dev->stat_monitor.function = lan78xx_stat_monitor;
|
||||
dev->stat_monitor.data = (unsigned long)dev;
|
||||
dev->delta = 1;
|
||||
init_timer(&dev->stat_monitor);
|
||||
timer_setup(&dev->stat_monitor, lan78xx_stat_monitor, 0);
|
||||
|
||||
mutex_init(&dev->stats.access_lock);
|
||||
|
||||
|
Reference in New Issue
Block a user