From e053b628d367cd7b39ae2c4bb0124edc2e058a41 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 31 Oct 2008 16:52:04 -0700 Subject: 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 Signed-off-by: Jeff Garzik --- drivers/net/atlx/atl2.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/net/atlx/atl2.c') diff --git a/drivers/net/atlx/atl2.c b/drivers/net/atlx/atl2.c index 8c5d009ca82..21ca6dd78b1 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; -- cgit v1.2.3