diff options
Diffstat (limited to 'drivers/net/appletalk')
-rw-r--r-- | drivers/net/appletalk/cops.c | 13 | ||||
-rw-r--r-- | drivers/net/appletalk/ltpc.c | 18 |
2 files changed, 11 insertions, 20 deletions
diff --git a/drivers/net/appletalk/cops.c b/drivers/net/appletalk/cops.c index 486e1e6997fc..bb49f6e40a19 100644 --- a/drivers/net/appletalk/cops.c +++ b/drivers/net/appletalk/cops.c @@ -155,6 +155,7 @@ static int cops_irqlist[] = { }; 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 */ #ifndef COPS_DEBUG @@ -187,7 +188,7 @@ static void cops_load (struct net_device *dev); static int cops_nodeid (struct net_device *dev, int nodeid); 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_rx (struct net_device *dev); static netdev_tx_t cops_send_packet (struct sk_buff *skb, @@ -424,9 +425,8 @@ static int cops_open(struct net_device *dev) */ if(lp->board==TANGENT) /* Poll 20 times per second */ { - init_timer(&cops_timer); - cops_timer.function = cops_poll; - cops_timer.data = (unsigned long)dev; + cops_timer_dev = dev; + timer_setup(&cops_timer, cops_poll, 0); cops_timer.expires = jiffies + HZ/20; add_timer(&cops_timer); } @@ -673,12 +673,11 @@ static int cops_nodeid (struct net_device *dev, int nodeid) * 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 boguscount = 0; - - struct net_device *dev = (struct net_device *)ltdev; + struct net_device *dev = cops_timer_dev; del_timer(&cops_timer); diff --git a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c index ac755d2950a6..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(<pc_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(<pc_timer); } @@ -1165,9 +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? */ - init_timer(<pc_timer); - ltpc_timer.function=ltpc_poll; - ltpc_timer.data = (unsigned long) dev; + ltpc_timer_dev = dev; + timer_setup(<pc_timer, ltpc_poll, 0); ltpc_timer.expires = jiffies + HZ/20; add_timer(<pc_timer); @@ -1254,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(<pc_timer); if(debug & DEBUG_VERBOSE) printk("freeing irq\n"); |