diff options
author | Andrew Victor <andrew@sanpeople.com> | 2006-12-05 14:21:19 +0100 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-07 10:58:32 +0100 |
commit | cf42553ab43e102bc98eca05523d2390a1eedde9 (patch) | |
tree | dab613b886543e98c66d40ac44912ae6acabee66 /drivers/net/arm/at91_ether.c | |
parent | [PATCH] AT91RM9200 Ethernet: Remove 'at91_dev' and use netdev_priv() (diff) | |
download | linux-cf42553ab43e102bc98eca05523d2390a1eedde9.tar.xz linux-cf42553ab43e102bc98eca05523d2390a1eedde9.zip |
[PATCH] AT91RM9200 Ethernet: Move check_timer variable and use mod_timer()
Move the global 'check_timer' variable into the private data structure.
Also now use mod_timer().
Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/arm/at91_ether.c')
-rw-r--r-- | drivers/net/arm/at91_ether.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c index 58da5b773350..918368cdb766 100644 --- a/drivers/net/arm/at91_ether.c +++ b/drivers/net/arm/at91_ether.c @@ -41,7 +41,6 @@ #define DRV_NAME "at91_ether" #define DRV_VERSION "1.0" -static struct timer_list check_timer; #define LINK_POLL_INTERVAL (HZ) /* ..................................................................... */ @@ -250,8 +249,7 @@ static void enable_phyirq(struct net_device *dev) * PHY doesn't have an IRQ pin (RTL8201, DP83847, AC101L), * or board does not have it connected. */ - check_timer.expires = jiffies + LINK_POLL_INTERVAL; - add_timer(&check_timer); + mod_timer(&lp->check_timer, jiffies + LINK_POLL_INTERVAL); return; } @@ -298,7 +296,7 @@ static void disable_phyirq(struct net_device *dev) irq_number = lp->board_data.phy_irq_pin; if (!irq_number) { - del_timer_sync(&check_timer); + del_timer_sync(&lp->check_timer); return; } @@ -360,13 +358,13 @@ static void reset_phy(struct net_device *dev) static void at91ether_check_link(unsigned long dev_id) { struct net_device *dev = (struct net_device *) dev_id; + struct at91_private *lp = netdev_priv(dev); enable_mdi(); update_linkspeed(dev, 1); disable_mdi(); - check_timer.expires = jiffies + LINK_POLL_INTERVAL; - add_timer(&check_timer); + mod_timer(&lp->check_timer, jiffies + LINK_POLL_INTERVAL); } /* ......................... ADDRESS MANAGEMENT ........................ */ @@ -1030,9 +1028,9 @@ static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_add /* If board has no PHY IRQ, use a timer to poll the PHY */ if (!lp->board_data.phy_irq_pin) { - init_timer(&check_timer); - check_timer.data = (unsigned long)dev; - check_timer.function = at91ether_check_link; + init_timer(&lp->check_timer); + lp->check_timer.data = (unsigned long)dev; + lp->check_timer.function = at91ether_check_link; } /* Display ethernet banner */ |