aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/arm/at91_ether.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/arm/at91_ether.c')
-rw-r--r--drivers/net/arm/at91_ether.c16
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 @@
41#define DRV_NAME "at91_ether" 41#define DRV_NAME "at91_ether"
42#define DRV_VERSION "1.0" 42#define DRV_VERSION "1.0"
43 43
44static struct timer_list check_timer;
45#define LINK_POLL_INTERVAL (HZ) 44#define LINK_POLL_INTERVAL (HZ)
46 45
47/* ..................................................................... */ 46/* ..................................................................... */
@@ -250,8 +249,7 @@ static void enable_phyirq(struct net_device *dev)
250 * PHY doesn't have an IRQ pin (RTL8201, DP83847, AC101L), 249 * PHY doesn't have an IRQ pin (RTL8201, DP83847, AC101L),
251 * or board does not have it connected. 250 * or board does not have it connected.
252 */ 251 */
253 check_timer.expires = jiffies + LINK_POLL_INTERVAL; 252 mod_timer(&lp->check_timer, jiffies + LINK_POLL_INTERVAL);
254 add_timer(&check_timer);
255 return; 253 return;
256 } 254 }
257 255
@@ -298,7 +296,7 @@ static void disable_phyirq(struct net_device *dev)
298 296
299 irq_number = lp->board_data.phy_irq_pin; 297 irq_number = lp->board_data.phy_irq_pin;
300 if (!irq_number) { 298 if (!irq_number) {
301 del_timer_sync(&check_timer); 299 del_timer_sync(&lp->check_timer);
302 return; 300 return;
303 } 301 }
304 302
@@ -360,13 +358,13 @@ static void reset_phy(struct net_device *dev)
360static void at91ether_check_link(unsigned long dev_id) 358static void at91ether_check_link(unsigned long dev_id)
361{ 359{
362 struct net_device *dev = (struct net_device *) dev_id; 360 struct net_device *dev = (struct net_device *) dev_id;
361 struct at91_private *lp = netdev_priv(dev);
363 362
364 enable_mdi(); 363 enable_mdi();
365 update_linkspeed(dev, 1); 364 update_linkspeed(dev, 1);
366 disable_mdi(); 365 disable_mdi();
367 366
368 check_timer.expires = jiffies + LINK_POLL_INTERVAL; 367 mod_timer(&lp->check_timer, jiffies + LINK_POLL_INTERVAL);
369 add_timer(&check_timer);
370} 368}
371 369
372/* ......................... ADDRESS MANAGEMENT ........................ */ 370/* ......................... ADDRESS MANAGEMENT ........................ */
@@ -1030,9 +1028,9 @@ static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_add
1030 1028
1031 /* If board has no PHY IRQ, use a timer to poll the PHY */ 1029 /* If board has no PHY IRQ, use a timer to poll the PHY */
1032 if (!lp->board_data.phy_irq_pin) { 1030 if (!lp->board_data.phy_irq_pin) {
1033 init_timer(&check_timer); 1031 init_timer(&lp->check_timer);
1034 check_timer.data = (unsigned long)dev; 1032 lp->check_timer.data = (unsigned long)dev;
1035 check_timer.function = at91ether_check_link; 1033 lp->check_timer.function = at91ether_check_link;
1036 } 1034 }
1037 1035
1038 /* Display ethernet banner */ 1036 /* Display ethernet banner */