aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/atlx/atl2.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2008-10-31 19:52:04 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-11-02 08:00:15 -0500
commite053b628d367cd7b39ae2c4bb0124edc2e058a41 (patch)
treee5a5c6ae57e55185f92ea6f453a70a32663b6dbf /drivers/net/atlx/atl2.c
parent02e7173149c3ffcf963075ec2bdc5f7be8335a78 (diff)
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 'drivers/net/atlx/atl2.c')
-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)
724 724
725 clear_bit(__ATL2_DOWN, &adapter->flags); 725 clear_bit(__ATL2_DOWN, &adapter->flags);
726 726
727 mod_timer(&adapter->watchdog_timer, jiffies + 4*HZ); 727 mod_timer(&adapter->watchdog_timer, round_jiffies(jiffies + 4*HZ));
728 728
729 val = ATL2_READ_REG(&adapter->hw, REG_MASTER_CTRL); 729 val = ATL2_READ_REG(&adapter->hw, REG_MASTER_CTRL);
730 ATL2_WRITE_REG(&adapter->hw, REG_MASTER_CTRL, 730 ATL2_WRITE_REG(&adapter->hw, REG_MASTER_CTRL,
@@ -1051,7 +1051,8 @@ static void atl2_watchdog(unsigned long data)
1051 adapter->netdev->stats.rx_over_errors += drop_rxd + drop_rxs; 1051 adapter->netdev->stats.rx_over_errors += drop_rxd + drop_rxs;
1052 1052
1053 /* Reset the timer */ 1053 /* Reset the timer */
1054 mod_timer(&adapter->watchdog_timer, jiffies + 4 * HZ); 1054 mod_timer(&adapter->watchdog_timer,
1055 round_jiffies(jiffies + 4 * HZ));
1055 } 1056 }
1056} 1057}
1057 1058
@@ -1255,7 +1256,8 @@ static int atl2_check_link(struct atl2_adapter *adapter)
1255 * (if interval smaller than 5 seconds, something strange) */ 1256 * (if interval smaller than 5 seconds, something strange) */
1256 if (!test_bit(__ATL2_DOWN, &adapter->flags)) { 1257 if (!test_bit(__ATL2_DOWN, &adapter->flags)) {
1257 if (!test_and_set_bit(0, &adapter->cfg_phy)) 1258 if (!test_and_set_bit(0, &adapter->cfg_phy))
1258 mod_timer(&adapter->phy_config_timer, jiffies + 5 * HZ); 1259 mod_timer(&adapter->phy_config_timer,
1260 round_jiffies(jiffies + 5 * HZ));
1259 } 1261 }
1260 1262
1261 return 0; 1263 return 0;