aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/atlx/atl2.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2008-10-31 16:52:04 -0700
committerJeff Garzik <jgarzik@redhat.com>2008-11-02 08:00:15 -0500
commite053b628d367cd7b39ae2c4bb0124edc2e058a41 (patch)
treee5a5c6ae57e55185f92ea6f453a70a32663b6dbf /drivers/net/atlx/atl2.c
parentatlx: use embedded net_device_stats (diff)
downloadlinux-dev-e053b628d367cd7b39ae2c4bb0124edc2e058a41.tar.xz
linux-dev-e053b628d367cd7b39ae2c4bb0124edc2e058a41.zip
atlx: timer cleanup
Do some cleanup on timer usage in this driver: * Use round_jiffies to align wakeups and reduce power. * Remove atl1_watchdog which does nothing but rearm itself * Use setup_timer() function Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to '')
-rw-r--r--drivers/net/atlx/atl2.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/atlx/atl2.c b/drivers/net/atlx/atl2.c
index 8c5d009ca821..21ca6dd78b18 100644
--- a/drivers/net/atlx/atl2.c
+++ b/drivers/net/atlx/atl2.c
@@ -724,7 +724,7 @@ static int atl2_open(struct net_device *netdev)
clear_bit(__ATL2_DOWN, &adapter->flags);
- mod_timer(&adapter->watchdog_timer, jiffies + 4*HZ);
+ mod_timer(&adapter->watchdog_timer, round_jiffies(jiffies + 4*HZ));
val = ATL2_READ_REG(&adapter->hw, REG_MASTER_CTRL);
ATL2_WRITE_REG(&adapter->hw, REG_MASTER_CTRL,
@@ -1051,7 +1051,8 @@ static void atl2_watchdog(unsigned long data)
adapter->netdev->stats.rx_over_errors += drop_rxd + drop_rxs;
/* Reset the timer */
- mod_timer(&adapter->watchdog_timer, jiffies + 4 * HZ);
+ mod_timer(&adapter->watchdog_timer,
+ round_jiffies(jiffies + 4 * HZ));
}
}
@@ -1255,7 +1256,8 @@ static int atl2_check_link(struct atl2_adapter *adapter)
* (if interval smaller than 5 seconds, something strange) */
if (!test_bit(__ATL2_DOWN, &adapter->flags)) {
if (!test_and_set_bit(0, &adapter->cfg_phy))
- mod_timer(&adapter->phy_config_timer, jiffies + 5 * HZ);
+ mod_timer(&adapter->phy_config_timer,
+ round_jiffies(jiffies + 5 * HZ));
}
return 0;