Commit 70a42ac1 authored by Kees Cook's avatar Kees Cook Committed by David S. Miller

drivers/net: appletalk/cops: 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: David Howells <dhowells@redhat.com>
Cc: netdev@vger.kernel.org
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c6c52ba1
...@@ -155,6 +155,7 @@ static int cops_irqlist[] = { ...@@ -155,6 +155,7 @@ static int cops_irqlist[] = {
}; };
static struct timer_list cops_timer; static struct timer_list cops_timer;
static struct net_device *cops_timer_dev;
/* use 0 for production, 1 for verification, 2 for debug, 3 for verbose debug */ /* use 0 for production, 1 for verification, 2 for debug, 3 for verbose debug */
#ifndef COPS_DEBUG #ifndef COPS_DEBUG
...@@ -187,7 +188,7 @@ static void cops_load (struct net_device *dev); ...@@ -187,7 +188,7 @@ static void cops_load (struct net_device *dev);
static int cops_nodeid (struct net_device *dev, int nodeid); static int cops_nodeid (struct net_device *dev, int nodeid);
static irqreturn_t cops_interrupt (int irq, void *dev_id); static irqreturn_t cops_interrupt (int irq, void *dev_id);
static void cops_poll (unsigned long ltdev); static void cops_poll(struct timer_list *t);
static void cops_timeout(struct net_device *dev); static void cops_timeout(struct net_device *dev);
static void cops_rx (struct net_device *dev); static void cops_rx (struct net_device *dev);
static netdev_tx_t cops_send_packet (struct sk_buff *skb, static netdev_tx_t cops_send_packet (struct sk_buff *skb,
...@@ -424,7 +425,8 @@ static int cops_open(struct net_device *dev) ...@@ -424,7 +425,8 @@ static int cops_open(struct net_device *dev)
*/ */
if(lp->board==TANGENT) /* Poll 20 times per second */ if(lp->board==TANGENT) /* Poll 20 times per second */
{ {
setup_timer(&cops_timer, cops_poll, (unsigned long)dev); cops_timer_dev = dev;
timer_setup(&cops_timer, cops_poll, 0);
cops_timer.expires = jiffies + HZ/20; cops_timer.expires = jiffies + HZ/20;
add_timer(&cops_timer); add_timer(&cops_timer);
} }
...@@ -671,12 +673,11 @@ static int cops_nodeid (struct net_device *dev, int nodeid) ...@@ -671,12 +673,11 @@ static int cops_nodeid (struct net_device *dev, int nodeid)
* Poll the Tangent type cards to see if we have work. * Poll the Tangent type cards to see if we have work.
*/ */
static void cops_poll(unsigned long ltdev) static void cops_poll(struct timer_list *unused)
{ {
int ioaddr, status; int ioaddr, status;
int boguscount = 0; int boguscount = 0;
struct net_device *dev = cops_timer_dev;
struct net_device *dev = (struct net_device *)ltdev;
del_timer(&cops_timer); del_timer(&cops_timer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment