summaryrefslogtreecommitdiff
path: root/drivers/net/appletalk/ltpc.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-10-18 12:40:40 +0100
committerDavid S. Miller <davem@davemloft.net>2017-10-18 12:40:40 +0100
commit2af55f460738c78e63596e320f6dbde0cd4cfb84 (patch)
tree149c0e1ec9e7711d559c76ea0e5d82893d92b168 /drivers/net/appletalk/ltpc.c
parent1bbc728988f09e40c83585cf3322b1f6c1aa17b5 (diff)
parentff861c4d64f2df1c7eaabaf2ba8f2f8ebc4b28e3 (diff)
downloadlinux-2af55f460738c78e63596e320f6dbde0cd4cfb84.tar.gz
linux-2af55f460738c78e63596e320f6dbde0cd4cfb84.tar.xz
Merge branch 'networking-Convert-timers-to-use-timer_setup'
Kees Cook says: ==================== networking: Convert timers to use timer_setup() This is the current set of outstanding networking patches to perform conversions to the new timer interface (rebased to -next). This is not all expected conversions, but it contains everything needed in networking to eliminate init_timer(), and all the non-standard setup_*_timer() uses. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/appletalk/ltpc.c')
-rw-r--r--drivers/net/appletalk/ltpc.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c
index e4aa374caa4d..75a5a9b87c5a 100644
--- a/drivers/net/appletalk/ltpc.c
+++ b/drivers/net/appletalk/ltpc.c
@@ -694,6 +694,7 @@ static int do_read(struct net_device *dev, void *cbuf, int cbuflen,
/* end of idle handlers -- what should be seen is do_read, do_write */
static struct timer_list ltpc_timer;
+static struct net_device *ltpc_timer_dev;
static netdev_tx_t ltpc_xmit(struct sk_buff *skb, struct net_device *dev);
@@ -867,10 +868,8 @@ static void set_multicast_list(struct net_device *dev)
static int ltpc_poll_counter;
-static void ltpc_poll(unsigned long l)
+static void ltpc_poll(struct timer_list *unused)
{
- struct net_device *dev = (struct net_device *) l;
-
del_timer(&ltpc_timer);
if(debug & DEBUG_VERBOSE) {
@@ -880,14 +879,10 @@ static void ltpc_poll(unsigned long l)
}
ltpc_poll_counter--;
}
-
- if (!dev)
- return; /* we've been downed */
/* poll 20 times per second */
- idle(dev);
+ idle(ltpc_timer_dev);
ltpc_timer.expires = jiffies + HZ/20;
-
add_timer(&ltpc_timer);
}
@@ -1165,7 +1160,8 @@ struct net_device * __init ltpc_probe(void)
dev->irq = 0;
/* polled mode -- 20 times per second */
/* this is really, really slow... should it poll more often? */
- setup_timer(&ltpc_timer, ltpc_poll, (unsigned long)dev);
+ ltpc_timer_dev = dev;
+ timer_setup(&ltpc_timer, ltpc_poll, 0);
ltpc_timer.expires = jiffies + HZ/20;
add_timer(&ltpc_timer);
@@ -1252,8 +1248,6 @@ static void __exit ltpc_cleanup(void)
if(debug & DEBUG_VERBOSE) printk("unregister_netdev\n");
unregister_netdev(dev_ltpc);
- ltpc_timer.data = 0; /* signal the poll routine that we're done */
-
del_timer_sync(&ltpc_timer);
if(debug & DEBUG_VERBOSE) printk("freeing irq\n");